# Evolution Sandbox: research, predictions and model boundaries

Updated 19 October 2026. The user approved moving from Algorithm Arena to this app and requested a game-informed animal rework. This page separates the biological ideas supported by sources from the sandbox's invented rules and our design hypotheses.

## Sources and decisions

- [UC Museum of Paleontology, Understanding Evolution: Natural Selection](https://evolution.berkeley.edu/evolution-101/mechanisms-the-processes-of-evolution/natural-selection/) describes variation, heredity and differences in reproductive success. **Decision:** show individual traits, parent links and actual offspring counts together. Survival and a high trait value alone do not demonstrate reproductive success.
- [Understanding Evolution: Misconceptions about evolution](https://evolution.berkeley.edu/teach-evolution/misconceptions-about-evolution/) distinguishes population change from an individual changing during its life; explains that mutation is not directed toward an organism's needs; and rejects identifying fitness with strength, speed or size. **Decision:** traits stay fixed for an individual's lifetime; mutation is a random birth event; avoid declaring a single universally best creature or promising that a population will adapt and survive. The changing population average is not an individual learning to become faster.
- [HHMI BioInteractive: Lizard Evolution Virtual Lab](https://www.biointeractive.org/classroom-resources/lizard-evolution-virtual-lab) organizes investigations around measurements, graphs and interpretation. **Decision:** pair the animated habitat with inspectable measurements, a written prediction, season reports, trait distributions and repeatable comparisons. This app does not reproduce HHMI's experiments, data or statistical analyses.
- [NetLogo Models Library: Wolf Sheep Predation](https://ccl.netlogo.org/netlogo/models/WolfSheepPredation) makes resource, energy and population rules explicit and offers parameter experiments. Its separate wolf, sheep and grass counts show how interacting groups depend on resource and reproduction assumptions; its documentation also discusses extinction and repeated seeded experiments. **Decision:** expose energy accounting, feeding groups and death causes instead of attributing every visual pattern to selection. Compare food-renewal methods and starting predator counts, while treating cycles and coexistence as outcomes to investigate, not promised results. Our sandbox uses its own rules; it is not an implementation or calibration of that model. This source was re-read for the predator/prey expansion on 18 October 2026.

The sources support the concepts and provide precedents for educational interactions. They do not validate our particular constants, creature art, simulated outcomes or learning effectiveness. No third-party imagery or source code is copied into the app.

## A question to test before running

Each experiment uses seed 42 and 32 grazer founders, so it can be compared with the meadow by changing one setting. The predator/prey experiment adds four predator founders. A seed repeats a sequence of random choices; changing a setting can alter subsequent events and how that sequence is used. It does not guarantee that every encounter or food location stays identical after the change. Repeat with other seeds before generalizing.

| Experiment | Controlled change from meadow | Prediction to test | Measurements and counterexample |
| --- | --- | --- | --- |
| Meadow | Baseline: 110 food pieces; energy multiplier 0.85; mutation chance 0.12 per trait; food clustering 0 | Existing variation may lead to different reproductive outcomes. | Inspect parent/offspring traits and births, deaths and distributions over completed seasons. A short run can show little change. |
| Scarcity | Food pieces 110 → 30 | Less available food may reduce births or increase deaths. | Compare population and energy at the same completed season. Do not promise that speed or size moves in a particular direction. |
| Food islands | Clustering 0 → 0.9, same food count | Food location may change encounters even when total food energy is equal. | Compare resource use and creature energy. A creature can starve while food remains elsewhere. |
| Mutation off | Mutation chance 0.12 → 0 | Offspring copy their parent's traits exactly, while the population mix can still change. | Compare parent and child values and population distributions. Starting variation remains; zero mutation does not freeze population composition. |
| No food | Food pieces 110 → 0 | Stored energy is eventually exhausted. | This is a determinate boundary case: all ongoing costs are positive; initial energy is below the reproduction threshold, so no offspring appear and the population becomes extinct. |
| Expensive living | Energy multiplier 0.85 → 1.6 | More energy may go toward survival, leaving less for offspring. | Compare births, deaths and energy at the same completed season, holding food fixed. Higher costs do not guarantee a particular trait trend in one stochastic run. |
| Predator/prey | Initial predators 0 → 4, with the same 32 starting grazers | Hunts may change grazer survival; predators may still starve if encounters are insufficient. | Plot both feeding groups and distinguish hunts from starvation. Early predator decline is possible; repeated cycles and persistent coexistence are not guaranteed. |
| Continuous food | Renewal seasonal → continuous, same target of 110 pieces | Changing the timing of supply may change energy and reproduction. | Compare actual food supplied as well as population. A seasonal replacement and gradual additions need not inject equal total energy. |
| Single harvest | Renewal seasonal → none, initial 110 pieces | A finite initial food and energy supply cannot support the population indefinitely under these rules. | Offspring may appear before energy becomes scarce, unlike the zero-food setup. There is no later food input, and reproduction only transfers energy. |

Our design prediction is that linking visible individuals to energy, inheritance and changing distributions will help learners explain the result. It requires learner testing; no claim of a measured improvement in understanding is made.

## What the simulation actually calculates

Read `model.js` as the authority for implementation. The following are sandbox assumptions, not measured biological laws:

- The square habitat has coordinates from 0 to 1 and solid borders. Distances and directions use direct displacement. Animals reflect inward when they reach a wall; their size sets a safety inset so their visible bodies remain inside. Opposite edges are not neighbours.
- Model integration uses fixed steps of 0.1 model seconds. A season contains 200 steps, or 20 model seconds. Playback speed changes how quickly these steps are presented; it does not change a creature's speed trait.
- Founders receive 8 energy units and independently sampled speed, size and sensing values between 0.7 and 1.3. Their actual lineage depth is zero. The starting grazer control supplies 4–80 grazers; the predator control adds 0–12 predators. Every offspring keeps its parent's feeding role. Trait values are relative model numbers, not metres, kilograms or biological measurements.
- A creature can move at up to `0.065 × speed` habitat widths per model second. Its search radius is `0.11 × sensing`; its collection reach is `0.012 × size` plus its maximum movement in the step. It steers toward nearby food when it has storage space; otherwise it wanders. Targeted travel stops at the nearest legal point toward the target instead of overshooting it, and a creature already at its target retains its heading while feeding. Energy capacity is `12 + 4 × size`.
- Each model second costs `(0.12 + 0.18 × speed² + 0.08 × size² + 0.05 × sensing) × energy multiplier` energy units. These constants impose trade-offs. They are not fitted metabolic equations. Larger trait values can help in one way while increasing the bill.
- Each food piece begins with 5 energy units. A grazer can take only available food energy and available storage capacity; remaining food can be eaten later. Predators do not eat these pieces. Agent update order is seeded and shuffled to avoid always favoring the first creature in an array.
- Predators pursue the nearest living grazer within `0.11 × sensing`, only when more than one energy unit below capacity. Catching reach is `0.018 × size` plus movement in the step. A catch kills the grazer and transfers at most the prey's stored energy and the predator's available capacity; unused prey energy is recorded as waste. There is no bonus energy created by a hunt. Grazers do not flee from predators in this version, an important behavioral simplification. Predators can starve, and neither group is guaranteed to persist.
- At a season boundary, a survivor with at least 12 energy units may produce one offspring if a population slot is available. The parent transfers 6 existing energy units to the offspring. Reproduction creates no additional energy.
- Food timing is a selectable rule. **Seasonal** renews the full target count at boundaries, replacing leftovers. **Continuous** keeps remaining food and adds new pieces evenly at up to the target number per 20 model seconds, only while below the target count; it does not replace the field at boundaries. **None** supplies only the initial food. These methods have different realized energy inputs and are not interchangeable plant-growth equations.
- Offspring inherit the parent's three values. Each trait independently has the chosen chance of a random change between −0.25 and +0.25, limited to the range 0.4–2. The chance is **per trait per offspring**, not the percentage of creatures guaranteed to change. A change may help, hurt or have little consequence in that habitat. Existing individuals do not acquire new trait values during their lives.
- Individuals die when stored energy reaches zero; grazers can also die when caught. Hunt deaths and starvation deaths are recorded separately. Age counts time since birth; the model currently has no age-related death or age penalty. Parents and offspring coexist, so season boundaries are **not biological generations**. Lineage depth counts parent-to-offspring links separately.
- The software caps the living population at 160 for performance. Births above that cap are blocked. A plateau at the cap is a software constraint, not evidence of a natural carrying capacity.
- There is no DNA, sexual reproduction, mating choice, migration, disease, species formation or measured ecology. Predator/prey behavior is deliberately simplified. The sandbox illustrates selected mechanisms and is not a professional biological forecasting tool.

Age colors are derived from elapsed age and serve as a visual aid. They do not change the three inherited traits or feeding role, grant an advantage, or cause death. Smooth motion interpolates presentation between fixed model steps; it must not alter model speed, food encounters, hunts, energy or recorded outcomes.

## Reading the evidence honestly

- A live population average is a description of the creatures currently alive. A higher average speed does not prove that each individual sped up, that all offspring mutated, or that faster creatures always win. Births and deaths can change averages without any new mutation.
- With both feeding roles present, a pooled average can also change because the proportions of grazers and predators changed. Read each group's population and individual traits before attributing that pooled change to evolution within a role.
- A season report uses recorded births and deaths. The opening state has no completed-season result. Extinction partway through a season must be labelled as an incomplete/early-ended season, not a full result.
- A successful causal claim needs a controlled comparison and repeated runs. Compare at the same completed season, keep untested settings fixed, and preserve the baseline rather than silently replacing it. A baseline with a different observation time should be identified as unmatched.
- Energy, numbers of creatures and offspring are useful outputs of this model. They are not direct estimates of real-world fitness, biodiversity, species success or ecosystem health.
- The learning panel explains the rules and recorded state. It does not infer a particular mutation, a victorious trait or a reason for a specific creature's success unless the model records the evidence.

## Checks

- Model checks should cover determinism; fixed-step batching; population accounting; parent identity and feeding role; energy transfer at birth and hunts; predation waste; finite food and renewal limits; trait bounds; unchanged parental traits; zero mutation; zero-food extinction; direct distances and all four solid borders; and truthful complete/partial season records.
- Learning checks cover all nine bounded one-change experiments, fresh-state wording, actual reported hunts and starvation, loss of one group versus complete extinction, the software population limit, fixed individual traits, age colors, mutation semantics and season/generation distinctions.
- Browser review should cover inspectable creatures, chart labels, comparison timing, settings persistence, export, playback controls, light/dark themes, phone/tablet/desktop layouts and a useful 2D fallback for unavailable WebGL.

These checks establish the intended numerical and interface behavior. They do not validate the model against organisms or establish educational effectiveness.

## Implementation review · 2026-10-18

This review records the earlier version, before the animal and arrival-motion rework below.

- 74 automated checks pass across model, ecology, learning, notebooks and scene presentation. The original grazer-only seeded trajectory is unchanged.
- Browser checks cover actual predator hunts and role counts, continuous and finite food, pending predator setup, exact save/load, age colour at birth/five/ten seasons, both renderers and playback controls. Phone (390 px), tablet (820 px) and desktop layouts were inspected in light and dark themes without horizontal overflow.
- The food report exposes the most recently recorded season’s food energy available (including carryover) and collected. CSV includes those two summary values plus role populations and death causes.
- Colours and motion are presentation aids; the three inherited traits, energy calculations and recorded model outcomes remain authoritative.

## Animal presentation rework · 2026-10-19

### References and predictions

- [Niche's official press kit](https://strayfawnstudio.com/presskit/sheet.php?p=niche_a_genetics_survival_game) describes procedural animals and population-genetics-inspired gameplay. **Design inference:** consistent animal silhouettes and inspectable individual variation should make a population easier to follow. Use our own rabbit-like grazer and fox-like predator designs, with distinct ears, faces and tails, rather than borrowing its artwork or claiming its genetics system. The shapes are role cues; these are not simulations of rabbit or fox biology.
- [Ecosystem's developer account of its technology](https://www.ecosystem-game.com/2018/05/01/the-technology-behind-ecosystem/) describes procedural bodies constructed around linked primitives and a failure where creatures depended on the rendering frame rate. **Decision:** assemble coherent animal parts around one model pose and keep visual gait separate from fixed-step simulation. Its aquatic physics, joint evolution and neural controllers are not features of this sandbox.

**Prediction to test:** recognizable feeding roles, a quieter ground texture and a closer camera option will help learners track a selected individual during feeding and hunts. At a food target, an animal should stop translating without alternating its heading; its feet should stop walking when it stops moving. This is an interface hypothesis, not a measured learning improvement or a claim of realistic animal behavior.

### Implementation decisions

- Correct target arrival in the model: cap travel by the remaining wrapped distance, land exactly on a reachable target and retain heading at zero distance. This addresses repeated overshoot and reversal at food. It changes seeded trajectories from the older movement bug; determinism and energy accounting must still hold under the corrected rule.
- Build original low-polygon, rabbit-like grazers and fox-like predators with coherent body parts. Match the same roles in the 2D view. Keep age colouring, trait values, selection, food and measured positions tied to the existing shared model.
- Drive gait from distance actually travelled, not from a perpetually running animation clock. Turning and travel should interpolate across wrapped edges without adding model movement. Paused, stationary and reduced-motion animals should not keep walking in place.
- Allocate instanced animal colour buffers for the supported population capacity, including later births. Every new or re-used slot must receive a complete current pose and colour; births must not produce stale, missing or detached parts.
- Reduce ground-pattern noise and offer a recoverable close-look camera. Retain orange controls, readable role/age explanations, the nine experiments, charts, inspectors and notebooks.

### Regression expectations

Check near-target arrival, exact target contact, wrapped arrival and resting headings; verify that batching fixed steps gives the same result and that feeding/hunts conserve the existing energy transfers. Review both rendering modes through births, deaths, pause/resume, stepping and save/load. Inspect stationary versus moving gait, age colours on new animals, selection markers, camera recovery, both themes and phone controls. The earlier review does not establish that these new cases pass; record their actual verification separately.

### Verification of this rework

All **84 automated checks** pass, including arrival at nearby and wrapped targets, fixed-step batching, energy accounting, exact saved-state restoration and deterministic continuation under the corrected movement rules. Renderer checks cover stationary and paused feet, connected leg joints during turns, full 160-creature colour capacity, birth/death slot reuse, selecting ears as well as bodies, age colours, camera recovery and multi-tick interpolation at fast playback. The shared Lab catalog check also passes.

Browser review covered both animal forms, Close look and Overview, 2D/3D switching, normal and fast playback, age/role colours, light/dark themes, and 390px phone, 820px tablet and desktop layouts. Phone and tablet views had no horizontal page overflow. No browser warnings or errors were reported. The initial playback pace is now 1× for observation; 3× and 10× remain available. A visible guide explains animal silhouettes and opposite-edge wrapping. These checks validate this implementation; they do not establish learning outcomes or performance on every device.


## Solid habitat borders · 2026-10-20

At the user’s request, the habitat now uses an enclosed field instead of connected opposite edges. This supersedes the wrapped-field behavior described in the historical reviews above. Animals turn inward at the perimeter; direct distances govern finding food, hunting and displayed sensing ranges. Both views use direct position interpolation and a clipped sensing circle, without an opposite-edge copy. The 3D perimeter rail and 2D border make the boundary visible.

Body size determines the safe centre inset: `1.05 × size / 16` habitat widths. Founders and offspring start within their own safe bounds. New food is placed inside a 0.14 margin, reachable by even the largest supported creatures. Legacy saved coordinates are preserved on load; the next simulation step brings any old edge positions inside the nearest safe boundary. This is not a jump to the opposite side. Legacy fringe food is preserved, but unreachable pieces do not trap a creature repeatedly trying to cross the boundary.

Checkpoint version 3 identifies the new boundary rules; earlier supported saves still load. An earlier connected-edge baseline is retained and labelled, but the interface asks for a fresh baseline before comparing it with the enclosed-field experiment. Changing topology can change survival and population histories; the existing energy, inheritance and reproduction rules remain the same.

Verification: all **94 Evolution checks** pass, including all four walls, corners, maximum body size, offspring placement, direct food/prey distances, long-run containment, deterministic batching and old-save continuation. Renderer checks cover direct interpolation, clipped sensing, anatomy clearance and a perimeter outside the playable area. The shared Lab catalog check passes. Browser review confirmed 2D/3D switching, step/restart, fast playback, the earlier-baseline notice and the visible perimeter. The 390px phone layout had no horizontal overflow; no browser warnings or errors were reported.

## Larger presentation and distinct predators · 2026-10-20

The habitat now gets a taller responsive viewing area and a tighter, centred perspective fit. The visible plane is larger on screen; its simulation dimensions, boundary rules and saved trajectories are unchanged. Overview fits the field, fence and supported animal heights inside a small screen margin, while manual orbit, pan and close-up views remain available.

Predator age colours now use coral → red → berry at birth, five seasons and ten or more seasons. Grazers retain mint → amber → violet. Both age scales appear in the legend, and the inspector uses the selected creature's role-specific age colour. Coral predator ears and tails remain visible in every colour mode; quantitative body colours still show the selected energy or inherited trait value. The 2D and 3D views use the same roles and palette endpoints.

Verification: all 24 renderer checks pass, including separate age palettes, constant predator markings, unchanged quantitative trait colours and perspective bounds across phone, tablet and wide viewers. Application syntax and the shared Lab catalog check pass. Browser review confirmed larger desktop/phone framing, coral predators in both views, readable age legends, persistent markings in energy mode and no horizontal overflow at 390px. No browser warnings or errors were reported.

## Audit, replicates and phone performance · 2026-10-21

### Findings and fixes

- **Seed collisions.** Any text that `Number()` read as a non-negative integer was used directly, so `''` and `'0'`, `'042'` and `'42'`, `'1e3'` and `'1000'`, and `4294967296` and `0` all produced the same run. Now only a canonical decimal integer up to 4294967295 is used directly; every other spelling is hashed. Canonical seeds such as 42 (all nine experiments) keep their exact trajectories, and saved checkpoints are unaffected because they store the generator state, not the seed text.
- **Search cost near the population cap.** At 160 creatures and 180 food pieces a model step took about 1.6 ms on desktop, mostly in `Math.hypot`, so +5 seasons could block a phone for several seconds. Food and prey search now rejects candidates outside the sensing square first. Because `hypot(dx, dy)` is never smaller than |dx| or |dy|, this only skips candidates the full test would also reject. Five seeded scenarios hash identically before and after the change; five seasons at the cap went from about 2.6 s to 0.28 s in Node.
- **Count axes.** Population and trait-spread charts placed gridlines at quarters of a multiple of ten and rounded the labels, so a gridline at 2.5 creatures was labelled "3". Axes now use whole-number steps so every label equals its gridline. Elapsed-time labels no longer print floating-point residue, and the chart says when older seasons have dropped out of the 100-record window.
- **Pooled spread.** With predators present, the trait-spread histogram mixed both feeding roles in one colour. Bars are now stacked by role, with grazer and predator counts in the exact-number table. `distribution(world, trait, bins, role)` accepts an optional role filter.
- Checks with no defect found: zero mutation copies traits exactly; the 160 cap is never exceeded; extinction mid-season is recorded as partial; energy, death-cause and population accounting still validate.

### Addition: repeat with other seeds

The history card can rerun the current starting settings with five seeds (the current seed plus four derived ones) for 5, 10 or 20 seasons. Runs happen in 12 ms slices so the page stays responsive, and they never touch the live experiment. The first replicate exactly reproduces the live run when no settings were changed mid-run (tested). The summary reports extinctions, lost predator groups, populations that hit the cap, the population range and median, and mean traits for surviving runs only. **Prediction to test:** seeing outcomes for several seeds side by side will discourage learners from generalising from one stochastic run. This has not been measured with learners. Mid-run setting changes are not replayed, and the interface says so.

### Phone rendering

On touch (coarse-pointer) devices the 3D renderer caps the device pixel ratio at 1.5 instead of 1.75, which means about 27% fewer pixels to shade. In headless profiling, JavaScript (model plus scene updates) was a small fraction of frame time; the remainder was software GPU rasterisation, so real phone frame rates were not measured here.

Verification: **102 automated checks** pass, including the identical-trajectory hashes, seed spellings, role-partitioned distributions, whole-number axis steps, replicate summaries and a zero-mutation run to the cap. Browser review at 390×844 and 1440×900 in both themes showed no horizontal page overflow, no axe WCAG A/AA violations and no console errors apart from offline font requests.
