@adatechnology/game-test-room 0.28.0 → 0.28.1

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.
@@ -16750,7 +16750,7 @@ var GameTestRoom = (() => {
16750
16750
  const { core, def, random, x, y, z } = context;
16751
16751
  const mark = def.mark;
16752
16752
  const keepsMarks = !core.marklessAt?.(x, z);
16753
- if (keepsMarks && mark.crater && mark.dent && y < 1.2) {
16753
+ if (keepsMarks && mark.crater && mark.dent && y < 1.2 && (core.cratersAt?.(x, z) ?? true)) {
16754
16754
  core.emit({ type: "crater", x, z, radius: mark.crater, depth: mark.dent });
16755
16755
  core.trace?.crater?.(x, z, mark.crater, mark.dent);
16756
16756
  addCrater(core.marks, core.ground, random, { x, z, radius: mark.crater, depth: mark.dent, marks: core.layers.mark });
@@ -18516,6 +18516,7 @@ var GameTestRoom = (() => {
18516
18516
  clock: { time: 0, lastBlast: -1, lod: 1, forcedLod: null },
18517
18517
  groundAt,
18518
18518
  ...options.marklessAt ? { marklessAt: options.marklessAt } : {},
18519
+ ...options.cratersAt ? { cratersAt: options.cratersAt } : {},
18519
18520
  emit: (request) => options.onRequest?.(request)
18520
18521
  };
18521
18522
  function definitionOf(id) {
@@ -51099,6 +51100,8 @@ void main(){
51099
51100
  { id: "dry_clay", strata: [{ material: "clay", thickness: 0.35 }, { material: "soil", thickness: 1.5 }, { material: "stone", thickness: 0.5 }] },
51100
51101
  { id: "snow", strata: [{ material: "snow", thickness: 0.3 }, { material: "soil", thickness: 1.5 }, { material: "stone", thickness: 0.5 }] },
51101
51102
  { id: "cobblestone", strata: [{ material: "cobble", thickness: 0.12 }, { material: "sand", thickness: 0.06 }, { material: "gravel", thickness: 0.2 }, { material: "soil", thickness: 1.2 }] },
51103
+ // rock at the surface (an outcrop, a quarry floor): a blast only spalls it and a shot chips it
51104
+ { id: "bedrock", surfacePattern: "rock", strata: [{ material: "stone", thickness: 3 }] },
51102
51105
  { id: "paver_floor", strata: [{ material: "paver", thickness: 0.08 }, { material: "sand", thickness: 0.05 }, { material: "gravel", thickness: 0.15 }, { material: "soil", thickness: 1.2 }] },
51103
51106
  { id: "shallow_water", water: { liquid: "water", depth: 0.3, drag: 0.65, blowShare: WATER_BLOW_SHARE }, strata: [{ material: "mud", thickness: 0.15 }, { material: "soil", thickness: 1.5 }, { material: "stone", thickness: 0.5 }] }
51104
51107
  ];
@@ -52333,7 +52336,7 @@ void main(){
52333
52336
  }
52334
52337
  };
52335
52338
  }
52336
- var TERRAIN_PATTERNS = ["plain", "grass", "soil", "sand", "asphalt", "concrete", "tile", "planks", "stone", "mud", "gravel", "clay", "snow", "cobble", "paver"];
52339
+ var TERRAIN_PATTERNS = ["plain", "grass", "soil", "sand", "asphalt", "concrete", "tile", "planks", "stone", "mud", "gravel", "clay", "snow", "cobble", "paver", "rock"];
52337
52340
  var STRIDE = 0.72;
52338
52341
  var FOOT_LENGTH = 0.15;
52339
52342
  var FOOT_APART = 0.11;
@@ -52381,10 +52384,10 @@ void main(){
52381
52384
  };
52382
52385
  }
52383
52386
 
52384
- // ../game-terrain-three/dist/chunk-B5EA72GU.js
52387
+ // ../game-terrain-three/dist/chunk-6YHNPX3W.js
52385
52388
  var PROFILE_NAMES = {
52386
- en: { lawn: "Lawn", dirt: "Dirt", sand: "Sand", road: "Asphalt road", concrete_slab: "Concrete slab", suspended_slab: "Slab over a void", tile_floor: "Tile floor", wood_floor: "Wood floor", stone_paving: "Stone paving" },
52387
- "pt-BR": { lawn: "Grama", dirt: "Terra", sand: "Areia", road: "Asfalto", concrete_slab: "Laje de concreto", suspended_slab: "Laje sobre v\xE3o", tile_floor: "Piso cer\xE2mico", wood_floor: "Assoalho", stone_paving: "Cal\xE7amento de pedra" }
52389
+ en: { lawn: "Lawn", dirt: "Dirt", sand: "Sand", road: "Asphalt road", concrete_slab: "Concrete slab", suspended_slab: "Slab over a void", tile_floor: "Tile floor", wood_floor: "Wood floor", stone_paving: "Stone paving", mud: "Mud", gravel_bed: "Gravel", dry_clay: "Dry clay", snow: "Snow", cobblestone: "Cobblestones", paver_floor: "Concrete pavers", shallow_water: "Shallow water", bedrock: "Bare rock" },
52390
+ "pt-BR": { lawn: "Grama", dirt: "Terra", sand: "Areia", road: "Asfalto", concrete_slab: "Laje de concreto", suspended_slab: "Laje sobre v\xE3o", tile_floor: "Piso cer\xE2mico", wood_floor: "Assoalho", stone_paving: "Cal\xE7amento de pedra", mud: "Lama", gravel_bed: "Cascalho", dry_clay: "Barro seco", snow: "Neve", cobblestone: "Paralelep\xEDpedo", paver_floor: "Bloquete", shallow_water: "\xC1gua rasa", bedrock: "Rocha" }
52388
52391
  };
52389
52392
  function terrainProfileName(profileId, localeId) {
52390
52393
  return (PROFILE_NAMES[localeId] ?? PROFILE_NAMES.en)[profileId] ?? profileId;
@@ -52394,20 +52397,20 @@ void main(){
52394
52397
  name: "Terrain",
52395
52398
  group: "Terrain",
52396
52399
  weight: "Concrete block (60 kg)",
52397
- surfaces: { dirt: "Dirt", lawn: "Lawn", sand: "Sand", road: "Asphalt", concrete_slab: "Concrete slab", suspended_slab: "Slab over a void", wood_floor: "Wood floor", tile_floor: "Tile", stone_paving: "Stone paving", mud: "Mud", gravel_bed: "Gravel", dry_clay: "Dry clay", snow: "Snow", cobblestone: "Cobblestones", paver_floor: "Concrete pavers", shallow_water: "Shallow water" }
52400
+ surfaces: { dirt: "Dirt", lawn: "Lawn", sand: "Sand", road: "Asphalt", concrete_slab: "Concrete slab", suspended_slab: "Slab over a void", wood_floor: "Wood floor", tile_floor: "Tile", stone_paving: "Stone paving", mud: "Mud", gravel_bed: "Gravel", dry_clay: "Dry clay", snow: "Snow", cobblestone: "Cobblestones", paver_floor: "Concrete pavers", shallow_water: "Shallow water", bedrock: "Bare rock" }
52398
52401
  },
52399
52402
  "pt-BR": {
52400
52403
  name: "Terreno",
52401
52404
  group: "Terreno",
52402
52405
  weight: "Bloco de concreto (60 kg)",
52403
- surfaces: { dirt: "Terra", lawn: "Grama", sand: "Areia", road: "Asfalto", concrete_slab: "Laje de concreto", suspended_slab: "Laje sobre v\xE3o", wood_floor: "Assoalho", tile_floor: "Cer\xE2mica", stone_paving: "Pedra", mud: "Lama", gravel_bed: "Cascalho", dry_clay: "Barro seco", snow: "Neve", cobblestone: "Paralelep\xEDpedo", paver_floor: "Bloquete", shallow_water: "\xC1gua rasa" }
52406
+ surfaces: { dirt: "Terra", lawn: "Grama", sand: "Areia", road: "Asfalto", concrete_slab: "Laje de concreto", suspended_slab: "Laje sobre v\xE3o", wood_floor: "Assoalho", tile_floor: "Cer\xE2mica", stone_paving: "Pedra", mud: "Lama", gravel_bed: "Cascalho", dry_clay: "Barro seco", snow: "Neve", cobblestone: "Paralelep\xEDpedo", paver_floor: "Bloquete", shallow_water: "\xC1gua rasa", bedrock: "Rocha" }
52404
52407
  }
52405
52408
  };
52406
52409
  var locale = (id) => LOCALES[id] ?? LOCALES.en;
52407
- var TERRAIN_STRIPS = ["lawn", "dirt", "sand", "mud", "dry_clay", "gravel_bed", "snow", "shallow_water", "road", "cobblestone", "paver_floor", "stone_paving", "concrete_slab", "suspended_slab", "tile_floor", "wood_floor"];
52408
- var LOT_WIDTH = 3.4;
52410
+ var TERRAIN_STRIPS = ["lawn", "dirt", "sand", "mud", "dry_clay", "gravel_bed", "snow", "shallow_water", "bedrock", "road", "cobblestone", "paver_floor", "stone_paving", "concrete_slab", "suspended_slab", "tile_floor", "wood_floor"];
52411
+ var LOT_WIDTH = 3;
52409
52412
  var LOT_DEPTH = 3.8;
52410
- var LOTS_PER_ROW = 8;
52413
+ var LOTS_PER_ROW = 9;
52411
52414
  var LOTS_Z1 = -1.4;
52412
52415
  var lotRect = (index) => {
52413
52416
  const row = Math.floor(index / LOTS_PER_ROW);
@@ -52500,11 +52503,18 @@ vec3 terrainSurface(vec3 base, vec2 xz, float kind) {
52500
52503
  float seam = max(tsLine(xz.y, 0.2, 0.014), tsLine(along, 0.3, 0.014));
52501
52504
  return base * (0.72 + 0.6 * tsHash(cell)) * (0.82 + 0.36 * tsFbm(xz * 22.0)) * (1.0 - 0.8 * seam);
52502
52505
  }
52503
- float row = floor(xz.y / 0.2);
52504
- float along = xz.x - mod(abs(row), 2.0) * 0.1;
52505
- vec2 cell = vec2(floor(along / 0.2), row);
52506
- float seam = max(tsLine(xz.y, 0.2, 0.008), tsLine(along, 0.2, 0.008));
52507
- return base * (0.86 + 0.26 * tsHash(cell)) * (0.92 + 0.16 * tsNoise(xz * 70.0)) * (1.0 - 0.7 * seam);
52506
+ if (k < 14.5) {
52507
+ float row = floor(xz.y / 0.2);
52508
+ float along = xz.x - mod(abs(row), 2.0) * 0.1;
52509
+ vec2 cell = vec2(floor(along / 0.2), row);
52510
+ float seam = max(tsLine(xz.y, 0.2, 0.008), tsLine(along, 0.2, 0.008));
52511
+ return base * (0.86 + 0.26 * tsHash(cell)) * (0.92 + 0.16 * tsNoise(xz * 70.0)) * (1.0 - 0.7 * seam);
52512
+ }
52513
+ // bare rock: weathered blotches, lichen-dark patches and a few long joints, no grid
52514
+ float blotch = tsFbm(xz * 0.9) * 0.6 + tsFbm(xz * 4.0 + 2.0) * 0.4;
52515
+ float joint = 1.0 - smoothstep(0.0, 0.035, abs(tsNoise(xz * vec2(0.7, 1.9)) - 0.5));
52516
+ float grain = tsNoise(xz * 95.0);
52517
+ return base * (0.62 + 0.75 * blotch) * (0.88 + 0.24 * grain) * (1.0 - 0.6 * joint);
52508
52518
  }
52509
52519
  `
52510
52520
  );
@@ -52533,9 +52543,9 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
52533
52543
  const index = row * terrain.stride + column;
52534
52544
  let material = terrain.vertexMaterial(column, row);
52535
52545
  if (terrain.loose[index] > LOOSE_VISIBLE) {
52536
- const profile = terrain.profileList[terrain.profileIndex[index]];
52537
- const first = profile.strata[0];
52538
- material = terrain.material(first.thickness < THIN_SKIN && profile.strata[1] ? profile.strata[1].material : first.material);
52546
+ const profile2 = terrain.profileList[terrain.profileIndex[index]];
52547
+ const first = profile2.strata[0];
52548
+ material = terrain.material(first.thickness < THIN_SKIN && profile2.strata[1] ? profile2.strata[1].material : first.material);
52539
52549
  }
52540
52550
  const broken = material.pattern === "concrete" && terrain.dug[index] > BROKEN_DEPTH;
52541
52551
  const tone = broken ? BROKEN_TONE : 1;
@@ -52544,7 +52554,9 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
52544
52554
  base[2] = material.color[2] * tone;
52545
52555
  shade[0] = Math.max(MIN_DEPTH_LIGHT, 1 - terrain.dug[index] / DEPTH_SHADE);
52546
52556
  shade[1] = terrain.scorch[index];
52547
- return patternIndex(broken ? "soil" : material.pattern);
52557
+ const profile = terrain.profileList[terrain.profileIndex[index]];
52558
+ const untouched = profile.surfacePattern !== void 0 && terrain.dug[index] <= BROKEN_DEPTH && terrain.loose[index] <= LOOSE_VISIBLE;
52559
+ return patternIndex(broken ? "soil" : untouched ? profile.surfacePattern : material.pattern);
52548
52560
  }
52549
52561
  function chunkVertexCount(terrain, chunk, step) {
52550
52562
  const lastColumn = Math.min(terrain.columns, chunk.column + chunk.cells);
@@ -55691,7 +55703,9 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
55691
55703
  profile: quality,
55692
55704
  ...options.debris?.particles ? { sprites: { kinds: patchSpriteKinds(SPRITE_KINDS, options.debris.particles) } } : {},
55693
55705
  groundAt,
55694
- marklessAt: (x, z) => terrain.waterAt(x, z) !== null
55706
+ marklessAt: (x, z) => terrain.waterAt(x, z) !== null,
55707
+ // the dirt crater of the effects only where the ground is loose; rock, asphalt and a slab keep the soot and the bowl the terrain itself dug
55708
+ cratersAt: (x, z) => terrain.material(terrain.columnAt(x, z).material).reposeDegrees !== void 0
55695
55709
  })
55696
55710
  });
55697
55711
  const renderer = createDestructionRenderer(THREE, {