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
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
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.