How remizzzzz/ia04 works
This repository implements a Go grid-combat simulation, currently driven by a terminal loop. The main workflow is CLI entry → simulation runner → world setup and turns → unit decisions → world movement and rendering. Units can act independently or coordinate through an Army; the world owns perception, pathfinding, and turn resolution. The README describes web/ebiten clients, headless experiments, richer unit roles, and S0–S3 strategies, but the sampled runtime does not establish those as implemented capabilities; shooting is recognized but has no effect. Edges below reflect only shown calls and documented relationships.
Main entry points: world.go Turn controller · unit.go Unit agent · simulation.go Simulation runner · army.go Army strategy
Components 11
Simulation runtime
- CLI entry
cmd/main/main.go - Simulation runner
cmd/sim/simulation.go - Terminal renderer
cmd/world/world.go
Agent coordination
- Unit agent
cmd/agents/unit.go - Army strategy
cmd/agents/army.go
World mechanics
- Turn controller
cmd/world/world.go - Grid and movement
cmd/world/world.go - Vision and routing
cmd/world/world.go - Grid geometry
cmd/geometry/geometry.go - Random utilities
cmd/utils/utils.go
Other components
- User
Connections 18
- User → CLI entry: starts
- CLI entry → Simulation runner: runs simulation
cmd/main/main.go - Simulation runner → Grid and movement: creates world
cmd/sim/simulation.go - Simulation runner → Turn controller: runs turns
cmd/sim/simulation.go - Simulation runner → Terminal renderer: prints world
cmd/sim/simulation.go - Turn controller → Unit agent: sends orders
cmd/world/world.go - Unit agent → Turn controller: returns actions
cmd/world/world.go - Turn controller → Army strategy: updates awareness
cmd/world/world.go - Unit agent → Army strategy: requests decision
cmd/agents/unit.go - Turn controller → Vision and routing: builds perception
cmd/world/world.go - Turn controller → Grid and movement: applies movement
cmd/world/world.go - Grid and movement → Grid geometry: uses coordinates
cmd/world/world.go - Vision and routing → Grid geometry: measures distance
cmd/world/world.go - Grid and movement → Random utilities: chooses free tiles
cmd/world/world.go - Army strategy → Grid geometry: measures distance
cmd/agents/army.go - Army strategy → Random utilities: checks membership
cmd/agents/army.go - Unit agent → Grid geometry: uses positions
cmd/agents/unit.go - Unit agent → Random utilities: chooses random moves
cmd/agents/unit.go