Commit graph

82 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
64d7bf6437
Update CLAUDE.md for ant behavior overhaul
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.
2026-03-11 22:50:10 -04:00
9f3ecb57e8
Update stats overlay to show active ant count vs budget 2026-03-11 22:50:10 -04:00
4c11924580
Add per-pixel hash noise to material colors 2026-03-11 22:50:10 -04:00
aa3c94091b
Activate dormant ants from spawn buffer in shader 2026-03-11 22:50:10 -04:00
b8f49afcc4
Add ant brush element with keybinding and GUI entry 2026-03-11 22:50:10 -04:00
c81ecaf21e
Add ant spawn uniform to AntsComputeScene 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
d4e48af662
Add configurable world seeding with random home and food placement 2026-03-11 20:48:05 -04:00
baadf6cd6d
Add ANTS_START_COUNT and ANT_BUDGET shader defines 2026-03-11 20:46:20 -04:00
f5b9af0ccc
Replace antsCount with antsStartCount and antBudget config 2026-03-11 20:45:31 -04:00
cd4f10bc80
Add ant behavior overhaul implementation plan
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.
2026-03-11 20:35:11 -04:00
fe537218a3
Add ant behavior overhaul design and nest-building research
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.
2026-03-11 20:31:06 -04:00
2269f26f9f
Update CLAUDE.md with sand physics architecture 2026-03-11 18:12:14 -04:00
685a382d4d
Add material palette to GUI panel 2026-03-11 18:12:14 -04:00
3e13b2ecd2
Add camera view mode toggle between side and top-down 2026-03-11 17:45:47 -04:00
9f958089c0
Add stats overlay with cursor position, TPS, and colony info 2026-03-11 17:45:47 -04:00
d91b5a9b5e
Block pheromone diffusion through solid materials
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.
2026-03-11 16:36:22 -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
290d27d85f
Place deposited material from ant cargo in world 2026-03-11 15:25:26 -04:00
489f121064
Encode deposit material ID in discretize pass 2026-03-11 15:25:11 -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
94b0393abb
Wire material properties texture into AntsComputeScene 2026-03-11 15:22:25 -04:00
cb43ebfe83
Remove food from side-view world initialization 2026-03-11 15:15:57 -04:00
37d615e87a
Fix gravity logic and revert y-flip 2026-03-11 15:15:46 -04:00
7003e074c5
Fix startup world init and inverted sand gravity 2026-03-11 14:55:40 -04:00
8909dc6390
Wire side-view world init into Renderer reset 2026-03-11 14:35:43 -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
e89ee1afa2
Add side-view world initialization with sand and sky 2026-03-11 14:35:43 -04:00
e8e5691d83
Add gravity direction and view mode to Config 2026-03-11 14:25:40 -04:00
568bfe83e3
Fix import order in App.ts after lint 2026-03-11 14:18:29 -04:00
bf34de9816
Wire sand physics pass into render pipeline 2026-03-11 14:18:29 -04:00
66d5f6b251
Add SandPhysicsScene for Margolus block CA 2026-03-11 14:18:29 -04:00
9e5af09476
Add Margolus block CA sand physics shader 2026-03-11 14:18:29 -04:00
3787dbbc3a
Add Margolus block offset utility with tests 2026-03-11 14:05:17 -04:00
89f963f9a6
Render world colors from material color lookup texture 2026-03-11 14:01:33 -04:00
29e5dbeb06
Extend draw tools to support material palette
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.
2026-03-11 14:01:33 -04:00
e6af97f402
Update ant compute shader for material IDs 2026-03-11 14:01:33 -04:00
e210ebc72d
Update world shader to use material IDs
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.
2026-03-11 14:01:33 -04:00
0f9c1b47f2
Replace bit-packed cell flags with material ID constants 2026-03-11 14:01:33 -04:00
f5b04f08c6
Wire material lookup textures into Renderer 2026-03-11 13:43:04 -04:00
a1e164454d
Add GPU lookup texture data generation for materials 2026-03-11 13:43:04 -04:00
bc2c8fa270
Add material registry with built-in materials 2026-03-11 13:43:04 -04:00
dd27634f0c
Add material type definitions 2026-03-11 13:43:04 -04:00
4457368636
Add ant farm sand physics implementation plan 2026-03-11 12:44:24 -04:00
de010adf44
Add ant farm sand physics design doc
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).
2026-03-11 12:39:47 -04:00