Skip to content

This repository contains my player solution for "The Purge" edition of the EDA GAME, a lightweight strategy game developed as part of the EDA (Estructures de Dades i Algorismes) course at the FIB - UPC. The project focuses on implementing custom data structures and algorithms to manage game logic efficiently. Placed 2nd out of 150 participants.

Notifications You must be signed in to change notification settings

PauSerrano4/EDA-GAME

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EDA-GAME

This repository contains my player solution for EDA GAME, a lightweight strategy game developed as part of the EDA (Estructures de Dades i Algorismes) course at the FIB - UPC. The project, written in C++, focuses on implementing custom data structures and algorithms to manage game logic efficiently.

Project Structure

  • Game: Main executable for running matches between AI players.
  • AI.cc / AI.o**: Source/object files for different AI player implementations.
  • Structs.cc/h, Settings.cc/h, State.cc/h, etc.: Core game logic, data structures, and utilities.
  • Makefile: Build system for compiling the project and managing dependencies.
  • GameTest.sh: Bash script to automate running multiple matches and aggregate results.
  • default.cnf: Default configuration file for the game.
  • README.md: This documentation file.

Features

  • Modular AI player system: easily add or swap AI strategies.
  • Custom data structures for efficient game state management.
  • Batch testing and result aggregation via shell script.
  • Configurable game parameters and random seeds for reproducibility.

🏁 Final Version

  • AIINVICTUS.cc is the final and most refined version of my AI player for the EDA Game project. This is the version I used in the Grand Final, where it earned an impressive 2nd place out of 150 participants.

  • Along the journey to this final version, I developed several other strong contenders, including:

    • AIMareNostrum.cc
    • AITerminator.cc
    • AISkynet.cc
    • AIChatGPT.cc
  • In addition, I experimented with a variety of compiled object files shared by fellow participants during this edition of the game. These iterations helped shape and optimize my final strategy.

How to Build

  1. Requirements:

    • C++11 compatible compiler (e.g., g++)
    • Bash (for running GameTest.sh)
    • Make
  2. Build the project:
    Open a terminal in the project directory and run:

    make
    

    This will generate the Game executable.

How to Run a Single Match

To run a match between four AI players, use:

./Game PLAYER1 PLAYER2 PLAYER3 PLAYER4 -s SEED -i default.cnf -o output.res
  • Replace PLAYER1 ... PLAYER4 with the names of the AI player files (without the .o extension).
  • -s SEED sets the random seed (use any integer).
  • -i default.cnf specifies the configuration file.
  • -o output.res specifies the output file for results.

Example:

./Game Jugador toasty1 Dummy Terminator -s 42 -i default.cnf -o match1.res

How to Watch or Analyze a Match

  • The output file (e.g., match1.res) contains the match results.
  • The terminal output shows the progress and winner.
  • For more detailed logs, check the output redirected by the shell script (see below).

Running Multiple Matches with GameTest.sh

The GameTest.sh script automates running multiple matches and summarizes the results.

Usage:

bash GameTest.sh PLAYER1 PLAYER2 PLAYER3 PLAYER4 NUM_MATCHES
  • Replace PLAYER1 ... PLAYER4 with the AI player names.
  • NUM_MATCHES is the number of matches to run.

Example:

bash GameTest.sh Jugador toasty1 Dummy Terminator 10
  • The script will run 10 matches with random seeds, print the winner of each match, and display the total wins for each player at the end.
  • Temporary output and result files are cleaned up automatically.

Adding Your Own AI

To add a new AI player:

  1. Implement your AI logic in a new file named AIYourName.cc.
  2. Copy the AIDemo.cc code to AIYourName.cc. It can serve as a template to start with.
  3. Add the object file to the EXTRA_OBJ variable in the Makefile if needed.
  4. Rebuild the project with make.
  5. Run matches including your AI as described above.

License

This project is for educational purposes as part of the EDA course at FIB - UPC.


Feel free to open issues or submit pull requests for improvements!

About

This repository contains my player solution for "The Purge" edition of the EDA GAME, a lightweight strategy game developed as part of the EDA (Estructures de Dades i Algorismes) course at the FIB - UPC. The project focuses on implementing custom data structures and algorithms to manage game logic efficiently. Placed 2nd out of 150 participants.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages