Commit graph

19 commits

Author SHA1 Message Date
5d25218433
Prevent ants from picking up the surface they walk on
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.
2026-03-12 10:16:14 -04:00
328f8a76e2
Fix ant physics: pickup, gravity, spawn angle, food drop
- 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
2026-03-12 09:59:04 -04:00
aa3c94091b
Activate dormant ants from spawn buffer in shader 2026-03-11 22:50:10 -04:00
a7aeb064b3
Rewrite ant behavior as priority stack with suppressors 2026-03-11 22:50:10 -04:00
8bf718bbbe
Gate ant initialization by ANTS_START_COUNT budget
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.
2026-03-11 22:50:10 -04:00
f41e464b4a
Add ant gravity, surface constraint, and collision displacement
- 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
2026-03-11 22:50:10 -04:00
6b514f338c
Add gravity-aware digging direction for ants
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.
2026-03-11 15:26:48 -04:00
34bd1e95c2
Add powder material deposit logic for surface placement 2026-03-11 15:24:45 -04:00
43d3e56aee
Add material-aware ant pickup with carry strength check 2026-03-11 15:23:03 -04:00
cd8a4ade82
Spawn ants on sand surface in side view mode
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.
2026-03-11 14:35:43 -04:00
e6af97f402
Update ant compute shader for material IDs 2026-03-11 14:01:33 -04:00
451e187032
Add colony stats readback for aggregate ant state 2026-03-09 11:15:57 -04:00
862cbfc3b7
Add ant presence texture for future spatial neighbor queries 2026-03-09 11:15:57 -04:00
cff99b7f08
Add second ant texture with MRT for extended ant state 2026-03-09 10:45:26 -04:00
vHawk
a3c03cafef Fix world texture sampling 2022-07-11 02:19:01 +03:00
vHawk
a2b5d45a52 Add obstacles 2022-06-29 15:45:31 +03:00
vHawk
27c835b8e5 Interaction improvements and minor fixes 2022-06-29 00:35:45 +03:00
vHawk
fb772db717 Cleanup; make ants bounce off the world bounds 2022-06-26 19:23:23 +03:00
vHawk
f0c253c7fb Initial implementation 2022-06-26 12:34:16 +03:00