Skip to content

Commit

Permalink
feat: trigger release test
Browse files Browse the repository at this point in the history
  • Loading branch information
raspersc2 committed Sep 7, 2023
1 parent be47798 commit 23ba55d
Showing 1 changed file with 47 additions and 22 deletions.
69 changes: 47 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# SC2MapAnalysis


* ![build](https://github.com/eladyaniv01/SC2MapAnalysis/workflows/Build/badge.svg?branch=master)
[master](https://github.com/eladyaniv01/SC2MapAnalysis/tree/master)
# SC2MapAnalysis

* ![](https://img.shields.io/github/package-json/v/eladyaniv01/SC2MapAnalysis?color=blue&logo=EladYaniv01&style=plastic) [Changelog](https://github.com/eladyaniv01/SC2MapAnalysis/blob/master/CHANGELOG.md)

Expand Down Expand Up @@ -33,7 +29,7 @@ Check out his work

More Examples reside in the [Documentation](https://eladyaniv01.github.io/SC2MapAnalysis/)

See [here](./examples/MassReaper/README.md) for an example reaper bot showing pathing and influence in action.
See [here](./examples/MassReaper/README.md) for an example `MapAnalyzer` reaper bot showing pathing and influence in action.

Example:
```python
Expand Down Expand Up @@ -73,13 +69,19 @@ map_data.plot_map()
<img src="https://user-images.githubusercontent.com/40754127/88463402-3fa1dc80-cebb-11ea-9da9-f80a219f1083.png"/>



Tested Maps ( [AiArena](https://ai-arena.net/) ) : See `MapAnalyzer/pickle_game_info` for all tested maps.

# Getting Started

## Bot Authors

If you already have a [BurnySc2](https://github.com/BurnySc2/python-sc2/) development environment setup, you're likely
equipped with all the necessary dependencies Therefore, integrating MapAnalyzer into your existing bot is a
straightforward process requiring just a few simple steps.

If you're a new bot author, please set up a new [BurnySc2](https://github.com/BurnySc2/python-sc2/) bot development
environment before installing `MapAnalyzer`.

### Installation

1. Clone or download this repo
Expand All @@ -94,32 +96,55 @@ MyBot

3. MapAnalyzer relies on a pathing extension written in C, this can be built locally or downloaded from github actions.
If you're on a debian based OS you may be able to skip this step as the repo contains a linux binary already included
in the `MapAnalyzer` folder.

#### Method 1: Without build tools
in the `MapAnalyzer` folder. <br><br>
<b>Method 1: Without needing C++ build tools</b> <br><br>
Check the most recent [BuildCExtension](https://github.com/spudde123/SC2MapAnalysis/actions/workflows/build_c_extension.yml)
Github Action workflow. Then scroll to the bottom to download the artifact for your OS:

![c_workflow](https://github.com/spudde123/SC2MapAnalysis/assets/63355562/65e08208-8f82-44ee-bf84-3b79d1271d76)

Download the artifact and copy the binary to `MapAnalyzer/cext/`

#### Method 2: Build the project locally
<br>
Download the artifact and copy the binary to `MyBot/MapAnalyzer/cext/` <br><br>
<b>Method 2: Build the project locally</b><br>
If you're on Windows, make sure [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
are installed before proceeding, then:
- Install [Poetry](https://python-poetry.org/) for example: `pip install poetry`
- In the root folder of this repo run the following:
`poetry install`
<br><br>
If successful this will compile a binary in the build directory, for example:
`SC2MapAnalysis\build\lib.win-amd64-cpython-311\mapanalyzerext.cp311-win_amd64.pyd`
<br>
Copy this binary to `MyBot/MapAnalyzer/cext/mapanalyzerext.cp311-win_amd64.pyd`

4. In your bot initiate the `MapAnalyzer` module:
```python
from MapAnalyzer import MapData
from sc2.bot_ai import BotAI

If successful this will compile a binary in the root directory, for example `SC2MapAnalysis/mapanalyzerext.cp311-win_amd64`
class MyBot(BotAI):
map_data: MapData

async def on_start(self) -> None:
self.map_data = MapData(self)

async def on_step(self, iteration: int):
pass
```

Copy the binary to `MapAnalyzer/cext/`
5. Uploading to [AiArena](https://ai-arena.net/) and tournaments - <br>
No further setup is required, just include the `MapAnalyzer` folder in your bot zip.


## Contributors or to run examples

If you're interested in contributing or would like to run tests then the full dev environment should be setup:
1. Install [Poetry](https://python-poetry.org/) for example: `pip install poetry`
2. `poetry install --with dev`
3. Check example bot:
2. `poetry install --with dev` - This will install all development dependencies, build the C extension
and create a new environment.
Useful poetry environment commands: <br>
`poetry env list --full-path -` - Use this to configure your IDE to recognise the environment <br>
`poetry env remove <env_name>` <br>
`poetry shell`
3. Check your environment is working by running the example bot: <br>
`poetry run examples/MassReaper/run.py`

### Run tests
Expand All @@ -130,11 +155,11 @@ If you're interested in contributing or would like to run tests then the full de
### Autoformatters and linting
(github workflow to check these on PR)

`black .`
`poetry run black .`

`isort .`
`poetry run isort .`

`flake8 .`
`poetry run flake8 .`

### Contributing
To faciliatate automated releases, [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guideline should be followed.
Expand Down

0 comments on commit 23ba55d

Please sign in to comment.