在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:GoBigger开源软件地址:https://gitee.com/opendilab/GoBigger开源软件介绍:Go-Bigger: Multi-Agent Decision Intelligence EnvironmentOngoing
GoBigger is a simple and efficient agar-like game engine and provides various interfaces for game AI development. The game is similar to Agar, which is a massively multiplayer online action game created by Brazilian developer Matheus Valadares. In GoBigger, players control one or more circular balls in 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 which can eat the player's balls. Each player starts with one ball, but players can split a ball into two when it reaches a sufficient size, allowing them to control multiple balls. Other OpenDILab Projects
IntroductionGoBigger allows users to interact with the multi-agent environment easily within the basic rules. Through the given interface, users can simply get the observation in game and apply their operations for their agents. Basic RulesIn order to understand the rules in the game, GoBigger provides a few concepts as following:
For more details, please refer to what-is-gobigger. Observation SpaceGoBigger also provide a wealth of observable information, and the observation space can be devided into two part. Here is the brief description of the observation space. For more details, please refer to observation-space. Global StateGlobal 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 within team name and score. Player StatePlayer state should be like: { player_name: { 'feature_layers': list(numpy.ndarray), # features of player '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], ...], 'thorns': [[position.x, position.y, radius], ...], 'spore': [[position.x, position.y, radius], ...], 'clone': [[[position.x, position.y, radius, player_name, team_name], ...], }, # all balls' info in vision 'team_name': team_name, # the team which this player belongs to }} We define that Since getting Action SpaceIn fact, a ball can only move, eject, split, and stop in a match, thus the action space simply includes:
More details in action-space. Getting StartedInstallationPrerequisitesWe test GoBigger within the following system:
And we recommend that your python version is 3.6. Get and install GoBiggerYou 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 with 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 from 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 Launch a game environmentAfter installation, you can launch your game environment easily according the following code: import randomfrom gobigger.server import Serverfrom gobigger.render import EnvRenderserver = Server()render = EnvRender(server.map_width, server.map_height)server.set_render(render)server.start()player_names = server.get_player_names_with_team()# get [[team1_player1, team1_player2], [team2_player1, team2_player2], ...]for i in range(10000): actions = {player_name: [random.uniform(-1, 1), random.uniform(-1, 1), -1] \ for team in player_names for player_name in team} if not server.step(actions): global_state, screen_data_players = server.obs() else: print('finish game!') breakserver.close() We also build a simple env following gym.Env. For more details, you can refer to gobigger_env.py. Real-time Interaction with gameGoBigger allow users to play game on their personal computer in real-time. Serveral modes are supported for users to explore this game. Single PlayerIf you want to play real-time game on your PC on your own, you can launch a game with the following code: python -m gobigger.bin.play --player-num 1 --vision-type full In this mode, Double PlayersIf you want to play real-time game on your PC with your friends, you can launch a game with the following code: python -m gobigger.bin.play --player-num 2 --vision-type full In this mode, player1 use Single Players with partial visionIf you want to play real-time game on your PC with only partial vision, you can launch a game with the following code: python -m gobigger.bin.play --player-num 1 --vision-type partial Your vision depends on all your balls’ positions and their size. Single Players against botsIf you want to play against a bot, you can launch a game with the following code: python -m gobigger.bin.play --vs-bot You can also add more bots in your game. Try to win the game with more bots! python -m gobigger.bin.play --vs-bot --team-num 4 bots test with VisualizationIf you want to test agent without human player, you can launch a game with the following code: python -m gobigger.bin.play --bot-only --player-num 3 --team-num 1 You can also test your custom agent with python -m gobigger.bin.play --bot-only --player-num 3 --team-num 4 --agent-class submit.bot_submission:BotSubmission Beware your agent class should implement High-level Operations in GoBiggerEject towards the centerSurround others by splittingEat food balls quicklyConcentrate sizeResourcesFor more details, please refer to GoBigger Doc (中文版). LicenseGoBigger released under the Apache 2.0 license. |
请发表评论