Skip to content

Commit

Permalink
docs: mild adjustments to tutorial 8
Browse files Browse the repository at this point in the history
  • Loading branch information
dysonreturns committed Apr 9, 2024
1 parent 99751b0 commit c6acbe8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/TUTORIAL_08.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Command Centres can be upgraded into Orbital Commands after the tech requirement
over-saturates patches for an additional ±220 minerals per minute.
- It also enables a **Scanner Sweep** which grants vision for a few seconds and reveals cloaked units.

Let's do so and see how to perform these abilities.
Let's upgrade and see how to perform these abilities.

#### Transform

Expand All @@ -41,7 +41,7 @@ def on_step
end
```

We start by checking that we have at least one completed barrack, since this is a tech requirement for Orbital Commands.
We start by checking that we have at least one completed Barrack, since this is a tech requirement for Orbital Commands.

While we only have one base right now (`main_base`), the above code generically loops over every structure of type
Command Centre.
Expand All @@ -65,7 +65,6 @@ You can smooth this build out more by adjusting the SCV building logic to not qu
#### Casting and Energy

With the Command Centre upgraded to an Orbital Command, let's call down a MULE.
This unit allows over-saturation of a mineral patch and brings us an additional ±220 minerals per minute.

```ruby

Expand Down Expand Up @@ -112,7 +111,9 @@ if main_base.unit_type == Api::UnitTypeId::ORBITALCOMMAND
end
```

So far, so good!
![mule](images/08_terran_upgades_mule.jpg)

So far, so good! We are getting extra income and putting it to use.

### Tech Lab Upgrades

Expand All @@ -129,7 +130,7 @@ Below we keep a simple array of the items we desire and queue them with a series
As seen above, the names of Id's might be different than what you know them by. We use the names the client gives us.
To find the name you are looking for, you can either ask in the Discord or dig for yourself...

The {Sc2::Data} shows **all available id's** in the game. At runtime you can inspect the Id's of the following:
The {Sc2::Data} object gives us **all available id's** in the game. At runtime you can inspect the Id's of the following:
`data.abilities`, `data.units`, `data.upgrades`, `data.buffs` and `data.effects`.

{Api::TechTree} has statically generated tech tree information.
Expand All @@ -152,7 +153,7 @@ some_structure.research(upgrade_id:, queue_command: false) # Tells specific Unit
structures.research(upgrade_id:, queue_command: false) # Tells Unit Group to research upgrade
```

#### Do your own research
#### For science!

Let's see how we can put some of these to use, given we have an array of desired upgrade ids:

Expand Down Expand Up @@ -193,11 +194,12 @@ After all those checks we can simply hand over the research command to all tech
`structures.select_type(Api::UnitTypeId::BARRACKSTECHLAB).research(...)`,
but let's use the {Api::TechTree} class to tell us which structures we need to select.

This way, if we had Factory or Starport upgrades, our bot can dynamically select the correct building, instead of hard-coded to Barracks' Tech Labs.
This way, if we had Factory or Starport upgrades, our bot can dynamically select the correct building, instead of hard-coded to Barracks' Tech Labs.

As mentioned before `Api::TechTree` hold information about the technology tree. It's useful for finding
what-creates-what and how.
Here, with `upgrade_researched_from`, we can find out which research structure is responsible for doing a specific
upgrade.
upgrade:

```ruby
research_structure_type = Api::TechTree.upgrade_researched_from(upgrade_id: upgrade_id)
Expand Down Expand Up @@ -251,7 +253,7 @@ Run it a few times and watch! We beat Medium frequently and even sometimes setti

---

### Terran Conclusion
## Conclusion

There are a ton of things we can still do with this build. The unnecessary or unused gas comes to mind first. Adding Factory/Starport units, even or taking another base.

Expand Down
Binary file added docs/images/08_terran_upgades_mule.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c6acbe8

Please sign in to comment.