Leonid PershinandClaude Opus 4.8 15cad39240 Perf: spatial grid for plant foraging (drops the dominant O(plants) scan)
Plants vastly outnumber animals, and every herbivore forage decision scanned ALL
plants — the dominant per-decision cost. New PlantGrid (uniform cell grid, cell
lists pooled so rebuild is alloc-free) is rebuilt once per frame from plant
positions; TryFindPlant/TryFindBestPlant now gather only candidates from cells
overlapping the vision radius instead of iterating every plant. The entry carries
position/id/toxicity/palatability so no component refetch is needed. Selection is
unchanged (nearest / max-attractiveness, id tie-break), and since the result is
order-invariant the behaviour is identical and deterministic. Build + check clean.

Note: the animal-side neighbour scans (threat/prey/mate/herd) are still O(animals)
per decision — animals are far fewer than plants, and an animal grid is a riskier
change best done with a GUI run; deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 22:44:35 +03:00

LittleSim

A god-game with minimal graphics and deep simulation, built on the mrgameeng engine (git submodule engine/).

git clone --recurse-submodules <this repo>
dotnet run --project src/LittleSim -c Release

Design docs (Russian): docs/concept.md, docs/roadmap.md.

S
Description
No description provided
Readme
224 MiB
Languages
C# 73.1%
JavaScript 25.2%
HTML 0.8%
CSS 0.7%