@pinkaphant/create-kolmo 0.4.2 → 0.5.2

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 (78) hide show
  1. package/README.md +56 -17
  2. package/bin/create-kolmo.mjs +20 -12
  3. package/package.json +1 -1
  4. package/templates/demolition/README.md +17 -0
  5. package/templates/demolition/index.html +29 -0
  6. package/templates/demolition/package.json +39 -0
  7. package/templates/demolition/src/App.tsx +599 -0
  8. package/templates/{lonedrive → demolition}/tsconfig.json +4 -2
  9. package/templates/{lonedrive → demolition}/vite.config.ts +3 -1
  10. package/templates/dust/README.md +9 -1
  11. package/templates/dust/index.html +15 -1
  12. package/templates/dust/package.json +10 -8
  13. package/templates/dust/src/App.tsx +106 -122
  14. package/templates/dust/tsconfig.json +4 -2
  15. package/templates/evolution/README.md +15 -0
  16. package/templates/evolution/index.html +29 -0
  17. package/templates/{lonedrive → evolution}/package.json +10 -9
  18. package/templates/evolution/src/App.tsx +619 -0
  19. package/templates/evolution/src/main.tsx +10 -0
  20. package/templates/evolution/src/styles.css +237 -0
  21. package/templates/evolution/tsconfig.json +16 -0
  22. package/templates/evolution/vite.config.ts +10 -0
  23. package/templates/longline/README.md +16 -9
  24. package/templates/longline/index.html +26 -12
  25. package/templates/longline/package.json +13 -11
  26. package/templates/longline/src/App.tsx +191 -42
  27. package/templates/longline/src/highway.ts +222 -0
  28. package/templates/longline/src/main.tsx +7 -6
  29. package/templates/longline/tsconfig.json +14 -16
  30. package/templates/longline/vite.config.ts +5 -23
  31. package/templates/road/README.md +8 -4
  32. package/templates/road/index.html +15 -1
  33. package/templates/road/package.json +7 -7
  34. package/templates/road/src/App.tsx +21 -6
  35. package/templates/road/tsconfig.json +1 -0
  36. package/templates/tugline/README.md +16 -0
  37. package/templates/tugline/index.html +31 -0
  38. package/templates/tugline/package.json +41 -0
  39. package/templates/tugline/src/App.tsx +48 -0
  40. package/templates/{longline → tugline}/src/components/Boat.tsx +1 -2
  41. package/templates/{longline → tugline}/src/components/Crates.tsx +2 -2
  42. package/templates/tugline/src/components/Hud.tsx +281 -0
  43. package/templates/{longline → tugline}/src/components/Longline.tsx +2 -2
  44. package/templates/{longline → tugline}/src/components/Ocean.tsx +14 -3
  45. package/templates/{longline → tugline}/src/components/Radar.tsx +15 -14
  46. package/templates/{longline → tugline}/src/components/Referee.tsx +6 -4
  47. package/templates/{longline → tugline}/src/components/Scene.tsx +10 -9
  48. package/templates/{longline → tugline}/src/components/Sky.tsx +14 -8
  49. package/templates/{longline → tugline}/src/game/store.test.ts +2 -2
  50. package/templates/{longline → tugline}/src/game/store.ts +38 -19
  51. package/templates/tugline/src/main.tsx +13 -0
  52. package/templates/tugline/src/styles.css +495 -0
  53. package/templates/tugline/tsconfig.json +18 -0
  54. package/templates/tugline/vite.config.ts +16 -0
  55. package/templates/lonedrive/README.md +0 -11
  56. package/templates/lonedrive/index.html +0 -15
  57. package/templates/lonedrive/src/App.tsx +0 -149
  58. package/templates/longline/src/components/Hud.tsx +0 -197
  59. package/templates/longline/src/styles.css +0 -367
  60. /package/templates/{lonedrive → demolition}/src/main.tsx +0 -0
  61. /package/templates/{longline → tugline}/src/components/CameraRig.tsx +0 -0
  62. /package/templates/{longline → tugline}/src/components/ocean-material.ts +0 -0
  63. /package/templates/{longline → tugline}/src/components/round-context.ts +0 -0
  64. /package/templates/{longline → tugline}/src/game/boat-control.ts +0 -0
  65. /package/templates/{longline → tugline}/src/game/constants.ts +0 -0
  66. /package/templates/{longline → tugline}/src/game/input.test.ts +0 -0
  67. /package/templates/{longline → tugline}/src/game/input.ts +0 -0
  68. /package/templates/{longline → tugline}/src/game/logic.test.ts +0 -0
  69. /package/templates/{longline → tugline}/src/game/logic.ts +0 -0
  70. /package/templates/{longline → tugline}/src/game/physics.test.ts +0 -0
  71. /package/templates/{longline → tugline}/src/game/radar.ts +0 -0
  72. /package/templates/{longline → tugline}/src/game/registry.ts +0 -0
  73. /package/templates/{longline → tugline}/src/game/sea.ts +0 -0
  74. /package/templates/{longline → tugline}/src/game/session.ts +0 -0
  75. /package/templates/{longline → tugline}/src/game/simulation.test.ts +0 -0
  76. /package/templates/{longline → tugline}/src/game/simulation.ts +0 -0
  77. /package/templates/{longline → tugline}/src/game/test-world.ts +0 -0
  78. /package/templates/{longline → tugline}/src/sfx.ts +0 -0
package/README.md CHANGED
@@ -1,41 +1,80 @@
1
1
  # `@pinkaphant/create-kolmo`
2
2
 
3
- Scaffold a playable Kolmo game with React, TypeScript, Vite, and Rapier.
4
-
5
- ## Longline, the tugboat
3
+ Scaffold a playable `@pinkaphant/kolmo` + `@khr3/core` 3D physics game with React 19, TypeScript, Vite, and Rapier WASM ([`./bin/create-kolmo.mjs`](./bin/create-kolmo.mjs)).
6
4
 
7
5
  ```bash
8
- npm create @pinkaphant/kolmo@latest my-longline-game -- --template longline
9
- cd my-longline-game
6
+ npm create @pinkaphant/kolmo@latest my-game -- --template road
7
+ cd my-game
10
8
  npm run dev
11
9
  ```
12
10
 
13
- Longline is the water demo: sea, boat, tow line, crates, radar, HUD. **WASD** or the arrow keys steer the boat. It stays that game.
11
+ Pass `--template <name>` to pick any of the 6 templates (`road` is the default; `--template lonedrive` aliases to `longline`). Add `--no-install` (or `--skip-install`) to skip `npm install`.
12
+
13
+ ## Templates
14
+
15
+ ### 1. `road` — Spline Road & C12 Village Sandbox ([`./templates/road`](./templates/road))
16
+
17
+ ```bash
18
+ npm create @pinkaphant/kolmo@latest my-road-game
19
+ ```
20
+
21
+ Default template. Generates a seeded `@khr3/roads` continuous spline (`<RoadRibbon>`), grades a `384 m` terrain pad, places a cyclotomic `@khr3/c12` `planSettlement` village (`<Settlement>` with Rapier revolute-hinged doors), spawns a spline-aligned Skyline R34 (`computeSplineSpawnPose`), and mounts `<Actor>`, `<Toolgun>`, `<Hud>`, `<Radar>`, and `<Game dropSpawn>` `.glb` drop-to-drive.
22
+
23
+ - **WASD** / **Arrows**: Move or drive · **Shift**: Run / boost · **Space**: Jump · **C**: Brake
24
+ - **E** / **F**: Board or exit vehicle · **R**: Flip vehicle upright
25
+ - **V**: Toggle FPS / TPS camera · **L**: Toggle vehicle headlights · **N**: Cycle day / dusk / night sky
26
+ - **O** or drag-and-drop `.glb`: Auto-rig, spawn, and board any car `.glb` · **T** / right-click: Spawn armed asset
14
27
 
15
- ## Lonedrive
28
+ ### 2. `tugline` — Gerstner Sea Tugboat & Tow-Line Arcade ([`./templates/tugline`](./templates/tugline))
16
29
 
17
30
  ```bash
18
- npm create @pinkaphant/kolmo@latest my-drive -- --template lonedrive
31
+ npm create @pinkaphant/kolmo@latest my-tugline -- --template tugline
19
32
  ```
20
33
 
21
- A long seeded road and one car. Respectful spoof of The Long Drive. Not the tugboat.
34
+ 90-second Gerstner ocean arcade game powered by `@pinkaphant/kolmo/water` and `@khr3/core` `<PhysicsWorld>`. Pilot a buoyant tugboat towing an 8-float rope line across `Calm`, `Choppy`, or `Rough` seas to lasso drifting cargo crates for up to `×5` combos, complete with headless Rapier hydrostatics tests (`npm test`).
35
+
36
+ - **W** / **S** or **Up** / **Down**: Ahead / astern · **A** / **D** or **Left** / **Right**: Port / starboard
37
+ - **1** / **2** / **3**: Select sea state (menu) · **Enter**: Start round · **Space**: Pause / resume · **R**: Restart round
22
38
 
23
- ## Dust
39
+ ### 3. `longline` — Endless `+Z` Desert Highway ([`./templates/longline`](./templates/longline))
40
+
41
+ ```bash
42
+ npm create @pinkaphant/kolmo@latest my-longline -- --template longline
43
+ ```
44
+
45
+ Procedural infinite `+Z` desert highway inspired by *The Long Drive*. Streams `288 m` `@khr3/roads` highway spline and terrain chunks around the player's integer `Z` sector with bounded 9-chunk LRU eviction, places periodic roadside gas stations and swap vehicles, and tracks distance on a `tabular-nums` top odometer (`000.0 km`).
46
+
47
+ - **WASD** / **Arrows**: Walk or drive · **Shift**: Sprint / boost · **C** / **Space**: Brake
48
+ - **E** / **F**: Board or exit vehicle · **R**: Flip upright · **V**: FPS / TPS · **L**: Headlights · **N**: Sky · **O** / drop `.glb`: Import car
49
+
50
+ ### 4. `dust` — Coastal Island, Buoyant Scrap Car & C12 Outpost ([`./templates/dust`](./templates/dust))
24
51
 
25
52
  ```bash
26
53
  npm create @pinkaphant/kolmo@latest my-dust -- --template dust
27
54
  ```
28
55
 
29
- An island, a body, and a scrap car. Facepunch Rust in spirit. **WASD** walks. **E** or **F** boards.
56
+ Coastal island survival sandbox mounting `@pinkaphant/kolmo`'s `<Water>` Gerstner sea, a compact `@khr3/c12` coastal outpost (`<Settlement>`) + fuel depot registered in `<Radar>`, buoyant salvage props, and a surface-tangent (`computeSurfaceSpawnPose`) buoyant scrap hatchback.
30
57
 
31
- ## Road and vehicle sandbox
58
+ - **WASD** / **Arrows**: Walk or drive · **E** / **F**: Board or exit · **V**: FPS / TPS · **L**: Headlights · **N**: Sky · **T** / right-click: Toolgun spawn
59
+
60
+ ### 5. `demolition` — Full-Contact KHR Destructible Demolition Derby ([`./templates/demolition`](./templates/demolition))
32
61
 
33
62
  ```bash
34
- npx @pinkaphant/create-kolmo@latest my-road-game
35
- cd my-road-game
36
- npm run dev
63
+ npm create @pinkaphant/kolmo@latest my-derby -- --template demolition
64
+ ```
65
+
66
+ `128 m` sunken concave derby bowl with central spine mound and outer rim pit, powered by `@pinkaphant/kolmo/cars` (`compileKolmogorovCarBundle`, `DERBY_PANEL_ROLES`, `stepDerbyAutopilot`, `computeDerbyFitness`). Drive a boardable 4-byte KHR car with `6DOF` rocket boosters against 5 deterministic AI rivals as collision impulses unlatch, swing, and shear `KHR_physics_rigid_bodies` doors, hoods, gates, and bumpers into physical arena debris.
67
+
68
+ - **WASD** / **Arrows**: Drive · **Shift**: Fire `6DOF` boosters · **C** / **Space**: Brake · **E** / **F**: Exit or board any car
69
+ - **V**: FPS / TPS · **L**: Headlights · **N**: Sky · **R**: Upright (or **New Bout** button in top telemetry bar)
70
+
71
+ ### 6. `evolution` — 4-Byte `uint32` BoxCar3D KHR Evolution Gauntlet ([`./templates/evolution`](./templates/evolution))
72
+
73
+ ```bash
74
+ npm create @pinkaphant/kolmo@latest my-evolution -- --template evolution
37
75
  ```
38
76
 
39
- The default road template generates a seeded `@khr3/roads` continuous spline (`<RoadRibbon>`), grades a `384 m` terrain pad, places a cyclotomic `@khr3/c12` `planSettlement` village (`<Settlement>` with Rapier revolute-hinged doors), and mounts a vehicle, on-foot controller, toolgun, HUD, and `<Radar>`. **WASD** moves, **Shift** runs, **E** or **F** boards, **R** uprights, **T** or right-click spawns from the toolgun, and **Space** jumps.
77
+ Real-time 3D evolutionary car breeder on `@pinkaphant/kolmo/cars` (`createInitialPopulation`, `breedNextGeneration`, `computeGauntletFitness`, `exportKolmogorovCarGlb`). Races 8 simultaneous full-contact `<KhrVehicle>` genomes up a seeded `@khr3/roads` climb/mogul/jump gauntlet at `1x`/`2x`/`4x` physics speed, with live `0xXXXXXXXX` standings, hex gene injection, and one-click Khronos `.glb` export.
40
78
 
41
- Add `--no-install` (or `--skip-install`) to either command to skip dependency installation.
79
+ - **Click** any row in the standings dock to lock the `maath/easing` chase camera onto that genome
80
+ - **Space**: Pause / resume · **1** / **2** / **4**: Set simulation speed · **Inject Hex**: Splice custom `0xXXXXXXXX` gene · **Export .GLB**: Download selected KHR vehicle
@@ -3,6 +3,18 @@ import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { spawnSync } from "node:child_process";
5
5
 
6
+ const CANONICAL_TEMPLATES = ["road", "tugline", "longline", "dust", "demolition", "evolution"];
7
+
8
+ const TEMPLATE_DIR = {
9
+ road: "road",
10
+ tugline: "tugline",
11
+ longline: "longline",
12
+ lonedrive: "longline",
13
+ dust: "dust",
14
+ demolition: "demolition",
15
+ evolution: "evolution",
16
+ };
17
+
6
18
  const args = process.argv.slice(2);
7
19
  let targetArg = "";
8
20
  let skipInstall = false;
@@ -18,8 +30,8 @@ for (let i = 0; i < args.length; i++) {
18
30
  template = a.slice("--template=".length);
19
31
  } else if (a === "-h" || a === "--help") {
20
32
  console.log(
21
- "Usage: npm create @pinkaphant/kolmo@latest <project-dir> [--template road|longline|lonedrive|dust] [--no-install|--skip-install]\n" +
22
- " or: npx @pinkaphant/create-kolmo@latest <project-dir> [--template road|longline|lonedrive|dust] [--no-install|--skip-install]",
33
+ `Usage: npm create @pinkaphant/kolmo@latest <project-dir> [--template ${CANONICAL_TEMPLATES.join("|")}] [--no-install|--skip-install]\n` +
34
+ ` or: npx @pinkaphant/create-kolmo@latest <project-dir> [--template ${CANONICAL_TEMPLATES.join("|")}] [--no-install|--skip-install]`,
23
35
  );
24
36
  process.exit(0);
25
37
  } else if (!a.startsWith("-") && !targetArg) {
@@ -30,18 +42,14 @@ for (let i = 0; i < args.length; i++) {
30
42
  }
31
43
  }
32
44
 
33
- const TEMPLATE_DIR = {
34
- road: "road",
35
- longline: "longline",
36
- lonedrive: "lonedrive",
37
- dust: "dust",
38
- };
39
-
40
45
  if (!Object.hasOwn(TEMPLATE_DIR, template)) {
41
- console.error(`Error: Unknown template "${template}". Available templates: ${Object.keys(TEMPLATE_DIR).join(", ")}.`);
46
+ console.error(
47
+ `Error: Unknown template "${template}". Available templates: ${CANONICAL_TEMPLATES.join(", ")} (alias: lonedrive -> longline).`,
48
+ );
42
49
  process.exit(1);
43
50
  }
44
51
 
52
+ const resolvedDir = TEMPLATE_DIR[template];
45
53
  const dirName = targetArg || "kolmo-game";
46
54
  const root = path.resolve(process.cwd(), dirName);
47
55
  const pkgName = path
@@ -55,7 +63,7 @@ if (fs.existsSync(root) && fs.readdirSync(root).length > 0) {
55
63
  process.exit(1);
56
64
  }
57
65
 
58
- const templateRoot = path.resolve(import.meta.dirname, "../templates", TEMPLATE_DIR[template]);
66
+ const templateRoot = path.resolve(import.meta.dirname, "../templates", resolvedDir);
59
67
  fs.cpSync(templateRoot, root, { recursive: true });
60
68
 
61
69
  const templatePkgPath = path.join(root, "package.json");
@@ -71,7 +79,7 @@ if (fs.existsSync(indexHtmlPath)) {
71
79
 
72
80
  fs.writeFileSync(path.join(root, ".gitignore"), "node_modules/\ndist/\n.DS_Store\n*.local\n");
73
81
 
74
- console.log(`\nScaffolded Kolmo ${template} project in ${root}`);
82
+ console.log(`\nScaffolded Kolmo ${resolvedDir} project in ${root}`);
75
83
 
76
84
  if (!skipInstall) {
77
85
  console.log("Installing dependencies with npm...");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinkaphant/create-kolmo",
3
- "version": "0.4.2",
3
+ "version": "0.5.2",
4
4
  "description": "Scaffold a new @pinkaphant/kolmo + @khr3/core + @khr3/roads + @khr3/c12 3D physics game in one command",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,17 @@
1
+ # Kolmo Demolition Derby
2
+
3
+ Full-contact `128 m` sunken concave KHR demolition derby bowl powered by `@pinkaphant/kolmo` and `@pinkaphant/kolmo/cars` ([`./src/App.tsx`](./src/App.tsx)).
4
+
5
+ Compiles 6 `uint32` Kolmogorov car genomes (`compileKolmogorovCarBundle`) with `6DOF` twin rocket boosters and 6 `KHR_physics_rigid_bodies` breakaway panels (`door_fl`, `door_fr`, `hood`, `rear_gate`, `bumper_front`, `bumper_rear`). Steps 5 deterministic AI brawlers (`stepDerbyAutopilot`) inside `useBeforePhysicsStep` and routes collision impulses into `applyImpactImpulse` so panels unlatch, swing, and shear off into arena debris.
6
+
7
+ - **WASD** / **Arrows**: Drive
8
+ - **Shift**: Fire `6DOF` rocket boosters
9
+ - **C** / **Space**: Brake
10
+ - **E** / **F**: Exit or board any vehicle in the bowl
11
+ - **R**: Flip piloted car upright (or deals a fresh bout when on foot)
12
+ - **B** / **NEW BOUT**: Deal a new seeded 6-car bout
13
+ - **V**: Toggle FPS / TPS camera · **L**: Toggle headlights · **N**: Cycle sky
14
+
15
+ ```bash
16
+ npm create @pinkaphant/kolmo@latest my-derby -- --template demolition
17
+ ```
@@ -0,0 +1,29 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
+ <title>Kolmo Demolition</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Space+Grotesk:wght@500;600;700&display=swap"
11
+ rel="stylesheet"
12
+ />
13
+ <style>
14
+ html, body, #root {
15
+ margin: 0;
16
+ width: 100%;
17
+ height: 100%;
18
+ overflow: hidden;
19
+ background: oklch(13.5% 0.007 265);
20
+ font-family: "Space Grotesk", system-ui, sans-serif;
21
+ font-variant-numeric: tabular-nums;
22
+ }
23
+ </style>
24
+ </head>
25
+ <body>
26
+ <div id="root"></div>
27
+ <script type="module" src="/src/main.tsx"></script>
28
+ </body>
29
+ </html>
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "kolmo-demolition",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "description": "Demolition: 128 m sunken concave KHR demolition derby bowl with breakaway panels, 6DOF boosters, and deterministic AI rivals on @pinkaphant/kolmo.",
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev": "vite",
9
+ "typecheck": "tsc --noEmit",
10
+ "build": "tsc --noEmit && vite build",
11
+ "preview": "vite preview"
12
+ },
13
+ "dependencies": {
14
+ "@dimforge/rapier3d-compat": "0.19.2",
15
+ "@khr3/core": "^0.2.21",
16
+ "@pinkaphant/ecctrl": "2.0.4-beta.11",
17
+ "@pinkaphant/kolmo": "^0.15.1",
18
+ "@react-three/drei": "^10.7.7",
19
+ "@react-three/fiber": "^9.6.1",
20
+ "@react-three/rapier": "^2.2.0",
21
+ "koota": "^0.6.6",
22
+ "react": "^19.2.7",
23
+ "react-dom": "^19.2.7",
24
+ "three": "0.184.0"
25
+ },
26
+ "overrides": {
27
+ "@dimforge/rapier3d-compat": "0.19.2",
28
+ "@pinkaphant/ecctrl": "2.0.4-beta.11",
29
+ "three": "0.184.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/react": "^19.2.16",
33
+ "@types/react-dom": "^19.2.3",
34
+ "@types/three": "0.184.0",
35
+ "@vitejs/plugin-react": "^6.3.1",
36
+ "typescript": "^5.8.3",
37
+ "vite": "^8.4.1"
38
+ }
39
+ }