How runningbrute/starforge works
StarForge is a modular C particle-simulation engine. Its main workflow is to create an engine and particle systems, emit particles, update them under world forces using a selected storage/update backend, then expose particles to a frontend for rendering. Major documented branches include continuous rain and fire/smoke emitters, burst emitters, ASCII and Raylib frontends, and AoS, SoA, and optional AVX2 backends. The graph follows sampled engine and system dispatch; some capability links are documented in the README, while unsampled demo wiring is not inferred.
Main entry points: starforge_particlesystem.c Particle system · starforge_engine.c Engine · starforge_frontend.h Frontend interface · starforge_backend_soa_cpu.c SoA CPU backend
Components 15
Engine orchestration
- Engine
src/starforge_engine.c - World forces
src/starforge_world.c - Particle system
src/starforge_particlesystem.c
Particle simulation
- Particle model
include/starforge_particle.h - Emitter variants
src - Backend interface
include/starforge_backend.h - AoS backend
src/starforge_backend_aos.c - SoA CPU backend
src/starforge_backend_soa_cpu.c - SoA AVX2 backend
src/starforge_backend_soa_avx2.c
Particle storage
- AoS / SoA pools
src - Pool accessor
include/starforge_particle_pool_accessor.h
Frontends
- Frontend interface
include/starforge_frontend.h - ASCII frontend
src/starforge_frontend_ascii.c - Raylib frontend
src/starforge_frontend_raylib.c
Other components
- Demo user
Connections 21
- Demo user → Engine: runs demos
README.md - Engine → World forces: initializes
src/starforge_engine.c - Engine → Particle system: creates systems
src/starforge_engine.c - Engine → Particle system: updates systems
src/starforge_engine.c - Engine → Frontend interface: dispatches render
src/starforge_engine.c - Particle system → Emitter variants: dispatches emission
src/starforge_particlesystem.c - Particle system → Backend interface: updates backend
src/starforge_particlesystem.c - Particle system → AoS / SoA pools: creates pool
src/starforge_particlesystem.c - Particle system → AoS backend: selects backend
src/starforge_particlesystem.c - Particle system → SoA CPU backend: selects backend
src/starforge_particlesystem.c - Particle system → SoA AVX2 backend: selects backend
src/starforge_particlesystem.c - AoS backend → AoS / SoA pools: uses pool API
src/starforge_backend_aos.c - SoA CPU backend → AoS / SoA pools: uses pool API
src/starforge_backend_soa_cpu.c - SoA AVX2 backend → SoA CPU backend: uses CPU backend API
src/starforge_backend_soa_avx2.c - Particle system → World forces: passes forces
src/starforge_particlesystem.c - Particle system → Particle model: exposes particles
- Backend interface → Pool accessor: defines access
include/starforge_backend.h - Frontend interface → ASCII frontend: implemented by
- Frontend interface → Raylib frontend: implemented by
- ASCII frontend → Engine: reads particles
src/starforge_frontend_ascii.c - Raylib frontend → Engine: reads particles
src/starforge_frontend_raylib.c