"# AI-Sim
A browser-based 2D world simulation demonstrating client-side AI inference and training using TensorFlow.js. Published as a GitHub Page.
Two species of creatures live in a tile-based world rendered on Canvas 2D:
- πΏ Herbivores β seek food, flock with each other, flee predators
- π¦ Predators β hunt herbivores, hold territory
Each species shares a CNN brain (TensorFlow.js) trained in-browser via Deep Q-Network (DQN). Creatures perceive a 7Γ7 tile grid around them and learn which actions (move up/down/left/right/stay) maximise their rewards.
Use the sidebar toolbar to:
- π± Paint food sources
- π©π¦π₯ Paint terrain (grass / water / danger zones)
- Spawn or clear creature populations
- Tune the replay buffer size (1 = online learning, 2000 = stable mini-batch RL)
- Adjust simulation speed and exploration rate (epsilon)
- TensorFlow.js β in-browser ML
- Canvas 2D β rendering
- Vite β build & dev server
- GitHub Actions β CI/CD to GitHub Pages
npm install
npm run dev # local dev server
npm run build # production build β dist/Push to main to deploy automatically to GitHub Pages."