Skip to content

Commit

Permalink
Merge pull request #110 from AresSC2/docs/update-docs
Browse files Browse the repository at this point in the history
docs: update docs
  • Loading branch information
raspersc2 authored Feb 20, 2024
2 parents 6058065 + c11df7d commit e443b96
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 366 deletions.
1 change: 1 addition & 0 deletions docs/dev-guide.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Required reading only if planning to contribute to Ares or understand inner workings

TODO
54 changes: 28 additions & 26 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# Ares-SC2 Documentation

<b>Please Note:</b> The documentation while mostly complete, is an ongoing project.
Please feel free to contribute or raise an issue for anything that is missing.
<b>Please Note:</b> The documentation is an ongoing project.
Please feel free to contribute or raise an issue for anything that is missing or broke.

## Get Started Quickly with `ares-sc2`
### New bot author
For authors eager to establish a local bot development environment right away, we
recommend using the [ares-sc2-bot-template](https://github.com/AresSC2/ares-sc2-bot-template) and
follow the instructions in that repo.

If you're new to
[python-sc2](https://github.com/BurnySc2/python-sc2),
we suggest familiarizing yourself with it first.
Take a look at some examples and documentation on that repository. You can still write `python-sc2` code as
usual within the blank starter bot, making it a good option for learning the basics.

### Existing `python-sc2` users
Migrating your existing bot made with [python-sc2](https://github.com/BurnySc2/python-sc2) to `ares-sc2`,
is a fairly straight forward process in most instances. <b>Tutorial coming soon</b>

In any case glancing through the [tutorials](tutorials/index.md) and
the [api docs](api_reference/index.md) should give you an idea of what `ares-sc2` can offer.

<b>Useful links:</b> [Installation](./tutorials/installation.html) | [Source Repository](https://github.com/AresSC2/ares-sc2)

## About
`Ares-sc2` is a library that extends the capabilities of the
Expand All @@ -29,42 +47,26 @@ Feel free to add your own bot here

- Highly customizable and extendable behavior system. Curate custom combat maneuvers and macro plans.
- `ManagerMediator` to facilitate communication and retrieve information from managers in `ares`,
see [docs here](./api_reference/manager_mediator.html)
see [docs here](api_reference/manager_mediator.md)
- Manage production by declaring army compositions, less repetitive boilerplate code in your bot. See
[tutorial here](./tutorials/managing_production.html)
[tutorial here](tutorials/managing_production.md)
- Memory units tracking by default. Track units that have recently entered fog of war.
- Pre-calculated building formation for all maps and bases (Terran and Protoss only).
- [MapAnalyzer](https://github.com/spudde123/SC2MapAnalysis/tree/develop) library available
via `self.mediator.get_map_data_object`
- Pathfinding with populated influence grids available as needed.
- Opt in Build runner system, easily curate new builds via a config file.
- Data management, set multiple builds via the build runner system and `ares` will cycle through them on defeat.
- Cython alternatives for common functions.
- Cython alternatives available via the [cython-extensions-sc2](https://github.com/AresSC2/cython-extensions-sc2) library.
- Unit Role management system, a must-have for managing different groups of units.
- Debug unit spawning at camera location.

## Getting started
<b>New to bot development?</b> We've got you covered! Begin with the
[starter bot installation guide](./tutorials/installation.html) to set up your environment.
The tutorial provides a blank bot to help you get started. If you're new to
[python-sc2](https://github.com/BurnySc2/python-sc2),
we suggest familiarizing yourself with it first.
Take a look at some examples and documentation on that repository. Remember, you can write python-sc2 code as
usual within the blank starter bot.
If you're ready to explore features in `ares-sc2`, checking out the [tutorials section](./tutorials) would
[ares-sc2-bot-template](https://github.com/AresSC2/ares-sc2-bot-template) to set up your environment.
The tutorial provides a blank bot to help you get started.
If you're ready to explore features in `ares-sc2`, checking out the [tutorials section](./tutorials/index.md) would
be a good next step.

<b>Familiar to bot development and `python-sc2`?</b> Converting your existing bot to `ares-sc2` should be
seamless in most instances, check out the migration guide. Reading through the [tutorials](./tutorials) and
the [api docs]((./api_reference)) should give you an idea of what `ares-sc2` can offer.


## Roadmap

- Unit squad management and group behaviors
- Implement more behaviors
- Add on swapping
- Placement formation for Zerg
- Sophisticated build selection system


seamless in most instances, check out the migration guide.
2 changes: 1 addition & 1 deletion docs/tutorials/custom_behaviors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<b>Recommended reading:</b> How to curate [Combat Maneuver's]([Installation](./combat_maneuver_example.html)) using
<b>Recommended reading:</b> How to curate [Combat Maneuver's](./combat_maneuver_example.md) using
existing `Behavior`'s in `ares-sc2`.
Before curating custom behaviors, take a look at some of the
core [behaviors in ares-sc2](https://github.com/AresSC2/ares-sc2/tree/main/src/ares/behaviors), to get an idea
Expand Down
112 changes: 0 additions & 112 deletions docs/tutorials/installation.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/tutorials/managing_production.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ class TestBot(AresBot):
```

These behaviors can be further customized through arguments,
please refer to the [API docs](../api_reference/behaviors/macro_behaviors.html)
please refer to the [API docs](../api_reference/behaviors/macro_behaviors.md)


4 changes: 2 additions & 2 deletions docs/tutorials/tips_and_tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Selecting a worker
This aspect becomes especially meaningful, particularly in the context of using the
[`Mining` `MacroBehavior`](/api_reference/behaviors/macro_behaviors.html#ares.behaviors.macro.mining.Mining).
[`Mining` `MacroBehavior`](../api_reference/behaviors/macro_behaviors.md#ares.behaviors.macro.mining.Mining).
Behind the scenes, Ares designates workers to the `UnitRole.GATHERING` and automatically assigns
specific resources to each worker. Therefore, opting to
[select a worker through the mediator](/api_reference/manager_mediator.html#ares.managers.manager_mediator.ManagerMediator.select_worker)
[select a worker through the mediator](../api_reference/manager_mediator.md#ares.managers.manager_mediator.ManagerMediator.select_worker)
is recommended.
This not only simplifies internal bookkeeping by removing the worker but also prioritizes a worker
that isn't currently involved in mining or holding resources. The selection process even extends to workers at
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/unit_squads_group_behaviors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<b>Recommended Reading:</b> Explore how to effectively curate
[Combat Maneuvers]([Installation](./combat_maneuver_example.html)) with individual units,
[Combat Maneuvers](./combat_maneuver_example.md) with individual units,
providing insights into the workings of the combat maneuver and behavior system in `ares-sc2`.

## Why Opt for Unit Squads and Group Behaviors?
Expand Down
3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ nav:
- Combat Maneuver Example: tutorials/combat_maneuver_example.md
- Creating Custom Behaviors: tutorials/custom_behaviors.md
- Config File: tutorials/config_file.md
- Installation: tutorials/installation.md
- Managing Production: tutorials/managing_production.md
- Tips and Tricks: tutorials/tips_and_tricks.md
- Unit Squads and Group Behaviors: tutorials/unit_squads_group_behaviors.md
Expand Down Expand Up @@ -69,7 +68,7 @@ markdown_extensions:
- attr_list
- md_in_html
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg

# to navigate with `/site` content correctly
Expand Down
3 changes: 1 addition & 2 deletions src/ares/behaviors/combat/combat_maneuver.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@ def add(
],
) -> None:
"""
Parameters
----------
behavior : CombatBehavior
Add a new combat behavior to the current maneuver object.
Returns
-------
None
"""
self.micros.append(behavior)

Expand Down
18 changes: 0 additions & 18 deletions src/ares/behaviors/combat/individual/place_predictive_aoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@ class PlacePredictiveAoE(CombatIndividualBehavior):
def execute(
self, ai: "AresBot", config: dict, mediator: ManagerMediator, **kwargs
) -> bool:
"""Take the enemy center unit and fire a predictive AoE.
Parameters
----------
ai : AresBot
Bot object that will be running the game
config :
Dictionary with the data from the configuration file
mediator :
ManagerMediator used for getting information from other managers.
**kwargs :
None
Returns
-------
bool :
CombatBehavior carried out an action.
"""
if self.aoe_ability in self.unit.abilities:
# try to fire the ability if we find a position
if pos := self._calculate_target_position(ai):
Expand Down
Loading

0 comments on commit e443b96

Please sign in to comment.