Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyCommandCenter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Edvin Bergström
PyCommandCenter
Commits
622fbf5b
Commit
622fbf5b
authored
6 years ago
by
David Bergström
Browse files
Options
Downloads
Patches
Plain Diff
Bring getting started up to date
parent
bd6826b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/gettingstarted.rst
+22
-4
22 additions, 4 deletions
docs/gettingstarted.rst
with
22 additions
and
4 deletions
docs/gettingstarted.rst
+
22
−
4
View file @
622fbf5b
...
...
@@ -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``.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment