website | python-starterpack | java-starterpack | visualizer | engine | wiki
Welcome to MechMania! The python starterpack will allow you to write a python bot to compete against others. Two bots will be faced against each other, and then the engine will run a simulation to see who wins! After the engine runs you'll get a gamelog (a large json file) that you can use in the visualizer to visualize the game's progress and end result.
To begin, make sure you have Java 17+ installed. You can test this by running:
java --version
Also, you'll need python 3.9+, and you can make sure you have it by running:
python --version
Make sure you're using 3.9+, or things will break!
To install the engine, you can simply run:
python engine.py
and you should see an engine.jar appear in engine/engine.jar!
If you don't, you can manually install it by following the instructions on the engine page.
To modify your strategy, you'll want to edit strategy/choose_strategy.py
.
You should only need to edit files in the strategy directory.
To run your client, you can use the following commands:
python main.py run self
python main.py run humanComputer
python main.py run zombieComputer
You shouldn't need to do this, unless none of the other methods work.
Expand instructions
To serve your bot to a port, you can run it like this:
python main.py serve [port]
Where port is the port you want to serve to, like 9001 for example:
python main.py serve 9001
A full setup with the engine might look like (all 3 commands in separate terminal windows):
python main.py serve 9001
python main.py serve 9002
java -jar engine.jar 9001 9002