Diamonds is a programming challenge that pits your bot against bots created by other players. Each player will have a bot whose goal is to collect as many diamonds as possible. There are several elements to this game. Those are: diamonds, red diamond button, teleporters, bots and bases, and inventory. To win the match, each player must implement specific strategies for their respective bots which will be contested in a 60 second round with three oponents.
Each bot will have an inventory of size 5 which can store the diamonds before it goes back to base. The bot's score will only increase if the diamonds stored in the inventory have been brought back to base. In this game, one player can tackle another, causing the other player to lose all of its diamonds in its inventory. The other bot will re-spawn at base.
- Node.js (https://nodejs.org/en)
- Docker desktop (https://www.docker.com/products/docker-desktop/)
- Yarn (
npm install --global yarn
)
- Python (https://www.python.org/downloads/)
- Download the source code (.zip) from the latest release
- Extract the zip file and open the terminal
- Go to the project root directory
$ cd tubes1-IF2110-game-engine-1.1.0
- Install dependencies with yarn
$ yarn
- Set up default environment variable
Windows:
Linux:
$ ./scripts/copy-env.bat
$ chmod +x ./scripts/copy-env.sh $ ./scripts/copy-env.sh
- Set up a local database by opening docker then run the following command
Then, run the following script. For Windows:
$ docker compose up -d database
For Linux:$ ./scripts/setup-db-prisma.bat
$ chmod +x ./scripts/setup-db-prisma.sh $ ./scripts/setup-db-prisma.sh
- Build and run by the following commands
$ npm run build
$ npm run start
To access the frontend page of the website, visit http://localhost:8082/
- Download the source code (.zip) from the latest bot release
- Extract the zip file and open the terminal
- Go to the project root directory
$ cd tubes1-IF2110-bot-starter-pack-1.0.1
- Install dependencies with pip
$ pip install -r requirements.txt
- Run the bot
To run a bot, you can use the following command in the src directory
Or, if you want to run multiple bots (up to four bots) at a time, you can run (and edit) the following script
$ python main.py --logic Random [email protected] --name=your_name --password=your_password --team etimo
For Windows:For Linux:$ ./run-bots.bat
You can change the logic used (in the example above, the logic is Random), email, name, and password.$ ./run-bots.sh
In this repository, we experimented with four Greedy algorithm approaches in the game Etimo: Diamonds, namely Greedy by Distance, Greedy by Points, Greedy by Point Density, and Greedy by Area Density. After conducting analysis and simulations, we propose the Greedy by Point Density algorithm as the main greedy algorithm for this bot. At each step, this bot will choose the step advancing to the diamond with the largest density (point / distance) value, taking into acount teleporters which might reduce distance (and therefore increase the density).
.
├── README.md
├── doc
│ └── SarikatJava.pdf
└── src
├── README.md
├── __pycache__
│ └── decode.cpython-311.pyc
├── decode.py
├── game
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-311.pyc
│ │ ├── api.cpython-311.pyc
│ │ ├── board_handler.cpython-311.pyc
│ │ ├── bot_handler.cpython-311.pyc
│ │ ├── models.cpython-311.pyc
│ │ └── util.cpython-311.pyc
│ ├── api.py
│ ├── board_handler.py
│ ├── bot_handler.py
│ ├── logic
│ │ ├── Others
│ │ │ ├── SquareDensity.py
│ │ │ ├── __pycache__
│ │ │ │ ├── SquareDensity.cpython-311.pyc
│ │ │ │ ├── points.cpython-311.pyc
│ │ │ │ └── teleportGreed.cpython-311.pyc
│ │ │ ├── points.py
│ │ │ └── teleportGreed.py
│ │ ├── SarikatJava.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── DensityBot.cpython-311.pyc
│ │ │ ├── PureDensity.cpython-311.pyc
│ │ │ ├── SarikatJava.cpython-311.pyc
│ │ │ ├── ShortestDistance.cpython-311.pyc
│ │ │ ├── SquareDensity.cpython-311.pyc
│ │ │ ├── __init__.cpython-311.pyc
│ │ │ ├── base.cpython-311.pyc
│ │ │ ├── points.cpython-311.pyc
│ │ │ ├── random.cpython-311.pyc
│ │ │ └── teleportGreed.cpython-311.pyc
│ │ ├── base.py
│ │ └── random.py
│ ├── models.py
│ └── util.py
├── main.py
├── requirements.txt
├── run-bots.bat
├── run-bots.sh
└── temp.txt
Nama | NIM |
---|---|
Imanuel Sebastian Girsang | 13522058 |
Venantius Sean Ardi Nugroho | 13522078 |
Julian Chandra Sutadi | 13522080 |