Data Structures · FIB-UPC

Programming Game Viewer

Watch AI bots compete in "The Purge" — a grid-based strategy game from the Data Structures and Algorithms course at FIB-UPC.

Preloaded

Sample Game

4 AI players battle across 250 rounds on a 15×30 grid. Includes warriors, builders, weapons, barricades, and resource gathering.

Map: 15 × 30 Rounds: 250 Players: 4
Watch Replay

Your Own Game

Compile and run the game locally, then upload the .out replay file to watch it here.

make && ./Game < default.cnf > replay.out

Viewer Controls

SpacePlay / Pause
Previous / Next round
Home EndGo to start / end
Mouse wheelZoom in / out
SliderScrub through rounds
HHelp overlay

About this project

Written in C++11, the game engine runs 4 AI players simultaneously on a 2D grid. The custom AI (AIJohnnyMelavo) uses BFS pathfinding to prioritize weapon collection, enemy hunting, and resource gathering. Each player controls warriors (fighters) and builders (constructors) who compete for money, food, guns, and bazookas across day/night cycles.

How to generate your own replays

  1. Clone the repository
  2. Write your own AI in a file like AIMyBot.cc (extend the Player class)
  3. Run make to compile
  4. Run ./Game -i default.cnf > replay.out to generate a replay
  5. Upload the replay.out file here to watch it!