@pinkaphant/create-kolmo 0.6.0 → 0.7.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 +11 -0
- package/package.json +3 -2
- package/templates/demolition/package.json +2 -2
- package/templates/demolition/src/App.tsx +20 -3
- package/templates/dust/package.json +2 -2
- package/templates/evolution/package.json +2 -2
- package/templates/evolution/src/App.tsx +11 -2
- package/templates/longline/package.json +2 -2
- package/templates/road/package.json +2 -2
- package/templates/road/src/App.tsx +3 -2
- package/templates/tugline/package.json +2 -2
package/README.md
CHANGED
|
@@ -80,3 +80,14 @@ Real-time 3D evolutionary car breeder on `@pinkaphant/kolmo/cars` (`createInitia
|
|
|
80
80
|
|
|
81
81
|
- **Click** any row in the standings dock to lock the `maath/easing` chase camera onto that genome
|
|
82
82
|
- **Space**: Pause / resume · **1** / **2** / **4**: Set simulation speed · **Inject Hex**: Splice custom `0xXXXXXXXX` gene · **Export .GLB**: Download selected KHR vehicle
|
|
83
|
+
|
|
84
|
+
## Releasing (`@pinkaphant/create-kolmo` + `create-kolmo`)
|
|
85
|
+
|
|
86
|
+
Publish `@khr3/core` and `@pinkaphant/kolmo` first, sync `./templates/` with `../Kolmo/templates/`, bump `"version"` in `package.json`, then run:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm run release:both
|
|
90
|
+
git add -A && git commit -m "feat(templates): Kolmo vX.Y.Z (vA.B.C)" && git tag vA.B.C && git push origin main --tags
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`npm run release:both` ([`./scripts/publish-both.mjs`](./scripts/publish-both.mjs)) runs the full 6-template `npm test` + `tsc --noEmit` + `vite build` suite, publishes `@pinkaphant/create-kolmo`, and publishes unscoped `create-kolmo` (`npx create-kolmo@latest` / `npm create kolmo@latest`) from an isolated temp directory without mutating `package.json`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinkaphant/create-kolmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "node --test test/create-kolmo.test.mjs",
|
|
21
|
-
"pack:dry": "npm pack --dry-run"
|
|
21
|
+
"pack:dry": "npm pack --dry-run",
|
|
22
|
+
"release:both": "node scripts/publish-both.mjs"
|
|
22
23
|
},
|
|
23
24
|
"engines": {
|
|
24
25
|
"node": ">=24"
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
16
|
-
"@khr3/core": "^0.2.
|
|
16
|
+
"@khr3/core": "^0.2.27",
|
|
17
17
|
"@pinkaphant/ecctrl": "2.0.4-beta.13",
|
|
18
|
-
"@pinkaphant/kolmo": "^0.
|
|
18
|
+
"@pinkaphant/kolmo": "^0.22.0",
|
|
19
19
|
"@react-three/drei": "^10.7.7",
|
|
20
20
|
"@react-three/fiber": "^9.6.1",
|
|
21
21
|
"@react-three/rapier": "^2.2.0",
|
|
@@ -42,7 +42,6 @@ const RING_RADIUS = 46;
|
|
|
42
42
|
const PIT_DROP_Y = -2.2;
|
|
43
43
|
const RIVAL_COUNT = 5;
|
|
44
44
|
const TOTAL_CARS = 1 + RIVAL_COUNT;
|
|
45
|
-
const FIXED_STEP_DT = 1 / 60;
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* Sunken concave `128 m` demolition derby bowl:
|
|
@@ -209,7 +208,7 @@ function DerbyReferee({
|
|
|
209
208
|
useBeforePhysicsStep((steppingWorld) => {
|
|
210
209
|
const sim = simRef.current;
|
|
211
210
|
if (!sim) return;
|
|
212
|
-
const dt = steppingWorld.timestep > 0 ? steppingWorld.timestep :
|
|
211
|
+
const dt = steppingWorld.timestep > 0 ? steppingWorld.timestep : 0.016;
|
|
213
212
|
|
|
214
213
|
// Auto-board the player into slot 0 once mounted at the start of each bout
|
|
215
214
|
const actorEnt = kolmoWorld.queryFirst(ActorTrait);
|
|
@@ -390,20 +389,38 @@ function DerbyReferee({
|
|
|
390
389
|
cmd.steerLeft = false;
|
|
391
390
|
cmd.steerRight = false;
|
|
392
391
|
cmd.brake = true;
|
|
392
|
+
cmd.throttle = 0;
|
|
393
393
|
cmd.throttleUp = false;
|
|
394
394
|
cmd.boost = false;
|
|
395
|
+
if (cmd.joystickL) {
|
|
396
|
+
cmd.joystickL.x = 0;
|
|
397
|
+
cmd.joystickL.y = 0;
|
|
398
|
+
}
|
|
399
|
+
if (cmd.joystickR) {
|
|
400
|
+
cmd.joystickR.x = 0;
|
|
401
|
+
cmd.joystickR.y = 0;
|
|
402
|
+
}
|
|
395
403
|
vh.setMovement(cmd);
|
|
396
404
|
continue;
|
|
397
405
|
}
|
|
398
406
|
|
|
399
|
-
const ai = stepDerbyAutopilot(selfKin, sim.kinematics, RING_RADIUS,
|
|
407
|
+
const ai = stepDerbyAutopilot(selfKin, sim.kinematics, RING_RADIUS, dt, sim.memories[i]!, sim.aiCmd);
|
|
400
408
|
cmd.forward = ai.forward;
|
|
401
409
|
cmd.backward = ai.backward;
|
|
402
410
|
cmd.steerLeft = ai.steerLeft;
|
|
403
411
|
cmd.steerRight = ai.steerRight;
|
|
404
412
|
cmd.brake = ai.brake;
|
|
413
|
+
cmd.throttle = ai.boost ? 1 : 0;
|
|
405
414
|
cmd.throttleUp = ai.boost;
|
|
406
415
|
cmd.boost = ai.boost;
|
|
416
|
+
if (cmd.joystickL) {
|
|
417
|
+
cmd.joystickL.x = 0;
|
|
418
|
+
cmd.joystickL.y = 0;
|
|
419
|
+
}
|
|
420
|
+
if (cmd.joystickR) {
|
|
421
|
+
cmd.joystickR.x = 0;
|
|
422
|
+
cmd.joystickR.y = 0;
|
|
423
|
+
}
|
|
407
424
|
vh.setMovement(cmd);
|
|
408
425
|
}
|
|
409
426
|
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
16
16
|
"@khr3/c12": "^0.4.0",
|
|
17
|
-
"@khr3/core": "^0.2.
|
|
17
|
+
"@khr3/core": "^0.2.27",
|
|
18
18
|
"@khr3/roads": "^0.1.3",
|
|
19
19
|
"@pinkaphant/ecctrl": "2.0.4-beta.13",
|
|
20
|
-
"@pinkaphant/kolmo": "^0.
|
|
20
|
+
"@pinkaphant/kolmo": "^0.22.0",
|
|
21
21
|
"@react-three/drei": "^10.7.7",
|
|
22
22
|
"@react-three/fiber": "^9.6.1",
|
|
23
23
|
"@react-three/rapier": "^2.2.0",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
16
|
-
"@khr3/core": "^0.2.
|
|
16
|
+
"@khr3/core": "^0.2.27",
|
|
17
17
|
"@khr3/roads": "^0.1.3",
|
|
18
18
|
"@pinkaphant/ecctrl": "2.0.4-beta.13",
|
|
19
|
-
"@pinkaphant/kolmo": "^0.
|
|
19
|
+
"@pinkaphant/kolmo": "^0.22.0",
|
|
20
20
|
"@react-three/drei": "^10.7.7",
|
|
21
21
|
"@react-three/fiber": "^9.6.1",
|
|
22
22
|
"@react-three/rapier": "^2.2.0",
|
|
@@ -39,7 +39,6 @@ const GAUNTLET_SIZE_Z = 384;
|
|
|
39
39
|
const GAUNTLET_ROWS_Z = 192;
|
|
40
40
|
const GAUNTLET_COLS_X = 48;
|
|
41
41
|
const MAX_HEAT_SECONDS = 24;
|
|
42
|
-
const FIXED_STEP_DT = 1 / 60;
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* Builds a progressive `340 m` `+Z` climb, mogul rhythm section, and jump ramp spline on `@khr3/roads`.
|
|
@@ -182,7 +181,7 @@ function GauntletRunner({
|
|
|
182
181
|
useBeforePhysicsStep((world) => {
|
|
183
182
|
const st = stateRef.current;
|
|
184
183
|
if (!st || st.bred) return;
|
|
185
|
-
const dt =
|
|
184
|
+
const dt = world.timestep > 0 ? world.timestep : 0.016;
|
|
186
185
|
st.elapsedS += dt;
|
|
187
186
|
|
|
188
187
|
let stalledCount = 0;
|
|
@@ -271,8 +270,17 @@ function GauntletRunner({
|
|
|
271
270
|
cmd.steerLeft = cross < -0.045;
|
|
272
271
|
cmd.steerRight = cross > 0.045;
|
|
273
272
|
cmd.brake = false;
|
|
273
|
+
cmd.throttle = slot.hasBoosters ? (boostPulse ? 1 : 0) : undefined;
|
|
274
274
|
cmd.throttleUp = boostPulse;
|
|
275
275
|
cmd.boost = boostPulse;
|
|
276
|
+
if (cmd.joystickL) {
|
|
277
|
+
cmd.joystickL.x = 0;
|
|
278
|
+
cmd.joystickL.y = 0;
|
|
279
|
+
}
|
|
280
|
+
if (cmd.joystickR) {
|
|
281
|
+
cmd.joystickR.x = 0;
|
|
282
|
+
cmd.joystickR.y = 0;
|
|
283
|
+
}
|
|
276
284
|
vh.setMovement(cmd);
|
|
277
285
|
}
|
|
278
286
|
|
|
@@ -501,6 +509,7 @@ export default function App() {
|
|
|
501
509
|
bundle={slot.bundle}
|
|
502
510
|
position={slot.pose.position}
|
|
503
511
|
quaternion={slot.pose.quaternion}
|
|
512
|
+
waterConfig={slot.hasBoosters ? { airThrustScale: 1 } : undefined}
|
|
504
513
|
flightConfig={slot.hasBoosters ? { controlMode: "6DOF", rateP: 0, baseControlTorque: 0, linearDamping6DOF: 0 } : undefined}
|
|
505
514
|
vehicleRef={(h) => {
|
|
506
515
|
vehicleRefs.current[idx] = h;
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
16
|
-
"@khr3/core": "^0.2.
|
|
16
|
+
"@khr3/core": "^0.2.27",
|
|
17
17
|
"@khr3/roads": "^0.1.3",
|
|
18
18
|
"@pinkaphant/ecctrl": "2.0.4-beta.13",
|
|
19
|
-
"@pinkaphant/kolmo": "^0.
|
|
19
|
+
"@pinkaphant/kolmo": "^0.22.0",
|
|
20
20
|
"@react-three/drei": "^10.7.7",
|
|
21
21
|
"@react-three/fiber": "^9.6.1",
|
|
22
22
|
"@react-three/rapier": "^2.2.0",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
16
16
|
"@khr3/c12": "^0.4.0",
|
|
17
|
-
"@khr3/core": "^0.2.
|
|
17
|
+
"@khr3/core": "^0.2.27",
|
|
18
18
|
"@khr3/roads": "^0.1.3",
|
|
19
19
|
"@pinkaphant/ecctrl": "2.0.4-beta.13",
|
|
20
|
-
"@pinkaphant/kolmo": "^0.
|
|
20
|
+
"@pinkaphant/kolmo": "^0.22.0",
|
|
21
21
|
"@preact/signals-core": "^1.14.5",
|
|
22
22
|
"@react-three/drei": "^10.7.7",
|
|
23
23
|
"@react-three/fiber": "^9.6.1",
|
|
@@ -82,8 +82,9 @@ export default function App() {
|
|
|
82
82
|
const lx = s0.left[0];
|
|
83
83
|
const lz = s0.left[2];
|
|
84
84
|
const lots = frontage(builtRoad, { spacing: 28, setback: 8 });
|
|
85
|
-
const
|
|
86
|
-
const
|
|
85
|
+
const clearLots = lots.filter((l) => Math.abs(l.s - 120) > 150);
|
|
86
|
+
const lotA = clearLots[0] ?? lots[0];
|
|
87
|
+
const lotB = clearLots[1] ?? lots[1];
|
|
87
88
|
const spec = {
|
|
88
89
|
range: 144,
|
|
89
90
|
headingUp: true,
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@dimforge/rapier3d-compat": "0.19.2",
|
|
17
|
-
"@khr3/core": "^0.2.
|
|
17
|
+
"@khr3/core": "^0.2.27",
|
|
18
18
|
"@pinkaphant/ecctrl": "2.0.4-beta.13",
|
|
19
|
-
"@pinkaphant/kolmo": "^0.
|
|
19
|
+
"@pinkaphant/kolmo": "^0.22.0",
|
|
20
20
|
"@react-three/drei": "^10.7.7",
|
|
21
21
|
"@react-three/fiber": "^9.6.1",
|
|
22
22
|
"@react-three/rapier": "^2.2.0",
|