All Projects → opendilab → GoBigger

opendilab / GoBigger

Licence: Apache-2.0 license
Come & try Decision-Intelligence version of "Agar"! Gobigger could also help you with multi-agent decision intelligence study.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GoBigger

Rlenv.directory
Explore and find reinforcement learning environments in a list of 150+ open source environments.
Stars: ✭ 79 (-80.73%)
Mutual labels:  environment, gym
Fruit-API
A Universal Deep Reinforcement Learning Framework
Stars: ✭ 61 (-85.12%)
Mutual labels:  environment, multi-agent
Gym Sokoban
Sokoban environment for OpenAI Gym
Stars: ✭ 186 (-54.63%)
Mutual labels:  environment, gym
robotic-warehouse
Multi-Robot Warehouse (RWARE): A multi-agent reinforcement learning environment
Stars: ✭ 62 (-84.88%)
Mutual labels:  environment, multi-agent
Ma Gym
A collection of multi agent environments based on OpenAI gym.
Stars: ✭ 226 (-44.88%)
Mutual labels:  environment, gym
DI-star
An artificial intelligence platform for the StarCraft II with large-scale distributed training and grand-master agents.
Stars: ✭ 1,335 (+225.61%)
Mutual labels:  league
gismo
Gismo is a free Grasshopper plugin for GIS environmental analysis
Stars: ✭ 67 (-83.66%)
Mutual labels:  environment
jest-environment-selenium
Jest environment for running Selenium WebDriver tests
Stars: ✭ 28 (-93.17%)
Mutual labels:  environment
DQN
Deep-Q-Network reinforcement learning algorithm applied to a simple 2d-car-racing environment
Stars: ✭ 42 (-89.76%)
Mutual labels:  gym
EnvMapTooL
No description or website provided.
Stars: ✭ 25 (-93.9%)
Mutual labels:  environment
docker-environment
Flyve MDM Docker Environment
Stars: ✭ 49 (-88.05%)
Mutual labels:  environment
robotarium-rendezvous-RSSDOA
This repository contains the Matlab source codes (to use in Robotarium platform) of various rendezvous controllers for consensus control in a multi-agent / multi-robot system.
Stars: ✭ 35 (-91.46%)
Mutual labels:  multi-agent
tpl
Use go templates with simple and complex environment variables
Stars: ✭ 18 (-95.61%)
Mutual labels:  environment
seed-pixi-typescript
A pre installed environnement to work with pixi.js with webpack & typescript
Stars: ✭ 36 (-91.22%)
Mutual labels:  environment
freqtrade-gym
A customized gym environment for developing and comparing reinforcement learning algorithms in crypto trading.
Stars: ✭ 192 (-53.17%)
Mutual labels:  gym
kapten
Simple containerized development environments directly from the command line
Stars: ✭ 53 (-87.07%)
Mutual labels:  environment
lol-pick-ban-ui
Web-Based UI to display the league of legends champ select in esports tournaments.
Stars: ✭ 181 (-55.85%)
Mutual labels:  league
env-diff
Env-diff is a lightweight library which sync your .env files with .env.dist by composer scripts, hooks or manual running
Stars: ✭ 24 (-94.15%)
Mutual labels:  environment
envo
A community-driven ontology for the representation of environments
Stars: ✭ 106 (-74.15%)
Mutual labels:  environment
COVID-19-Resources
Resources for Covid-19
Stars: ✭ 25 (-93.9%)
Mutual labels:  gym

Go-Bigger: Multi-Agent Decision Intelligence Environment

PyPI Anaconda-Server Badge Read the Docs Read the Docs unit_test codecov

banner

GoBigger Doc (中文版)

Welcome to GoBigger v0.2!

GoBigger is an efficient and straightforward agar-like game engine and provides various interfaces for game AI development. The game is similar to Agar, a massive multiplayer online action game created by Brazilian developer Matheus Valadares. In GoBigger, players control one or more circular balls on a map. The goal is to gain as much size as possible by eating Food Balls and other balls smaller than the player's balls while avoiding larger ones that can eat the player's balls. Each player starts with one ball, and players can split a ball into two when it reaches a sufficient size, allowing them to control multiple balls.

We pay more attention to the following points:

  • Cooperation is more rewarding than playing alone.
  • Violent competition is easy to break out in a small area.
  • A scalable environment that enables the simulation of various teams and agents in each team.
  • Rich action space and partially observable observation space.
  • More detailed configuration for different kinds of mini-games.

Outline

Overview

GoBigger allows users to to interact with the multi-agent environment within the basic rules easily. Users can simply get the observation in the game and apply their operations for their agents through the given interface. GoBigger is built with simple rules and actions, though it has complicated observation spaces.

Basic Rules

To understand the rules in the game, GoBigger provides a few concepts as follows:

  • Match: GoBigger will allow several agents to join in a match. There are many different units in a match, such as food balls, thorns balls, spore balls and clone balls. When this match ends, each agent should gain more size by eating other balls to get a higher rank.
  • Agent: Each agent control a team, including several players. Teamwork is essential for an agent to play against other agents.
  • Player: Each player starts with one ball. To improve the operability of the game, GoBigger provides several operations for a player ball, including split and eject.
  • Ball: GoBigger provides 4 kinds of balls in a match.
    • Food Ball: Food balls are the neutral resources in the game. If a player ball eats a food ball, the food ball’s size will be parsed to the player ball.
    • Thorn Ball: If a player ball eats a thorns ball, the thorns ball’s size will be parsed to the player ball. But at the same time, the player ball will explode and split into several pieces (10 by default).
    • Spore Ball: Spore balls are ejected by the player balls.
    • Clone Ball: Clone balls are the balls you can control in the game. You can change its moving direction. In addition, it can eat other balls smaller than itself by covering others’ centers.

For more details, please refer to what-is-gobigger.

Observation Space

GoBigger also provides a wealth of observable information, and the observation space can be divided into two parts. Here is a brief description of the observation space. For more details, please refer to observation-space.

Global State

The global state provides information related to the whole match, such as the map size, the total time and the last time of the match, and the leaderboard with team name and score.

Player States

The player states should be like:

{
    player_id: {
        'rectangle': [left_top_x, left_top_y, right_bottom_x, right_bottom_y], # the vision's position in the map
        'overlap': {
            'food': [[position.x, position.y, radius, score], ...], 
            'thorns': [[position.x, position.y, radius, score, vel.x, vel.y], ...], 
            'spore': [[position.x, position.y, radius, score, vel.x, vel.y, owner], ...], 
            'clone': [[[position.x, position.y, radius, score, vel.x, vel.y, direction.x, direction.y, 
                        player_id, team_id], ...],
        }, # all balls' info in vision
        'team_name': team_name, # the team which this player belongs to 
        'score': player_score, # the score of the player
        'can_eject': bool, # if the player can do the `eject` action
        'can_split': bool, # if the player can do the `split` action
    },
    ...
}

Here GoBigger provides the player with all the balls' information in his vision.

Action Space

In fact, a ball can only move, eject and split in a match. Thus the action space simply includes:

  • Moving direction for the player balls.
  • Split: Players can split a ball into two when it reaches a sufficient size.
  • Eject: Player balls can eject spore in your moving direction.

More details in action-space.

Getting Start

Setup

We test GoBigger within the following system:

  • Centos 7.6
  • Windows 10
  • MacOS Catalina 10.15

And we recommend that your python version is 3.6.

Installation

You can simply install GoBigger from PyPI with the following command:

pip install gobigger

If you use Anaconda or Miniconda, you can install GoBigger through the following command:

conda install -c opendilab gobigger

You can also install the newest version through GitHub. First, get and download the official repository with the following command line.

git clone https://github.com/opendilab/GoBigger.git

Then you can install it from the source:

# install for use
# Note: use `--user` option to install the related packages in the user own directory(e.g.: ~/.local)
pip install . --user
     
# install for development(if you want to modify GoBigger)
pip install -e . --user

Usage

After installation, you can launch your game environment easily according the following code:

import random
from gobigger.envs import create_env

env = create_env('st_t2p2')
obs = env.reset()
for i in range(1000):
    actions = {0: [random.uniform(-1, 1), random.uniform(-1, 1), -1],
               1: [random.uniform(-1, 1), random.uniform(-1, 1), -1],
               2: [random.uniform(-1, 1), random.uniform(-1, 1), -1],
               3: [random.uniform(-1, 1), random.uniform(-1, 1), -1]}
    obs, rew, done, info = env.step(actions)
    print('[{}] leaderboard={}'.format(i, obs[0]['leaderboard']))
    if done:
        print('finish game!')
        break
env.close()

You will see output as follows. It shows the frame number and the leaderboard per frame.

[0] leaderboard={0: 3000, 1: 3100.0}
[1] leaderboard={0: 3000, 1: 3100.0}
[2] leaderboard={0: 3000, 1: 3100.0}
[3] leaderboard={0: 3000, 1: 3100.0}
[4] leaderboard={0: 3000, 1: 3100.0}
[5] leaderboard={0: 3000, 1: 3100.0}
[6] leaderboard={0: 3000, 1: 3100.0}
[7] leaderboard={0: 3000, 1: 3100.0}
[8] leaderboard={0: 3000, 1: 3100.0}
[9] leaderboard={0: 3000, 1: 3100.0}
[10] leaderboard={0: 3000, 1: 3100.0}
...

For more details, you can refer to gobigger_env.py.

Real-time Interaction with the Game

GoBigger allows users to play the game on their personal computers in real-time. Several modes are supported for users to explore this game.

Play with bot & Partial vision

If you want to play real-time game on your PC, you can launch a game with the following code:

python -m gobigger.bin.play --mode st --vision-type partial

In this mode, please use your mouse to control your balls to move, Q means to eject spore in your moving direction, W means to split your balls.

Play with bot & Full vision

You can launch a game with the following code:

python -m gobigger.bin.play --mode st --vision-type full

High-level Operations in GoBigger

Eject towards the center

Teamwork

Split and merge

Split and eat others

Resources

For more details, please refer to GoBigger Doc (中文版).

Join and Contribute

Welcome to OpenDI Lab GoBigger community! Scan the QR code and add us on Wechat:

QR code

Or you can contact us with slack or email ([email protected]).

License

GoBigger released under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].