Skip to content

Commit

Permalink
docs(readme): fix grammar, better descriptions of Observation
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
  • Loading branch information
jdujava committed Oct 6, 2024
1 parent 1aed393 commit 9b90e61
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Highlights:

> [!NOTE]
> This repository is based on the [generals.io](https://generals.io) game.
> Check it out, its a lot of fun !
> Check it out, it is a lot of fun!
## πŸ“¦ Installation
Stable release version is available through pip:
Expand Down Expand Up @@ -75,7 +75,7 @@ Creating your first agent is very simple.
- You can start by copying the [Usage Example](#usage-example--gymnasium) and replacing `agent` with your implementation.
- When creating an environment, you can choose out of two `render_modes`:
- `None` that omits rendering and is suitable for training,
- `"human"` where you can see the game roll out.
- `"human"` where you can see the game play out.

> [!TIP]
> Check out `Makefile` and run some examples to get a feel for the game πŸ€—.
Expand Down Expand Up @@ -161,28 +161,28 @@ An observation for one agent is a dictionary `{"observation": observation, "acti

The `observation` is a `Dict`. Values are either `numpy` matrices with shape `(N,M)`, or simple `int` constants:
| Key | Shape | Description |
| --- | --- | --- |
| `army` | `(N,M)` | Number of units in a cell regardless of owner |
| `general` | `(N,M)` | Mask of cells that are visible to the agent |
| `city` | `(N,M)` | Mask saying whether a city is in a cell |
| -------------------- | --------- | ---------------------------------------------------------------------------- |
| `army` | `(N,M)` | Number of units in a cell regardless of the owner |
| `general` | `(N,M)` | Mask indicating cells containing a general |
| `city` | `(N,M)` | Mask indicating cells containing a city |
| `visible_cells` | `(N,M)` | Mask indicating cells that are visible to the agent |
| `owned_cells` | `(N,M)` | Mask indicating cells controlled by the agent |
| `owned_cells` | `(N,M)` | Mask indicating cells owned by the agent |
| `opponent_cells` | `(N,M)` | Mask indicating cells owned by the opponent |
| `neutral_cells` | `(N,M)` | Mask indicating cells that are not owned by agents |
| `neutral_cells` | `(N,M)` | Mask indicating cells that are not owned by any agent |
| `structure` | `(N,M)` | Mask indicating whether cells contain cities or mountains, even out of FoV |
| `owned_land_count` | β€” | Number of cells an agent owns |
| `owned_army_count` | β€” | Total number of units of an agent over all cells |
| `owned_land_count` | β€” | Number of cells the agent owns |
| `owned_army_count` | β€” | Total number of units owned by the agent |
| `opponent_land_count`| β€” | Number of cells owned by the opponent |
| `opponent_army_count`| β€” | Int representing total number of units owned by the opponent |
| `is_winner` | β€” | Whether agent won |
| `timestep` | β€” | Timestep |
| `opponent_army_count`| β€” | Total number of units owned by the opponent |
| `is_winner` | β€” | Indicates whether the agent won |
| `timestep` | β€” | Current timestep of the game |

`action_mask` is a mask with shape `(N,M,4)` where value `[i,j,d]` says whether you can move from cell `[i,j]` in a direction `d`.

### ⚑ Action
Action is a `tuple(pass, cell, direction, split)`, where:
- `pass` indicates whether you want to `1 (pass)` or `0 (play)`.
- `cell` is an `np.array([i,j])` where `i,j` are indices of the cell you want to move from
- `cell` is a `np.array([i,j])` where `i,j` are indices of the cell you want to move from
- `direction` indicates whether you want to move `0 (up)`, `1 (down)`, `2 (left)`, or `3 (right)`
- `split` indicates whether you want to `1 (split)` units (send half of them) or `0 (no split)`, which sends all possible units to the next cell.

Expand Down

0 comments on commit 9b90e61

Please sign in to comment.