Update docs and task list
- author
- Marijn Besseling <njirambem@gmail.com> · 2026-10-24 22:59 UTC
- commit
- ff8642f81db2999d528d67a61aa0ac0d974651e6
- parent
- ab8b35f205
- tree
- browse at this commit
2 files changed +6 -1
CLAUDE.md +5 -0
| @@ -48,6 +48,11 @@ DF/RimWorld-style colony sim, Rust + Bevy 0.20 (newer than training data — che | ||
| 48 | 48 | - `src/panel.rs` top-right colonist panel (also: stockpile section with accept toggles + priority cycle when a stockpile tile is selected; collapsible Stock targets with -/+/auto per Stock): roster of `ColonistButton`s (rebuilt when names/child/mood face change; click selects) and, for a selected adult, `WorkToggle` buttons per `WorkType::{Food, Build, Gather, Haul, Tame}` toggling the colonist's `WorkPriorities` (required on Colonist; red = disabled). choose_jobs' autonomous candidates are a `(WorkType, finder)` list filtered by `allows`; orders ignore priorities. |
| 49 | 49 | - `src/rng.rs` `SimRng` SplitMix64 resource, seeded (deterministic sim; no `rand` dep). |
| 50 | 50 | |
| 51 | +## Performance notes | |
| 52 | +- Native profiling: temporarily add a Startup system writing `Action::SetSpeed(SimSpeed::Max)` in sim.rs, `CARGO_PROFILE_RELEASE_DEBUG=true cargo build --release`, run, `sample <pid> 15 -file out.txt`, aggregate `simulator::` symbols (revert the hack). | |
| 53 | +- Hot spots fixed so far: predicate BFS scanning items per tile (use `nearest_of` with precollected sets), searches that cannot match (pre-check wanted kinds, empty farm sets), choose_jobs setup skipped unless someone is ready (idle timer ticked in a pre-pass), periodic passes over only `WorldMap::worn_tiles` / `growing_plants`, light-driven tilemap re-tints rate-limited to 100 ms, `BuildContext.occupied` set. | |
| 54 | +- Browser at Max: ~100–350× on a 12-colonist colony, dips at dusk (ambient steps re-tint all chunks) and on hourly ticks. | |
| 55 | + | |
| 51 | 56 | ## Gotchas |
| 52 | 57 | - WebGL2 (wgpu GLES) guesses array texture view dim from layer count: 1→D2, 6→Cube, 6k→CubeArray. Tileset layer count padded via `tileset_layer_count`. Symptom: black screen + "wgpu-hal heuristics assumed ... Cube" errors. |
| 53 | 58 | - `UVec2::div_ceil` doesn't exist in this glam. |
tasks.md +1 -1
| @@ -35,7 +35,7 @@ | ||
| 35 | 35 | - [x] Colonist panel: roster with mood faces (click to select) and per-colonist work type toggles |
| 36 | 36 | - [x] Stockpile filters and priority per connected stockpile (stock moves up to higher priorities); stock target overrides in the panel |
| 37 | 37 | - [x] Smooth hill shading overlay |
| 38 | +- [x] Sim performance pass: set-based searches, skip impossible searches, worn/growing tile tracking, rate-limited light re-tints | |
| 38 | 39 | - [x] Action/keybind system, toolbar buttons for every keybind, hide-UI toggle (H), clicks on UI don't reach the map |
| 39 | 40 | |
| 40 | 41 | ## Planned |
| 41 | -- [ ] Sim performance: per-tile scans in `BuildContext::buildable` and site searches; wasm ticks still ~1 ms each with a full colony | |