Angle noise (±12° from wander) caused the ahead-cell pickup check
to sample into the sand cell directly below the ant. Ants were
grabbing sand on their first frame of existence.
Fix: skip powder pickup when the ahead cell equals the cell directly
below (the walking surface). Food pickup is still allowed from any
adjacent cell. Diagonal dig pickup still works since the DIG priority
angles ants at ~40° which targets a diagonal neighbor, not directly
below.
- Pickup checks cell ahead instead of current cell (ants walk in
air and can't enter solid cells, so current cell was always air)
- Starting ants face randomly left/right instead of straight down
into sand where they'd get stuck bouncing
- Gravity falls up to 4 cells/frame instead of 1 (was imperceptibly
slow at worldSize=1024)
- tryDropFood checks cell below too so ants walking above home can
still deposit food
Documents the budget pool activation model, priority-stack brain,
ant physics (gravity/collision/surface), unified brush spawning,
new config keys (antsStartCount, antBudget, seedWorld), stats
overlay active/budget format, worldInit test, and screenWorld.frag
color variation.
Ants whose index exceeds ANTS_START_COUNT output zero state and return
immediately on init, keeping them dormant without consuming GPU work.
This lets the ant texture capacity exceed the active ant count without
spawning unwanted ants.
- isObstacle() now blocks all non-air, non-home materials so ants treat sand/dirt/rock/food as walls
- gravity pulls ants down when no solid cell is below them, gating all steering logic while falling
- collision displacement pushes ants to nearest air cell when sand falls on top of them
7 phases: config changes, world seeding, ant physics (gravity/surface/collision),
priority stack brain, unified brush with ant spawning, sand color variation,
and cleanup. Future phases B (digging pheromone) and C (colony dynamics) captured
as hooks.
Design covers ant gravity/physics, unified brush tool, behavioral
priority stack, sand color variation, and config changes. Research
doc captures real ant nest construction patterns for informing
simulation behavior.
Checks each blur neighbor's material behavior before including it in
the average. Solid and non-gas cells are excluded so pheromones don't
bleed through walls, sand, or rock.
In side-view mode, ants carrying non-food powder material now bias their
angle upward toward the surface (30% blend). Ants not carrying anything
bias downward (20% blend) when diggable powder material is detected below.
Both biases are subtle so pheromone-following still shapes overall behavior.
Add VIEW_MODE_SIDE define to common shader defines so shaders can
branch on view mode via preprocessor. In side view, ants init by
scanning downward from the top to find the first non-air cell, then
spawn one pixel above it facing downward. Top view keeps the original
center spawn with random angle.
Replace bit-flag draw modes with direct material ID painting. draw.frag
now writes the material ID float directly instead of toggling individual
cell flag bits. ScreenScene drops the PointerState enum in favor of
numeric material IDs from constants.ts, and adds Digit1/Digit2 bindings
for sand and dirt.
Replace bit-packed cell flags in the R channel with a direct material ID float pass-through. Food clearing now writes MAT_AIR instead of clearing a bit.
Covers GPU Margolus block CA for particle sand, hybrid material
system (shader behaviors + data-driven registry), ant digging/carrying
mechanics, dual camera (side view primary, top-down secondary), and
tiered gravity model (basic -> angle of repose -> pressure propagation).