Skip to content

A town simulation in pale isometric line art, implemented with Ritmo ECS and PixiJs 3D

Lint: the new simulation rules, and the Ritmo skill linked for agents

SandroMaglione5e99b8a6212f
diff --git a/.agents/skills/ritmo b/.agents/skills/ritmo
new file mode 120000
index 0000000..9acb9b9
--- /dev/null
+++ b/.agents/skills/ritmo
@@ -0,0 +1 @@
+../../node_modules/@typeonce/ritmo/skills/ritmo
\ No newline at end of file
diff --git a/.oxlintrc.json b/.oxlintrc.json
index b3156f0..43cfdb7 100644
--- a/.oxlintrc.json
+++ b/.oxlintrc.json
@@ -9,7 +9,8 @@
"town/no-cast-escape": "error",
"ritmo/handle-tick-result": "error",
"ritmo/prefix-descriptor-and-system-names": "error",
- "ritmo/use-cell-value": "error"
+ "ritmo/use-cell-value": "error",
+ "ritmo/no-state-spread": "error"
},
"overrides": [
{
@@ -20,6 +21,8 @@
"ritmo/use-ops-for-math": "error",
"ritmo/keep-simulation-headless": "error",
"ritmo/no-infinity-in-simulation-data": "error",
+ "ritmo/no-float-timers": "error",
+ "ritmo/no-brand-cast": "error",
"no-restricted-imports": ["error", {"patterns": [{"regex": "^(\\.\\./)+(view|ui|render|platform|app|labs)/", "message": "The simulation imports only itself: hand the page and the renderer what they need through edits, events, and the view."}]}]
}
},
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 2c1827c..9333ab4 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -277,7 +277,7 @@ One frame runs three schedules: `simulate` (at the chosen speed), then `project`
- `src/server/`: the only server code: the routes behind shared towns (`handler.ts`), the Cloudflare Worker that
runs them (`worker.ts`), and the same routes under `pnpm dev`, over a bucket in memory (`dev.ts`).
- `src/app/`: `browser.ts` (start-up: the runtime, the scene, the map input, the page, the loop, saves),
- `lint.ts` (what `pnpm lint:game` checks), and `devtools.ts` (the dev monitor and replay recorder).
+ `lint.ts` (what `pnpm lint:game` checks), and `devtools.ts` (the dev replay recorder).
- `src/labs/`: the dev-only pages: the art gallery, the asset lab, the map, park, effects and model reviews,
the service study, and the UI kit.
@@ -396,13 +396,18 @@ time from the `Town/Time` clock and randomness from `Town/Rng` or a seeded
page, host I/O or the renderer; they keep `Infinity` and `NaN` out of data,
which would save but not load; and they do engine-approximated math
(`sin`, `cos`, `atan2`, `exp`, `hypot`, `a ** b`) with `Ops` from
-`@typeonce/ritmo-math`, which returns the same bits on every engine.
+`@typeonce/ritmo`, which returns the same bits on every engine. They count
+time in whole steps, never by subtracting `dt` from a timer, and never cast
+a value to a branded type (such as `Random.State`): the schema or Ritmo's
+constructor makes it.
`Math.sqrt`, `min`, `max`, `floor`, `abs` and `x ** 2` are exact everywhere
and stay. A module the simulation runs belongs under `src/game/`, which is
all the lint needs. The same file keeps each layer to its imports (see
**Code**): the view, for one, imports no UI and no renderer, and is linted
headless too. `pnpm lint:game` then checks the schedules themselves with
Ritmo's devtools lints (`src/app/lint.ts`).
+The Ritmo skill an agent follows for every change is linked from the
+installed package at `.agents/skills/ritmo`, so it updates with Ritmo.
## Balancing