Skip to main content

Gym-compatible environments that replicate the aigar.io game to a certain extent.

Project description

Gym env that replicates agar.io

Image showing the current player losing against a greedy bot

How to install:

cd to this repo. Then run:

pip install -e .

Or simply:

pip install aigar

How to use:

Simply import aigar and import gym. The following easy environments are available:

  1. "AigarPellet-v0" - You control a single cell. The goal is to collect as many pellets as quickly as possible.
  2. "AigarGreedy1-v0" - You control a single cell. There is another cell controlled by a simple greedy heuristic. Collect as many pellets as quickly as possible and eat the opponent as often as you can.

There are many more options available by following the naming scheme: "Aigar[Pellet|Greedy[1|2|5]][Grid][Split][Eject]-v0" The number behind "Greedy" determines the number of greedy bots. If "Grid" is used a simplified lower dimensional observation space will be used (not based on pixels). If "Split" is used the player cell can split itself, just as in agar.io. If "Eject" is used the player cell can eject some mass, just as in agar.io.

Observation Space:

By default, the observation space will be an rgb image of size (900, 900, 3).

If the "Grid" option is used an easier version of the obs space will be used, e.g. in "AigarPelletGrid-v0". In this easier version the obs space is either (11, 11, 3) in the "Pellet" options or (11, 11, 4) in the "Greedy" options. The first two dimensions determine the size of the grid and the last dimension the number of grids. The first grid determines the pellet mass per grid cell, the second grid is the combined mass of every cell of the player that is at least partially in a grid cell and the third grid determine the playing field boundary, every grid receives a floating value between 0 and 1 depending on how much of it is outside of the playing field. The additional grid in the Greedy version determines the combined mass of every opponent cell (no matter which opponent) that is at least partially in that grid cell. One cell of the player or opponent can thus count for multiple cells.

Action Space:

The action space in this version consists out of two dimensions: the x and y location of the cursor. It is limited to a range of 0-1, mapping the whole possible space of possitions of the cursor.

If the "Split" option is used, the action space increases by one. The additional continuous action determines the split action: a value above 0.5 means the player cells will split, otherwise not.

The "Eject" option has the same effect as the "Split" option, but for ejecting. This option is not selectable if "Split" is not selected, e.g. there is not "AigarPelletEject-v0", only an "AigarPelletSplitEject-v0".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aigar-0.0.1.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

aigar-0.0.1-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file aigar-0.0.1.tar.gz.

File metadata

  • Download URL: aigar-0.0.1.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for aigar-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d90782ae3a95b2033ea34ffd6aa793398c9a586093d9a112707c863df27b09b5
MD5 7e2e6b3e7090f5417899c4ae81c6e094
BLAKE2b-256 fbc63c7758406b89690b327f692f591c5d46fc32f893d572ee631e4cc7f871d2

See more details on using hashes here.

Provenance

File details

Details for the file aigar-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: aigar-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.6

File hashes

Hashes for aigar-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bcb61afc295c93863253973dab02cb809002052d49ac641d4e07e3f3e6cbf387
MD5 157c3e86616fb05b0a38d8d46a8a581b
BLAKE2b-256 3d42fb5e42a13672c4b1ac961cf92167bd67b469b72a56f2c6fc3580dabf855e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page