@adatechnology/game-destruction 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,7 +53,7 @@ millimetre, ductility and fracture style drive the model.
53
53
  | Family | Ids | Behaviour |
54
54
  |---|---|---|
55
55
  | Metal | `steel`, `cast_iron`, `aluminium`, `copper` | dent, holes, sparks, ricochet, glow when hot; melt at 1450 / 1200 / 660 / 1085 °C. Never fracture (cast iron cracks and snaps) |
56
- | Wood | `wood_soft`, `wood_hard`, `plywood`, `mdf` | splinter or snap, ignite near 300 °C, burn, char, turn to ash |
56
+ | Wood | `wood_soft`, `wood_hard`, `plywood`, `mdf` | splinter or snap, ignite near 300 °C, burn, char, turn to ash; `splitForm` says how each comes apart: solid wood in pointed slivers of many sizes along the grain (and broken stubs with a torn end), plywood in thin splinters and veneer sheets that peel apart in layers, MDF in crumbly lumps and dust with no grain |
57
57
  | Glass and ceramic | `glass`, `tempered_glass`, `ceramic` | crack, then `shatter` into shards (`tempered_glass` is `crumble` into tiny chunks); thermal shock |
58
58
  | Masonry and soil | `concrete`, `brick`, `plaster`, `stone`, `soil` | `crumble` with dust and chips; do not burn |
59
59
  | Plastics | `plastic`, `rubber`, `foam`, `wax` | plastic snaps and melts near 200 °C, rubber and foam burn with black smoke, wax melts at 60 °C |
@@ -263,6 +263,18 @@ panels), `drywall`, `wood_frame_wall`, `log_wall`, `sheet_metal_shack`, `glass_p
263
263
  that is a fracture. So a 9 mm burst never leaves stage 1 on plastered brick (it does not even go through), a rifle never breaches reinforced
264
264
  concrete, a sledgehammer opens plastered brick after ~47 swings and a C4 or RPG opens reinforced concrete at once. The engine stays in joules: the
265
265
  game tunes energies, `breach: { radius, blastFactor }` and each assembly's `breach.area`.
266
+ - **A blast on a wall of units** (brick or block laid in its mortar, `units.mortar` other than the part's material) does not wait for the breach: the
267
+ units within the circle its reach cuts on the wall come out at once, one `chip` with every unit in `units`. The reach is `0.12 m x cbrt(kJ)` for the
268
+ houses' 13 cm brick wall and shrinks with the cube root of how much more the wall resists (joules per kg to knock a unit out x density x thickness), so
269
+ a frag grenade (200 kJ) 40 cm from the room's wall takes about 1.9 m² of its 28 m², and the edge is ragged as the bricks come out. The units just past
270
+ the edge are loosened for the next blow; the units the hole leaves without bearing (`unsupportedCells`: the courses over it step in half a brick each,
271
+ and at a free end all that hangs over the hole) come down too. The part stays at stage 1, so later shots and blasts keep cutting it. A blast wears a
272
+ joint only over the stretch it breaks (`2 x reach`), at most that share of the joint's strength, so it does not drop a whole wall from one point.
273
+ A cast part (concrete, whose `units` are only how it breaks) still opens one breach.
274
+ - **Bricks that lose their bearing fall.** After every unit a shot, a blow, a breach or a blast takes out of a wall of laid units, the load path of each
275
+ unit left is followed down to the bottom of the wall: a unit stands while its bed overlaps a standing unit of the course below by at least a quarter
276
+ of a unit, or while it is wedged between two standing units of its own course (a gap of two bricks holds). The rest (an island over a hole, a strip
277
+ between two slots, a brick held by a corner) comes down as debris in one `chip` with `units`.
266
278
  - **Reinforced concrete.** At 0 hp the concrete crumbles (`fracture`, in panels when `units` is set) but the part does not go: it becomes its rebar cage
267
279
  (`PartState.stripped`, `expose` with the bars in world space, stage 3), still part of the structure with `capacity x residualCapacity` (default 0.15).
268
280
  A bare cage under load is overloaded in seconds (`overloadRate`), so the frame fails progressively: `expose`, `stress`, the cage is lost (`expose` with
package/dist/index.d.ts CHANGED
@@ -35,6 +35,12 @@ interface MaterialThermal {
35
35
  /** Smoke the material gives while burning (`black` for plastic and rubber). */
36
36
  smoke?: 'white' | 'grey' | 'black';
37
37
  }
38
+ /**
39
+ * How a wood-based material comes apart (`MaterialDef.splitForm`): `slivers` (solid wood: pointed splinters of many sizes along the grain, with
40
+ * ragged ends), `plies` (plywood: thin splinters, and the veneer sheets peel apart in layers), `granules` (MDF, particle board: no grain, crumbly
41
+ * lumps and dust).
42
+ */
43
+ type SplitForm = 'slivers' | 'plies' | 'granules';
38
44
  /** What one kind of blow does to a material where it lands (`MaterialDef.hits`). */
39
45
  interface MaterialHit {
40
46
  /**
@@ -84,6 +90,11 @@ interface MaterialDef {
84
90
  fracture: FractureStyle;
85
91
  /** Fragment size range in metres (default `[0.04, 0.2]`). */
86
92
  fragmentSize?: [number, number];
93
+ /**
94
+ * How a wood-based material comes apart when it breaks and where a blow tears it (see `SplitForm`); the renderer draws its splinters, sheets and lumps
95
+ * by it. Omit for a material that is not made of wood fibre.
96
+ */
97
+ splitForm?: SplitForm;
87
98
  /**
88
99
  * Thickness of one sheet, in metres, for a material that comes in sheets (paper). A `tear` part much thicker than a sheet is a stack of them (a book,
89
100
  * a ream, a magazine) and comes apart as thin loose scraps (`Fragment.inner` for the pages) instead of slabs as thick as the part.
@@ -1400,4 +1411,4 @@ declare const tensionCapacity: (dims: Vec3, o: {
1400
1411
  tensileMPa?: number;
1401
1412
  }) => number;
1402
1413
 
1403
- export { ASSEMBLIES, type AddOptions, type Assemblies, type AssembliesOptions, type AssemblyDef, type AssemblyPartOptions, type BearingWallOptions, type BendGeometry, type BendSection, CONFINEMENT_DEFAULTS, type ChainTrigger, type CheckOptions, type DestructionLocale, type DestructionOptions, type DestructionSnapshot, type DestructionStrings, type DestructionWorld, type ExplosivePartOptions, FIRE_PRIME_C, FLEXURE_DEFAULTS, FRAGMENT_HIT_DEFAULTS, type FlexureOptions, type FoundationSolve, type FrameOptions, GRAVITY, type Gust, JOINT_BY_MATERIALS, JOINT_DEFAULTS, MASONRY_DEFAULTS, MATERIALS, type MasonryOptions, type MaterialDef, type MaterialHit, type MaterialStrength, type MaterialThermal, type ObjectRuntime, type PartRuntime, type ResolvedWind, SHELTER_DEFAULTS, SOILS, SOIL_DEFAULTS, type SectionMoments, type SizeStructureOptions, type SoilDef, type SoilKind, type SoilOptions, type SoilSpring, type SwayState, type SwaySystem, type TensionSteel, WIND_DEFAULTS, WIND_TERRAIN, type WallFrameSolution, type WindAnalysis, type WindCase, type WindOptions, type WindPartInput, type WindTerrainDef, type WorldExplosive, analyzeWind, assemblyDepth, assemblyPart, bearingWallThickness, bendGeometry, blastImpulse, buildFrame, checkDestructible, crackingMoment, createAssemblies, createDestruction, damperAmplification, damperTuning, defaultAssemblies, elasticEnergy, explosivePart, exposureOf, footingArea, footingSoil, fragility, getAssembly, guessMaterial, gustAt, heightFactor, impulseEnergy, inferJoints, layersBetween, locales, makeGust, meanHeightFactor, momentNodes, momentOfEnergy, partCapacity, partMass, partThickness, partVolume, pileCapacity, pileLength, pileStiffness, profileOf, quat, quatFromEuler, registerAssembly, resolveStrings, resolveWind, rotateVec, sectionMoments, shapeAt, shearNodes, sizeRebar, sizeStructure, slendernessFactor, soilAt, solveFoundation, solveWallFrame, spanMoment, spanOf, steelMoment, stepSway, stiffnessCentre, subgradeModulus, tBeamInertia, tensionCapacity, tensionSteel, toLocal, toWorld, turbulenceIntensity, vec, windClass, windPressure };
1414
+ export { ASSEMBLIES, type AddOptions, type Assemblies, type AssembliesOptions, type AssemblyDef, type AssemblyPartOptions, type BearingWallOptions, type BendGeometry, type BendSection, CONFINEMENT_DEFAULTS, type ChainTrigger, type CheckOptions, type DestructionLocale, type DestructionOptions, type DestructionSnapshot, type DestructionStrings, type DestructionWorld, type ExplosivePartOptions, FIRE_PRIME_C, FLEXURE_DEFAULTS, FRAGMENT_HIT_DEFAULTS, type FlexureOptions, type FoundationSolve, type FrameOptions, GRAVITY, type Gust, JOINT_BY_MATERIALS, JOINT_DEFAULTS, MASONRY_DEFAULTS, MATERIALS, type MasonryOptions, type MaterialDef, type MaterialHit, type MaterialStrength, type MaterialThermal, type ObjectRuntime, type PartRuntime, type ResolvedWind, SHELTER_DEFAULTS, SOILS, SOIL_DEFAULTS, type SectionMoments, type SizeStructureOptions, type SoilDef, type SoilKind, type SoilOptions, type SoilSpring, type SplitForm, type SwayState, type SwaySystem, type TensionSteel, WIND_DEFAULTS, WIND_TERRAIN, type WallFrameSolution, type WindAnalysis, type WindCase, type WindOptions, type WindPartInput, type WindTerrainDef, type WorldExplosive, analyzeWind, assemblyDepth, assemblyPart, bearingWallThickness, bendGeometry, blastImpulse, buildFrame, checkDestructible, crackingMoment, createAssemblies, createDestruction, damperAmplification, damperTuning, defaultAssemblies, elasticEnergy, explosivePart, exposureOf, footingArea, footingSoil, fragility, getAssembly, guessMaterial, gustAt, heightFactor, impulseEnergy, inferJoints, layersBetween, locales, makeGust, meanHeightFactor, momentNodes, momentOfEnergy, partCapacity, partMass, partThickness, partVolume, pileCapacity, pileLength, pileStiffness, profileOf, quat, quatFromEuler, registerAssembly, resolveStrings, resolveWind, rotateVec, sectionMoments, shapeAt, shearNodes, sizeRebar, sizeStructure, slendernessFactor, soilAt, solveFoundation, solveWallFrame, spanMoment, spanOf, steelMoment, stepSway, stiffnessCentre, subgradeModulus, tBeamInertia, tensionCapacity, tensionSteel, toLocal, toWorld, turbulenceIntensity, vec, windClass, windPressure };