Running The Game¶
Basic flow of how a game works:
- A game map is generated.
- Start a server
- Start a client. Your client will connect to the server.
- The server then orchestrates the game based on the
game_data.jsonfile and responses from the client. The server also generates a
game_log/directory which contains the game log which is used by the visualizer to visualize the game after it has finished running.
- Wait for the client and server to finish running.
- Run the visualizer to visualize how the game played out.
Note: All of the following commands must be run from the root of the repository.
Generate a Game Map¶
Generates a game map
game_data.json file. This file outlines a randomly generated game map.
Select “Generate Map” from the drop down, then click the green arrow to run the script.
python -m game.scripts.generate
Easy Run Script¶
Only works for a Linux teminal.
Runs both the client and server.
Runs the game server.
Select “Run Server” from the drop down, then click the green arrow to run the script.
python -m game.scripts.server
Runs the default client (
Select “Run Client” from the drop down, then click the green arrow to run the script.
python -m game.scripts.client
Run a custom client defined in the root of the repository (e.g.
demo_client.py). Note that you do not include the
python -m game.scripts.client --client demo_client
Run the visualizer in
Requires a successful game to have been run beforehand.
Select “Run Visualizer” from the drop down, then click the green arrow to run the script.
python -m game.scripts.visualizer
Run the visualizer and visualize a different game log.
python -m game.scripts.visualizer --game-log copied_game_log_path
To adjust the brightness of the game (and possibly throw off the colors of your monitor - restart should fix) try adding
1.0 should be the default display colorization. Less than
1.0 wil make the display darker, greater than
1.0 will make the display brighter.
2.0 Does some interesting things.