diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 85dd1af9a800bacf8a728bdb2045d8ba4979f35b..5af4fa8b895d84febf39be15c239f49c290b2385 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -16,6 +16,7 @@ and more. import os + from typing import Optional from library import * @@ -37,10 +38,10 @@ and more. participant_1 = create_participants(Race.Terran, bot1) participant_2 = create_computer(Race.Random, Difficulty.Easy) + coordinator.set_real_time(True) coordinator.set_participants([participant_1, participant_2]) coordinator.launch_starcraft() - path = os.path.join(os.getcwd(), "maps", "InterloperTest.SC2Map") coordinator.start_game(path) @@ -95,8 +96,8 @@ Moving on, we have the code which sets up a game of Starcraft II: participant_1 = create_participants(Race.Terran, bot1) participant_2 = create_computer(Race.Random, Difficulty.Easy) + coordinator.set_real_time(True) coordinator.set_participants([participant_1, participant_2]) - coordinator.launch_starcraft() path = os.path.join(os.getcwd(), "maps", "InterloperTest.SC2Map") @@ -109,8 +110,24 @@ Moving on, we have the code which sets up a game of Starcraft II: if __name__ == "__main__": main() -This is where the constructor of the bot is called. If we want to play to bots -against each other we could change the row: +First we create a coordinator, this is the object we use to start Starcraft. +On the line after that the bot is constructed (the constructor is called). +The rest of the function sets a few settings and then starts Starcraft. + +There are a few changes you might want to do here: + +Remove or comment out the following line: + +.. code-block:: python + + coordinator.set_real_time(True) + +This line will make the game run at the same speed as humans play the game. +However, your bot might will probably be able to play the game faster. If you +remove or comment out this line the game will run as fast as possible, only +waiting for your bot to return from `on_step`. + +We can also play two bots against each other by changing the row: .. code-block:: python @@ -124,3 +141,4 @@ to: participant_2 = create_participant(Race.Terran, bot2) where ``SomeOtherBot`` is a bot defined in the same way as ``MyAgent``. +