create-threenative 0.2.17 → 0.2.18

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.
Files changed (310) hide show
  1. package/agent-docs/kit-mcp.md +1 -1
  2. package/agent-docs/kit-router.md +1 -1
  3. package/agent-docs/references/assertion-reference.md +54 -110
  4. package/agent-docs/references/capability-reference.md +580 -22
  5. package/agent-docs/references/conventions.md +28 -0
  6. package/agent-docs/references/performance-basics.md +8 -4
  7. package/agent-files/.agents/skills/ponytail/SKILL.md +1 -1
  8. package/agent-files/.agents/skills/threenative-capabilities/SKILL.md +7 -4
  9. package/agent-files/.claude/hooks/discovery-gate.mjs +2 -2
  10. package/dist/index.d.ts +97 -6
  11. package/dist/index.js +769 -277
  12. package/dist/threenative.js +96 -17
  13. package/dist/web-engine-ccd-ik-solver.js +127 -0
  14. package/dist/web-engine-gltf-loader.js +52 -14
  15. package/dist/web-engine-post-effects.js +5 -10
  16. package/dist/web-engine-runtime.js +3648 -546
  17. package/package.json +8 -7
  18. package/template-assets/clearwater/README.md +1 -1
  19. package/template-assets/patches/manifest.json +18 -0
  20. package/template-assets/terrain/alpine/assets.json +12 -0
  21. package/template-assets/terrain/alpine/bake.mjs +6 -0
  22. package/template-assets/terrain/alpine/credits.json +164 -0
  23. package/template-assets/terrain/alpine/heightmap.r16 +0 -0
  24. package/template-assets/terrain/alpine/recipe.json +119 -0
  25. package/template-assets/terrain/alpine/surface.json +53 -0
  26. package/template-assets/terrain/coastal/assets.json +11 -0
  27. package/template-assets/terrain/coastal/bake.mjs +6 -0
  28. package/template-assets/terrain/coastal/credits.json +117 -0
  29. package/template-assets/terrain/coastal/heightmap.r16 +0 -0
  30. package/template-assets/terrain/coastal/recipe.json +113 -0
  31. package/template-assets/terrain/coastal/surface.json +41 -0
  32. package/template-assets/terrain/desert/assets.json +12 -0
  33. package/template-assets/terrain/desert/bake.mjs +6 -0
  34. package/template-assets/terrain/desert/credits.json +164 -0
  35. package/template-assets/terrain/desert/heightmap.r16 +0 -0
  36. package/template-assets/terrain/desert/recipe.json +108 -0
  37. package/template-assets/terrain/desert/surface.json +54 -0
  38. package/template-assets/terrain/forest/assets.json +65 -0
  39. package/template-assets/terrain/forest/bake.mjs +8 -0
  40. package/template-assets/terrain/forest/credits.json +225 -0
  41. package/template-assets/terrain/forest/heightmap.r16 +0 -0
  42. package/template-assets/terrain/forest/recipe.json +350 -0
  43. package/template-assets/terrain/forest/surface.json +79 -0
  44. package/template-assets/terrain/tundra/assets.json +12 -0
  45. package/template-assets/terrain/tundra/bake.mjs +6 -0
  46. package/template-assets/terrain/tundra/credits.json +164 -0
  47. package/template-assets/terrain/tundra/heightmap.r16 +0 -0
  48. package/template-assets/terrain/tundra/recipe.json +277 -0
  49. package/template-assets/terrain/tundra/surface.json +54 -0
  50. package/templates/action-rpg/AGENTS.md +8 -4
  51. package/templates/action-rpg/CLAUDE.md +8 -4
  52. package/templates/action-rpg/package.json +7 -7
  53. package/templates/action-rpg/src/game.ts +1 -1
  54. package/templates/action-rpg/src/render/atmosphere.ts +6 -0
  55. package/templates/action-rpg/src/render/backlightControls.ts +10 -0
  56. package/templates/action-rpg/src/render/backlightMaterial.ts +4 -4
  57. package/templates/action-rpg/src/render/clouds.ts +13 -0
  58. package/templates/action-rpg/src/render/materialLighting.ts +5 -5
  59. package/templates/action-rpg/src/render/quality.ts +7 -32
  60. package/templates/action-rpg/src/scenes/Play.ts +4 -1
  61. package/templates/action-rpg/src/style.css +4 -0
  62. package/templates/action-rpg/vite.config.ts +2 -0
  63. package/templates/adventure/AGENTS.md +7 -2
  64. package/templates/adventure/CLAUDE.md +7 -2
  65. package/templates/adventure/kit.json +5 -1
  66. package/templates/adventure/package.json +7 -7
  67. package/templates/adventure/src/game.ts +1 -1
  68. package/templates/adventure/src/style.css +4 -0
  69. package/templates/adventure/tsconfig.json +1 -1
  70. package/templates/adventure/vite.config.ts +2 -0
  71. package/templates/collectathon/AGENTS.md +7 -2
  72. package/templates/collectathon/CLAUDE.md +7 -2
  73. package/templates/collectathon/package.json +7 -7
  74. package/templates/collectathon/src/game.ts +1 -1
  75. package/templates/collectathon/src/level/Course.ts +55 -9
  76. package/templates/collectathon/src/level/terrain.ts +27 -6
  77. package/templates/collectathon/src/main.ts +1 -0
  78. package/templates/collectathon/src/render/foliage.ts +359 -98
  79. package/templates/collectathon/src/render/sky.ts +76 -12
  80. package/templates/collectathon/src/render/water.ts +32 -10
  81. package/templates/collectathon/src/scenes/Play.ts +18 -5
  82. package/templates/collectathon/src/style.css +4 -0
  83. package/templates/collectathon/tsconfig.json +1 -1
  84. package/templates/collectathon/vite.config.ts +2 -0
  85. package/templates/kart/AGENTS.md +7 -2
  86. package/templates/kart/CLAUDE.md +7 -2
  87. package/templates/kart/package.json +6 -6
  88. package/templates/kart/src/game.ts +1 -1
  89. package/templates/kart/src/main.ts +1 -0
  90. package/templates/kart/src/style.css +4 -0
  91. package/templates/kart/tsconfig.json +1 -1
  92. package/templates/kart/vite.config.ts +2 -0
  93. package/templates/minimal/AGENTS.md +8 -3
  94. package/templates/minimal/CLAUDE.md +8 -3
  95. package/templates/minimal/package.json +6 -6
  96. package/templates/minimal/playtests/stands-still.playtest.json +30 -0
  97. package/templates/minimal/src/game.ts +1 -1
  98. package/templates/minimal/src/render/atmosphere.ts +6 -0
  99. package/templates/minimal/src/render/backlightControls.ts +10 -0
  100. package/templates/minimal/src/render/backlightMaterial.ts +4 -4
  101. package/templates/minimal/src/render/camera.ts +13 -2
  102. package/templates/minimal/src/render/clouds.ts +13 -0
  103. package/templates/minimal/src/render/lighting.ts +4 -2
  104. package/templates/minimal/src/render/materialLighting.ts +5 -5
  105. package/templates/minimal/src/render/materials.ts +10 -0
  106. package/templates/minimal/src/render/quality.ts +7 -32
  107. package/templates/minimal/src/scenes/Play.ts +4 -1
  108. package/templates/minimal/vite.config.ts +7 -1
  109. package/templates/platformer/AGENTS.md +9 -4
  110. package/templates/platformer/CLAUDE.md +9 -4
  111. package/templates/platformer/index.html +1 -1
  112. package/templates/platformer/main.html +12 -0
  113. package/templates/platformer/package.json +7 -7
  114. package/templates/platformer/playtests/gamepad-idle.playtest.json +21 -0
  115. package/templates/platformer/playtests/gamepad.playtest.json +30 -0
  116. package/templates/platformer/src/entities/Fox.ts +21 -6
  117. package/templates/platformer/src/game.ts +1 -1
  118. package/templates/platformer/src/main.ts +1 -0
  119. package/templates/platformer/src/render/backlightControls.ts +10 -0
  120. package/templates/platformer/src/render/backlightMaterial.ts +4 -4
  121. package/templates/platformer/src/render/materialLighting.ts +5 -5
  122. package/templates/platformer/src/render/quality.ts +7 -32
  123. package/templates/platformer/src/scenes/Play.ts +2 -1
  124. package/templates/platformer/src/style.css +4 -0
  125. package/templates/platformer/src/worker-page.ts +29 -0
  126. package/templates/platformer/src/worker.ts +5 -0
  127. package/templates/platformer/tsconfig.json +1 -1
  128. package/templates/platformer/vite.config.ts +4 -0
  129. package/templates/puzzle/AGENTS.md +7 -2
  130. package/templates/puzzle/CLAUDE.md +7 -2
  131. package/templates/puzzle/package.json +7 -7
  132. package/templates/puzzle/src/game.ts +1 -1
  133. package/templates/puzzle/src/render/backlightControls.ts +10 -0
  134. package/templates/puzzle/src/render/backlightMaterial.ts +4 -4
  135. package/templates/puzzle/src/render/materialLighting.ts +5 -5
  136. package/templates/puzzle/src/render/quality.ts +7 -32
  137. package/templates/puzzle/src/scenes/Play.ts +1 -1
  138. package/templates/puzzle/src/style.css +4 -0
  139. package/templates/puzzle/tsconfig.json +1 -1
  140. package/templates/puzzle/vite.config.ts +2 -0
  141. package/templates/racing/AGENTS.md +7 -2
  142. package/templates/racing/CLAUDE.md +7 -2
  143. package/templates/racing/package.json +7 -7
  144. package/templates/racing/src/game.ts +1 -1
  145. package/templates/racing/src/render/atmosphere.ts +6 -0
  146. package/templates/racing/src/render/backlightControls.ts +10 -0
  147. package/templates/racing/src/render/backlightMaterial.ts +4 -4
  148. package/templates/racing/src/render/clouds.ts +13 -0
  149. package/templates/racing/src/render/materialLighting.ts +5 -5
  150. package/templates/racing/src/render/quality.ts +7 -32
  151. package/templates/racing/src/scenes/Race.ts +4 -1
  152. package/templates/racing/src/style.css +4 -0
  153. package/templates/racing/tsconfig.json +1 -1
  154. package/templates/racing/vite.config.ts +2 -0
  155. package/templates/rain/AGENTS.md +6 -2
  156. package/templates/rain/CLAUDE.md +6 -2
  157. package/templates/rain/package.json +6 -6
  158. package/templates/rain/src/game.ts +1 -1
  159. package/templates/rain/vite.config.ts +6 -0
  160. package/templates/rts/AGENTS.md +6 -2
  161. package/templates/rts/CLAUDE.md +6 -2
  162. package/templates/rts/package.json +6 -6
  163. package/templates/rts/src/game.ts +1 -1
  164. package/templates/rts/src/render/backlightControls.ts +10 -0
  165. package/templates/rts/src/render/backlightMaterial.ts +4 -4
  166. package/templates/rts/src/render/materialLighting.ts +5 -5
  167. package/templates/rts/src/render/quality.ts +7 -31
  168. package/templates/rts/src/scenes/Play.ts +1 -1
  169. package/templates/rts/src/style.css +4 -0
  170. package/templates/rts/vite.config.ts +2 -0
  171. package/templates/runner/AGENTS.md +7 -2
  172. package/templates/runner/CLAUDE.md +7 -2
  173. package/templates/runner/package.json +7 -7
  174. package/templates/runner/src/game.ts +1 -1
  175. package/templates/runner/src/render/atmosphere.ts +6 -0
  176. package/templates/runner/src/render/backlightControls.ts +10 -0
  177. package/templates/runner/src/render/backlightMaterial.ts +4 -4
  178. package/templates/runner/src/render/clouds.ts +13 -0
  179. package/templates/runner/src/render/materialLighting.ts +5 -5
  180. package/templates/runner/src/render/quality.ts +7 -32
  181. package/templates/runner/src/scenes/Run.ts +4 -1
  182. package/templates/runner/src/style.css +4 -0
  183. package/templates/runner/tsconfig.json +1 -1
  184. package/templates/runner/vite.config.ts +2 -0
  185. package/templates/sailing/AGENTS.md +7 -2
  186. package/templates/sailing/CLAUDE.md +7 -2
  187. package/templates/sailing/package.json +7 -7
  188. package/templates/sailing/src/game.ts +1 -1
  189. package/templates/sailing/src/render/backlightControls.ts +10 -0
  190. package/templates/sailing/src/render/backlightMaterial.ts +4 -4
  191. package/templates/sailing/src/render/environmentSetup.ts +1 -1
  192. package/templates/sailing/src/render/materialLighting.ts +5 -5
  193. package/templates/sailing/src/render/quality.ts +7 -32
  194. package/templates/sailing/src/style.css +5 -0
  195. package/templates/sailing/vite.config.ts +6 -0
  196. package/templates/shooter/AGENTS.md +6 -2
  197. package/templates/shooter/CLAUDE.md +6 -2
  198. package/templates/shooter/package.json +7 -7
  199. package/templates/shooter/src/game.ts +3 -2
  200. package/templates/shooter/src/render/atmosphere.ts +6 -0
  201. package/templates/shooter/src/render/backlightControls.ts +10 -0
  202. package/templates/shooter/src/render/backlightMaterial.ts +4 -4
  203. package/templates/shooter/src/render/clouds.ts +13 -0
  204. package/templates/shooter/src/render/materialLighting.ts +5 -5
  205. package/templates/shooter/src/render/quality.ts +7 -32
  206. package/templates/shooter/src/scenes/Play.ts +4 -1
  207. package/templates/shooter/src/style.css +4 -0
  208. package/templates/shooter/vite.config.ts +2 -0
  209. package/templates/snow/AGENTS.md +7 -2
  210. package/templates/snow/CLAUDE.md +7 -2
  211. package/templates/snow/package.json +7 -7
  212. package/templates/snow/src/game.ts +1 -1
  213. package/templates/snow/src/render/backlightControls.ts +10 -0
  214. package/templates/snow/src/render/backlightMaterial.ts +4 -4
  215. package/templates/snow/src/render/materialLighting.ts +5 -5
  216. package/templates/snow/src/render/quality.ts +7 -32
  217. package/templates/snow/src/style.css +5 -0
  218. package/templates/snow/vite.config.ts +6 -0
  219. package/templates/starter/AGENTS.md +8 -3
  220. package/templates/starter/CLAUDE.md +8 -3
  221. package/templates/starter/package.json +7 -7
  222. package/templates/starter/src/entities/Crate.ts +5 -2
  223. package/templates/starter/src/game.ts +4 -3
  224. package/templates/starter/src/render/adaptiveQuality.ts +17 -0
  225. package/templates/starter/src/render/atmosphere.ts +6 -0
  226. package/templates/starter/src/render/backlightControls.ts +10 -0
  227. package/templates/starter/src/render/backlightMaterial.ts +4 -4
  228. package/templates/starter/src/render/clouds.ts +13 -0
  229. package/templates/starter/src/render/contactShadow.ts +1 -1
  230. package/templates/starter/src/render/materialLighting.ts +5 -5
  231. package/templates/starter/src/render/postprocessing.ts +11 -10
  232. package/templates/starter/src/render/quality.ts +14 -1
  233. package/templates/starter/src/scenes/Play.ts +12 -3
  234. package/templates/starter/src/state.ts +2 -0
  235. package/templates/starter/src/style.css +4 -0
  236. package/templates/starter/src/ui/Menu.tsx +5 -1
  237. package/templates/starter/vite.config.ts +2 -0
  238. package/templates/tower-defense/AGENTS.md +7 -2
  239. package/templates/tower-defense/CLAUDE.md +7 -2
  240. package/templates/tower-defense/package.json +7 -7
  241. package/templates/tower-defense/src/game.ts +1 -1
  242. package/templates/tower-defense/src/render/backlightControls.ts +10 -0
  243. package/templates/tower-defense/src/render/backlightMaterial.ts +4 -4
  244. package/templates/tower-defense/src/render/materialLighting.ts +5 -5
  245. package/templates/tower-defense/src/render/quality.ts +7 -32
  246. package/templates/tower-defense/src/scenes/Battle.ts +1 -1
  247. package/templates/tower-defense/src/style.css +4 -0
  248. package/templates/tower-defense/tsconfig.json +1 -1
  249. package/templates/tower-defense/vite.config.ts +2 -0
  250. package/templates/action-rpg/src/render/environmentContribution.ts +0 -188
  251. package/templates/action-rpg/src/render/environmentRadiance.ts +0 -36
  252. package/templates/action-rpg/src/render/environmentSampleCache.ts +0 -43
  253. package/templates/action-rpg/src/render/environmentSampling.ts +0 -193
  254. package/templates/action-rpg/src/render/environmentSnapshot.ts +0 -53
  255. package/templates/minimal/src/render/environmentContribution.ts +0 -188
  256. package/templates/minimal/src/render/environmentRadiance.ts +0 -36
  257. package/templates/minimal/src/render/environmentSampleCache.ts +0 -43
  258. package/templates/minimal/src/render/environmentSampling.ts +0 -193
  259. package/templates/minimal/src/render/environmentSnapshot.ts +0 -53
  260. package/templates/platformer/src/render/environmentContribution.ts +0 -188
  261. package/templates/platformer/src/render/environmentRadiance.ts +0 -36
  262. package/templates/platformer/src/render/environmentSampleCache.ts +0 -43
  263. package/templates/platformer/src/render/environmentSampling.ts +0 -193
  264. package/templates/platformer/src/render/environmentSnapshot.ts +0 -53
  265. package/templates/puzzle/src/render/environmentContribution.ts +0 -188
  266. package/templates/puzzle/src/render/environmentRadiance.ts +0 -36
  267. package/templates/puzzle/src/render/environmentSampleCache.ts +0 -43
  268. package/templates/puzzle/src/render/environmentSampling.ts +0 -193
  269. package/templates/puzzle/src/render/environmentSnapshot.ts +0 -53
  270. package/templates/racing/src/render/environmentContribution.ts +0 -188
  271. package/templates/racing/src/render/environmentRadiance.ts +0 -36
  272. package/templates/racing/src/render/environmentSampleCache.ts +0 -43
  273. package/templates/racing/src/render/environmentSampling.ts +0 -193
  274. package/templates/racing/src/render/environmentSnapshot.ts +0 -53
  275. package/templates/rts/src/render/environmentContribution.ts +0 -188
  276. package/templates/rts/src/render/environmentRadiance.ts +0 -36
  277. package/templates/rts/src/render/environmentSampleCache.ts +0 -43
  278. package/templates/rts/src/render/environmentSampling.ts +0 -193
  279. package/templates/rts/src/render/environmentSnapshot.ts +0 -53
  280. package/templates/runner/src/render/environmentContribution.ts +0 -188
  281. package/templates/runner/src/render/environmentRadiance.ts +0 -36
  282. package/templates/runner/src/render/environmentSampleCache.ts +0 -43
  283. package/templates/runner/src/render/environmentSampling.ts +0 -193
  284. package/templates/runner/src/render/environmentSnapshot.ts +0 -53
  285. package/templates/sailing/src/render/environmentContribution.ts +0 -188
  286. package/templates/sailing/src/render/environmentRadiance.ts +0 -36
  287. package/templates/sailing/src/render/environmentSampleCache.ts +0 -43
  288. package/templates/sailing/src/render/environmentSampling.ts +0 -193
  289. package/templates/sailing/src/render/environmentSnapshot.ts +0 -53
  290. package/templates/shooter/src/render/environmentContribution.ts +0 -188
  291. package/templates/shooter/src/render/environmentRadiance.ts +0 -36
  292. package/templates/shooter/src/render/environmentSampleCache.ts +0 -43
  293. package/templates/shooter/src/render/environmentSampling.ts +0 -193
  294. package/templates/shooter/src/render/environmentSnapshot.ts +0 -53
  295. package/templates/snow/src/render/environmentContribution.ts +0 -188
  296. package/templates/snow/src/render/environmentRadiance.ts +0 -36
  297. package/templates/snow/src/render/environmentSampleCache.ts +0 -43
  298. package/templates/snow/src/render/environmentSampling.ts +0 -193
  299. package/templates/snow/src/render/environmentSnapshot.ts +0 -53
  300. package/templates/starter/src/render/environmentContribution.ts +0 -188
  301. package/templates/starter/src/render/environmentRadiance.ts +0 -36
  302. package/templates/starter/src/render/environmentSampleCache.ts +0 -43
  303. package/templates/starter/src/render/environmentSampling.ts +0 -193
  304. package/templates/starter/src/render/environmentSnapshot.ts +0 -53
  305. package/templates/starter/src/render/rendererGate.ts +0 -36
  306. package/templates/tower-defense/src/render/environmentContribution.ts +0 -188
  307. package/templates/tower-defense/src/render/environmentRadiance.ts +0 -36
  308. package/templates/tower-defense/src/render/environmentSampleCache.ts +0 -43
  309. package/templates/tower-defense/src/render/environmentSampling.ts +0 -193
  310. package/templates/tower-defense/src/render/environmentSnapshot.ts +0 -53
@@ -17,6 +17,7 @@ import {
17
17
  CylinderGeometry,
18
18
  DataTexture,
19
19
  DoubleSide,
20
+ Euler,
20
21
  Group,
21
22
  InstancedMesh,
22
23
  LatheGeometry,
@@ -24,7 +25,6 @@ import {
24
25
  type Material,
25
26
  Matrix4,
26
27
  Mesh,
27
- Object3D,
28
28
  OctahedronGeometry,
29
29
  PlaneGeometry,
30
30
  Quaternion,
@@ -83,28 +83,49 @@ export interface IPlantingSite {
83
83
  readonly surfaces: ISurfaces;
84
84
  }
85
85
 
86
- const dummy = new Object3D();
86
+ // Plain math, not a scratch Object3D: an engine object's position, scale, rotation and matrix each
87
+ // cross into the engine, five crossings an instance (~90 ms of a load); these stay in JavaScript.
87
88
  // Yaw last: a placement leans or droops about X, then turns to face its way round Y.
88
- dummy.rotation.order = "YXZ";
89
+ const turn = new Euler(0, 0, 0, "YXZ");
90
+ const placed = {
91
+ at: new Vector3(),
92
+ matrix: new Matrix4(),
93
+ size: new Vector3(),
94
+ spin: new Quaternion(),
95
+ tint: new Color(),
96
+ };
89
97
 
98
+ /**
99
+ * A kind as one draw, from the flat placements the plan stores: nine floats each, and three a tint.
100
+ * Flat on purpose: a repeat run reads 35,000 placements out of the cache and floats straight into
101
+ * the instance array, where a tuple apiece would cost more than drawing the island again.
102
+ */
90
103
  function instanced(
91
104
  geometry: BufferGeometry,
92
105
  material: Material,
93
- placements: readonly Placement[],
106
+ placements: Float64Array,
94
107
  castShadow: boolean,
95
- tints?: readonly Color[],
108
+ tints?: Float64Array,
96
109
  ): InstancedMesh {
97
- const mesh = new InstancedMesh(geometry, material, Math.max(1, placements.length));
98
- mesh.count = placements.length;
99
- placements.forEach(([x, y, z, sx, sy, sz, rx, ry, rz], i) => {
100
- dummy.position.set(x, y, z);
101
- dummy.scale.set(sx, sy, sz);
102
- dummy.rotation.set(rx, ry, rz);
103
- dummy.updateMatrix();
104
- mesh.setMatrixAt(i, dummy.matrix);
105
- const tint = tints?.[i];
106
- if (tint !== undefined) mesh.setColorAt(i, tint);
107
- });
110
+ const count = Math.floor(placements.length / PLACEMENT_STRIDE);
111
+ const mesh = new InstancedMesh(geometry, material, Math.max(1, count));
112
+ mesh.count = count;
113
+ for (let i = 0; i < count; i += 1) {
114
+ const at = i * PLACEMENT_STRIDE;
115
+ placed.spin.setFromEuler(
116
+ turn.set(placements[at + 6] ?? 0, placements[at + 7] ?? 0, placements[at + 8] ?? 0, "YXZ"),
117
+ );
118
+ placed.matrix.compose(
119
+ placed.at.set(placements[at] ?? 0, placements[at + 1] ?? 0, placements[at + 2] ?? 0),
120
+ placed.spin,
121
+ placed.size.set(placements[at + 3] ?? 0, placements[at + 4] ?? 0, placements[at + 5] ?? 0),
122
+ );
123
+ mesh.setMatrixAt(i, placed.matrix);
124
+ if (tints === undefined) continue;
125
+ const tint = i * TINT_STRIDE;
126
+ placed.tint.setRGB(tints[tint] ?? 0, tints[tint + 1] ?? 0, tints[tint + 2] ?? 0);
127
+ mesh.setColorAt(i, placed.tint);
128
+ }
108
129
  mesh.computeBoundingSphere();
109
130
  mesh.castShadow = castShadow;
110
131
  mesh.receiveShadow = true;
@@ -349,7 +370,7 @@ function branchMatrix(from: Vector3, to: Vector3, radius: number): Matrix4 {
349
370
  }
350
371
 
351
372
  /** Two wings hinged on the body's line, flapping on their own phase while the insect wanders. */
352
- function butterflies(placements: readonly Placement[], tints: readonly Color[]): InstancedMesh {
373
+ function butterflies(placements: Float64Array, tints: Float64Array): InstancedMesh {
353
374
  const geometry = new BufferGeometry();
354
375
  geometry.setAttribute(
355
376
  "position",
@@ -414,10 +435,67 @@ export interface IMeadow {
414
435
  readonly total: number;
415
436
  }
416
437
 
417
- export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeadow } {
418
- const { rng, bounds, clear, ground, surfaces } = site;
419
- const group = new Group();
420
- group.name = "planting";
438
+ /** Floats a placement, a matrix and a tint occupy: the strides the record and the meshes share. */
439
+ const PLACEMENT_STRIDE = 9;
440
+ const MATRIX_STRIDE = 16;
441
+ const TINT_STRIDE = 3;
442
+
443
+ /** One 12 m meadow cell: its centre and the tufts it draws, in draw order after the shuffle. */
444
+ export interface IPlantingCell {
445
+ /** Nine floats a tuft, and one tint a tuft, in the same order. */
446
+ readonly placements: Float64Array;
447
+ readonly tints: Float64Array;
448
+ readonly x: number;
449
+ readonly z: number;
450
+ }
451
+
452
+ /**
453
+ * Everything one run generates to plant the island, as the flat arrays `ctx.assets.memo` keeps:
454
+ * nine floats a placement, sixteen a matrix, three a tint, and the meadow's cells packed end to
455
+ * end. Flat because a repeat run reads some 35,000 placements back and hands them straight to the
456
+ * instance arrays, and a tuple apiece would cost more to rebuild than drawing the island again.
457
+ */
458
+ export interface IPlantingRecord {
459
+ readonly birches: Float64Array;
460
+ readonly branches: Float64Array;
461
+ readonly cards: Float64Array;
462
+ /** The cell centres, two floats each, and the cells' placements and tints packed in cell order. */
463
+ readonly cellStarts: Float64Array;
464
+ readonly cellTints: Float64Array;
465
+ readonly cellValues: Float64Array;
466
+ readonly cellXZ: Float64Array;
467
+ readonly flyers: Float64Array;
468
+ /** The flower heads packed end to end, and where each colour's list starts, in placements. */
469
+ readonly headStarts: Float64Array;
470
+ readonly heads: Float64Array;
471
+ readonly pebbleTints: Float64Array;
472
+ readonly pebbles: Float64Array;
473
+ readonly stems: Float64Array;
474
+ readonly stoneTints: Float64Array;
475
+ readonly stones: Float64Array;
476
+ readonly tints: Float64Array;
477
+ readonly trunks: Float64Array;
478
+ /** The draws the meadow's blades made, in order, so a repeat run cuts the same blades. */
479
+ readonly tuftDraws: Float64Array;
480
+ readonly wingTints: Float64Array;
481
+ }
482
+
483
+ const PETALS = [C.petalRed, C.petalOrange, C.petalWhite, C.petalYellow, C.wingBlue] as const;
484
+
485
+ /** A draw source handing back `draws` in order: the meadow's blades, cut again from stored draws. */
486
+ function replayed(draws: Float64Array): () => number {
487
+ let at = 0;
488
+ return () => {
489
+ const value = draws[at];
490
+ if (value === undefined) throw new Error("the stored planting ran out of draws.");
491
+ at += 1;
492
+ return value;
493
+ };
494
+ }
495
+
496
+ /** The island's placements, drawn from `site.rng` in one fixed order. */
497
+ export function planPlanting(site: IPlantingSite): IPlantingRecord {
498
+ const { rng, bounds, clear, ground } = site;
421
499
  const spin = () => rng() * Math.PI * 2;
422
500
  const onLawn = (x: number, z: number) =>
423
501
  site.lawns.some(([lx, lz, r]) => Math.hypot(x - lx, z - lz) < r + 0.4);
@@ -458,8 +536,6 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
458
536
  for (const clump of clumps.slice(1))
459
537
  branches.push(branchMatrix(fork, fork.clone().lerp(clump, 0.85), 0.09 * size));
460
538
  }
461
- const bark = texturedMaterial(surfaces, "bark", { normalScale: 1.6, roughness: 0.92 });
462
- group.add(instanced(trunkGeometry(2, 0.12), bark, trunks, true));
463
539
 
464
540
  // Birches: tall white trunks with a light, narrow crown of smaller cards up their top half.
465
541
  const birches: Placement[] = [];
@@ -481,14 +557,6 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
481
557
  for (const clump of clumps.slice(1))
482
558
  branches.push(branchMatrix(fork, fork.clone().lerp(clump, 0.8), 0.045));
483
559
  }
484
- group.add(
485
- instanced(
486
- trunkGeometry(14, 0.05),
487
- texturedMaterial(surfaces, "birch-bark", { roughness: 0.7 }),
488
- birches,
489
- true,
490
- ),
491
- );
492
560
 
493
561
  // Bushes: low clumps of the same leaves, and two hedge arcs of them near the rim.
494
562
  const bush = (x: number, z: number, size: number): void => {
@@ -515,53 +583,14 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
515
583
  }
516
584
  }
517
585
 
518
- // Every leaf card on the island is one draw: cut out of the cluster texture, both faces lit, the
519
- // sun shining through the ones seen against it, and a slow flutter on each card's own phase.
520
- const leafMaterial = new MeshStandardNodeMaterial({
521
- alphaTest: 0.4,
522
- map: leafTexture(),
523
- roughness: 0.7,
524
- side: DoubleSide,
525
- });
526
- const flutter = hash(instanceIndex).mul(6.28);
527
- leafMaterial.positionNode = positionLocal.add(
528
- vec3(
529
- sin(time.mul(1.9).add(flutter)).mul(0.03),
530
- sin(time.mul(2.6).add(flutter.mul(1.3))).mul(0.02),
531
- 0,
532
- ),
533
- );
534
- leafMaterial.twoSidedFoliage = true;
535
- leafMaterial.subsurfaceColor = new Color(0.3, 0.46, 0.1);
536
- const cards = new InstancedMesh(cardGeometry(), leafMaterial, leaves.cards.length);
537
- leaves.cards.forEach((matrix, i) => {
538
- cards.setMatrixAt(i, matrix);
539
- cards.setColorAt(i, leaves.tints[i] as Color);
540
- });
541
- cards.computeBoundingSphere();
542
- cards.castShadow = true;
543
- cards.receiveShadow = true;
544
- cards.name = "leaves";
545
- group.add(cards);
546
- const boughs = new InstancedMesh(
547
- new CylinderGeometry(0.55, 1, 1, 6, 1, true).translate(0, 0.5, 0),
548
- bark,
549
- branches.length,
550
- );
551
- branches.forEach((matrix, i) => boughs.setMatrixAt(i, matrix));
552
- boughs.computeBoundingSphere();
553
- boughs.castShadow = true;
554
- group.add(boughs);
555
-
556
586
  // Flowers: clumps in the grass, thickest along the path's edges, one draw per colour, on stems
557
587
  // that sway with it.
558
- const petals = [C.petalRed, C.petalOrange, C.petalWhite, C.petalYellow, C.wingBlue];
559
- const heads: Placement[][] = petals.map(() => []);
588
+ const heads: Placement[][] = PETALS.map(() => []);
560
589
  const stems: Placement[] = [];
561
590
  for (let i = 0; i < 260; i += 1) {
562
591
  const at = i % 3 === 0 ? spot(0.6, 1.6) : spot(0.6, 1.4);
563
592
  if (at === undefined) continue;
564
- const hue = heads[i % petals.length] ?? [];
593
+ const hue = heads[i % PETALS.length] ?? [];
565
594
  const count = 6 + Math.floor(rng() * 9);
566
595
  for (let f = 0; f < count; f += 1) {
567
596
  const a = spin();
@@ -575,14 +604,6 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
575
604
  hue.push([x, y + h, z, s, s, s, (rng() - 0.5) * 0.6, spin(), (rng() - 0.5) * 0.6]);
576
605
  }
577
606
  }
578
- const stem = new CylinderGeometry(0.01, 0.012, 1, 3, 1, true).translate(0, 0.5, 0);
579
- group.add(instanced(stem, lit(C.blade), stems, false));
580
- const head = flowerGeometry();
581
- petals.forEach((colour, i) => {
582
- group.add(
583
- instanced(head, lit(colour, { roughness: 0.6, vertexColors: true }), heads[i] ?? [], false),
584
- );
585
- });
586
607
 
587
608
  // Butterflies over the flowers: orange, white and blue.
588
609
  const flyers: Placement[] = [];
@@ -594,7 +615,6 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
594
615
  flyers.push([at[0], ground(at[0], at[1]) + 0.7 + rng() * 0.6, at[1], 1, 1, 1, 0, spin(), 0]);
595
616
  wingTints.push(new Color(wings[i % wings.length]));
596
617
  }
597
- group.add(butterflies(flyers, wingTints));
598
618
 
599
619
  // Pebbles thick along the path, and a few stones in the grass, half sunk into the ground.
600
620
  const pebbles: Placement[] = [];
@@ -624,22 +644,20 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
624
644
  (onPath ? pebbles : stones).push(at);
625
645
  (onPath ? pebbleTints : stoneTints).push(pebbleBase.clone().multiplyScalar(0.45 + rng() * 0.7));
626
646
  }
627
- const pebble = new OctahedronGeometry(1, 0);
628
- const pebbleMaterial = lit(0xffffff, { flat: true });
629
- // Too small to throw a shadow worth its draw.
630
- const pathPebbles = instanced(pebble, pebbleMaterial, pebbles, false, pebbleTints);
631
- pathPebbles.name = "path-pebbles";
632
- const grassStones = instanced(pebble, pebbleMaterial, stones, true, stoneTints);
633
- grassStones.name = "stones";
634
- group.add(pathPebbles, grassStones);
635
647
 
636
648
  // The meadow: grass tufts on a jittered 0.5 m grid over all the land and every drum's lawn, shorter
637
649
  // on the mown routes and beside the path, one `InstancedMesh` per 12 m cell. Each cell is
638
650
  // shuffled, so drawing a prefix of it thins it evenly: `update` draws every tuft within 10 m of
639
651
  // the eye at every tier (the foreground is what hides the ground), then the tier's share, thinning
640
652
  // to an eighth of it by 46 m, where the ground's own grass texture carries the field.
641
- const tuft = tuftGeometry(rng);
642
- const grass = grassMaterial();
653
+ // The blades draw seven numbers each from this point in the stream; keep them, so a repeat run
654
+ // cuts the same blades without needing the stream at all.
655
+ const tuftDraws: number[] = [];
656
+ tuftGeometry(() => {
657
+ const draw = rng();
658
+ tuftDraws.push(draw);
659
+ return draw;
660
+ });
643
661
  const cells = new Map<
644
662
  string,
645
663
  { placements: Placement[]; tints: Color[]; x: number; z: number }
@@ -688,23 +706,261 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
688
706
  }
689
707
  }
690
708
  }
691
- const meadowCells: { mesh: InstancedMesh; all: number; share: number; x: number; z: number }[] =
692
- [];
709
+ const planted: { placements: Placement[]; tints: Color[]; x: number; z: number }[] = [];
693
710
  for (const { placements, tints, x, z } of cells.values()) {
694
711
  for (let i = placements.length - 1; i > 0; i -= 1) {
695
712
  const j = Math.floor(rng() * (i + 1));
696
713
  [placements[i], placements[j]] = [placements[j] as Placement, placements[i] as Placement];
697
714
  [tints[i], tints[j]] = [tints[j] as Color, tints[i] as Color];
698
715
  }
699
- const mesh = instanced(tuft, grass, placements, false, tints);
716
+ planted.push({ placements, tints, x, z });
717
+ }
718
+ const headStarts = new Float64Array(heads.length + 1);
719
+ let headCount = 0;
720
+ heads.forEach((list, i) => {
721
+ headStarts[i] = headCount;
722
+ headCount += list.length;
723
+ });
724
+ headStarts[heads.length] = headCount;
725
+ const headValues = new Float64Array(headCount * PLACEMENT_STRIDE);
726
+ let headAt = 0;
727
+ for (const list of heads)
728
+ for (const item of list) {
729
+ headValues.set(item, headAt);
730
+ headAt += PLACEMENT_STRIDE;
731
+ }
732
+
733
+ const cellStarts = new Float64Array(planted.length + 1);
734
+ const cellXZ = new Float64Array(planted.length * 2);
735
+ let cellCount = 0;
736
+ planted.forEach((cell, i) => {
737
+ cellStarts[i] = cellCount;
738
+ cellXZ[i * 2] = cell.x;
739
+ cellXZ[i * 2 + 1] = cell.z;
740
+ cellCount += cell.placements.length;
741
+ });
742
+ cellStarts[planted.length] = cellCount;
743
+ // One tint a tuft, in the same order, so a cell's tints start where its placements do.
744
+ const cellValues = new Float64Array(cellCount * PLACEMENT_STRIDE);
745
+ const cellTints = new Float64Array(cellCount * TINT_STRIDE);
746
+ let cellAt = 0;
747
+ let tintAt = 0;
748
+ for (const cell of planted) {
749
+ for (const item of cell.placements) {
750
+ cellValues.set(item, cellAt);
751
+ cellAt += PLACEMENT_STRIDE;
752
+ }
753
+ for (const tint of cell.tints) {
754
+ cellTints[tintAt] = tint.r;
755
+ cellTints[tintAt + 1] = tint.g;
756
+ cellTints[tintAt + 2] = tint.b;
757
+ tintAt += TINT_STRIDE;
758
+ }
759
+ }
760
+
761
+ return {
762
+ birches: packedPlacements(birches),
763
+ branches: packedMatrices(branches),
764
+ cards: packedMatrices(leaves.cards),
765
+ cellStarts,
766
+ cellTints,
767
+ cellValues,
768
+ cellXZ,
769
+ flyers: packedPlacements(flyers),
770
+ headStarts,
771
+ heads: headValues,
772
+ pebbleTints: packedTints(pebbleTints),
773
+ pebbles: packedPlacements(pebbles),
774
+ stems: packedPlacements(stems),
775
+ stoneTints: packedTints(stoneTints),
776
+ stones: packedPlacements(stones),
777
+ tints: packedTints(leaves.tints),
778
+ trunks: packedPlacements(trunks),
779
+ tuftDraws: Float64Array.from(tuftDraws),
780
+ wingTints: packedTints(wingTints),
781
+ };
782
+ }
783
+
784
+ function packedPlacements(items: readonly Placement[]): Float64Array {
785
+ const flat = new Float64Array(items.length * PLACEMENT_STRIDE);
786
+ items.forEach((item, i) => flat.set(item, i * PLACEMENT_STRIDE));
787
+ return flat;
788
+ }
789
+
790
+ function packedMatrices(items: readonly Matrix4[]): Float64Array {
791
+ const flat = new Float64Array(items.length * MATRIX_STRIDE);
792
+ items.forEach((item, i) => flat.set(item.elements, i * MATRIX_STRIDE));
793
+ return flat;
794
+ }
795
+
796
+ function packedTints(items: readonly Color[]): Float64Array {
797
+ const flat = new Float64Array(items.length * TINT_STRIDE);
798
+ items.forEach((tint, i) => {
799
+ flat[i * TINT_STRIDE] = tint.r;
800
+ flat[i * TINT_STRIDE + 1] = tint.g;
801
+ flat[i * TINT_STRIDE + 2] = tint.b;
802
+ });
803
+ return flat;
804
+ }
805
+
806
+ /** `placed.matrix` filled from a stored 16-float matrix, so a card costs no Matrix4 of its own. */
807
+ function matrixAt(flat: Float64Array, index: number): Matrix4 {
808
+ const elements = placed.matrix.elements;
809
+ for (let k = 0; k < MATRIX_STRIDE; k += 1) elements[k] = flat[index * MATRIX_STRIDE + k] ?? 0;
810
+ return placed.matrix;
811
+ }
812
+
813
+ /** `placed.tint` filled from a stored 3-float tint, for the same reason. */
814
+ function tintAt(flat: Float64Array, index: number): Color {
815
+ const at = index * TINT_STRIDE;
816
+ return placed.tint.setRGB(flat[at] ?? 0, flat[at + 1] ?? 0, flat[at + 2] ?? 0);
817
+ }
818
+
819
+ /**
820
+ * A stored record before it becomes meshes: the memo is bytes off a disk, so a length that does not
821
+ * match throws instead of drawing half an island.
822
+ */
823
+ export function checkedPlanting(record: IPlantingRecord): IPlantingRecord {
824
+ const placementAlike = [
825
+ record.birches,
826
+ record.flyers,
827
+ record.pebbles,
828
+ record.stems,
829
+ record.stones,
830
+ record.trunks,
831
+ ];
832
+ const tintAlike = [record.pebbleTints, record.stoneTints, record.tints, record.wingTints];
833
+ const broken =
834
+ placementAlike.some((flat) => flat.length % PLACEMENT_STRIDE !== 0) ||
835
+ tintAlike.some((flat) => flat.length % TINT_STRIDE !== 0) ||
836
+ record.cards.length % MATRIX_STRIDE !== 0 ||
837
+ record.branches.length % MATRIX_STRIDE !== 0 ||
838
+ record.tints.length !== (record.cards.length / MATRIX_STRIDE) * TINT_STRIDE ||
839
+ record.headStarts.length !== PETALS.length + 1 ||
840
+ (record.headStarts[PETALS.length] ?? 0) * PLACEMENT_STRIDE !== record.heads.length ||
841
+ record.cellStarts.length !== record.cellXZ.length / 2 + 1 ||
842
+ (record.cellStarts[record.cellStarts.length - 1] ?? 0) * PLACEMENT_STRIDE !==
843
+ record.cellValues.length ||
844
+ record.cellTints.length !== (record.cellValues.length / PLACEMENT_STRIDE) * TINT_STRIDE ||
845
+ record.tuftDraws.length === 0;
846
+ if (broken) throw new Error("stored planting is malformed.");
847
+ return record;
848
+ }
849
+
850
+ /** The island's meshes, from a record. `site` carries the textures and the tier's grass share. */
851
+ export function buildPlanting(
852
+ record: IPlantingRecord,
853
+ site: IPlantingSite,
854
+ ): { group: Group; meadow: IMeadow } {
855
+ const { surfaces } = site;
856
+ const group = new Group();
857
+ group.name = "planting";
858
+
859
+ const bark = texturedMaterial(surfaces, "bark", { normalScale: 1.6, roughness: 0.92 });
860
+ group.add(instanced(trunkGeometry(2, 0.12), bark, record.trunks, true));
861
+ group.add(
862
+ instanced(
863
+ trunkGeometry(14, 0.05),
864
+ texturedMaterial(surfaces, "birch-bark", { roughness: 0.7 }),
865
+ record.birches,
866
+ true,
867
+ ),
868
+ );
869
+
870
+ // Every leaf card on the island is one draw: cut out of the cluster texture, both faces lit, the
871
+ // sun shining through the ones seen against it, and a slow flutter on each card's own phase.
872
+ const leafMaterial = new MeshStandardNodeMaterial({
873
+ alphaTest: 0.4,
874
+ map: leafTexture(),
875
+ roughness: 0.7,
876
+ side: DoubleSide,
877
+ });
878
+ const flutter = hash(instanceIndex).mul(6.28);
879
+ leafMaterial.positionNode = positionLocal.add(
880
+ vec3(
881
+ sin(time.mul(1.9).add(flutter)).mul(0.03),
882
+ sin(time.mul(2.6).add(flutter.mul(1.3))).mul(0.02),
883
+ 0,
884
+ ),
885
+ );
886
+ leafMaterial.twoSidedFoliage = true;
887
+ leafMaterial.subsurfaceColor = new Color(0.3, 0.46, 0.1);
888
+ const cardCount = Math.floor(record.cards.length / MATRIX_STRIDE);
889
+ const cards = new InstancedMesh(cardGeometry(), leafMaterial, Math.max(1, cardCount));
890
+ cards.count = cardCount;
891
+ for (let i = 0; i < cardCount; i += 1) {
892
+ cards.setMatrixAt(i, matrixAt(record.cards, i));
893
+ cards.setColorAt(i, tintAt(record.tints, i));
894
+ }
895
+ cards.computeBoundingSphere();
896
+ cards.castShadow = true;
897
+ cards.receiveShadow = true;
898
+ cards.name = "leaves";
899
+ group.add(cards);
900
+ const boughCount = Math.floor(record.branches.length / MATRIX_STRIDE);
901
+ const boughs = new InstancedMesh(
902
+ new CylinderGeometry(0.55, 1, 1, 6, 1, true).translate(0, 0.5, 0),
903
+ bark,
904
+ Math.max(1, boughCount),
905
+ );
906
+ boughs.count = boughCount;
907
+ for (let i = 0; i < boughCount; i += 1) boughs.setMatrixAt(i, matrixAt(record.branches, i));
908
+ boughs.computeBoundingSphere();
909
+ boughs.castShadow = true;
910
+ group.add(boughs);
911
+
912
+ // Flowers: one draw per colour, on stems that sway with the grass.
913
+ const stem = new CylinderGeometry(0.01, 0.012, 1, 3, 1, true).translate(0, 0.5, 0);
914
+ group.add(instanced(stem, lit(C.blade), record.stems, false));
915
+ const head = flowerGeometry();
916
+ PETALS.forEach((colour, i) => {
917
+ const from = (record.headStarts[i] ?? 0) * PLACEMENT_STRIDE;
918
+ const to = (record.headStarts[i + 1] ?? 0) * PLACEMENT_STRIDE;
919
+ group.add(
920
+ instanced(
921
+ head,
922
+ lit(colour, { roughness: 0.6, vertexColors: true }),
923
+ record.heads.subarray(from, to),
924
+ false,
925
+ ),
926
+ );
927
+ });
928
+
929
+ group.add(butterflies(record.flyers, record.wingTints));
930
+
931
+ const pebble = new OctahedronGeometry(1, 0);
932
+ const pebbleMaterial = lit(0xffffff, { flat: true });
933
+ // Too small to throw a shadow worth its draw.
934
+ const pathPebbles = instanced(pebble, pebbleMaterial, record.pebbles, false, record.pebbleTints);
935
+ pathPebbles.name = "path-pebbles";
936
+ const grassStones = instanced(pebble, pebbleMaterial, record.stones, true, record.stoneTints);
937
+ grassStones.name = "stones";
938
+ group.add(pathPebbles, grassStones);
939
+
940
+ // The meadow: one `InstancedMesh` a cell, each cell's tufts already shuffled, so drawing a prefix
941
+ // of it thins it evenly.
942
+ const tuft = tuftGeometry(replayed(record.tuftDraws));
943
+ const grass = grassMaterial();
944
+ const meadowCells: { mesh: InstancedMesh; all: number; share: number; x: number; z: number }[] =
945
+ [];
946
+ for (let cell = 0; cell + 1 < record.cellStarts.length; cell += 1) {
947
+ const first = record.cellStarts[cell] ?? 0;
948
+ const last = record.cellStarts[cell + 1] ?? 0;
949
+ const mesh = instanced(
950
+ tuft,
951
+ grass,
952
+ record.cellValues.subarray(first * PLACEMENT_STRIDE, last * PLACEMENT_STRIDE),
953
+ false,
954
+ record.cellTints.subarray(first * TINT_STRIDE, last * TINT_STRIDE),
955
+ );
700
956
  mesh.name = "grass";
701
957
  group.add(mesh);
702
958
  meadowCells.push({
703
- all: placements.length,
959
+ all: last - first,
704
960
  mesh,
705
- share: Math.round(placements.length * site.grassShare),
706
- x,
707
- z,
961
+ share: Math.round((last - first) * site.grassShare),
962
+ x: record.cellXZ[cell * 2] ?? 0,
963
+ z: record.cellXZ[cell * 2 + 1] ?? 0,
708
964
  });
709
965
  }
710
966
  let drawn = 0;
@@ -742,3 +998,8 @@ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeado
742
998
  }
743
999
  return { group, meadow: meadowLod };
744
1000
  }
1001
+
1002
+ /** One island, planned and built: the path a host with no memo takes. */
1003
+ export function plantIsland(site: IPlantingSite): { group: Group; meadow: IMeadow } {
1004
+ return buildPlanting(planPlanting(site), site);
1005
+ }