opendilab / GoBigger

[ICLR 2023] Come & try Decision-Intelligence version of "Agar"! Gobigger could also help you with multi-agent decision intelligence study.
https://gobigger.readthedocs.io/en/latest/
Apache License 2.0
460 stars 34 forks source link

Why team num >= 7 is not allowed in Real-time Interaction mode? #21

Closed SimZhou closed 2 years ago

SimZhou commented 2 years ago

Hey, I set --team-num 7 and it give me the following error:

Traceback (most recent call last):
  File "/home/zhou/miniconda3/envs/gobigger/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/zhou/miniconda3/envs/gobigger/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/zhou/miniconda3/envs/gobigger/lib/python3.6/site-packages/gobigger/bin/play.py", line 311, in <module>
    play_control_by_keyboard_vs_bot(team_num=args.team_num)
  File "/home/zhou/miniconda3/envs/gobigger/lib/python3.6/site-packages/gobigger/bin/play.py", line 289, in play_control_by_keyboard_vs_bot
    render.fill(server, direction=None, fps=fps_real, last_time=server.last_time)
  File "/home/zhou/miniconda3/envs/gobigger/lib/python3.6/site-packages/gobigger/render/realtime_render.py", line 33, in fill
    player_num_per_team=1)
  File "/home/zhou/miniconda3/envs/gobigger/lib/python3.6/site-packages/gobigger/render/env_render.py", line 314, in render_all_balls_colorful
    pygame.draw.circle(screen, PLAYER_COLORS[int(ball.team_name)][0], ball.position, ball.radius)
IndexError: list index out of range

and it works fine with team num smaller than 7, what's wrong?

SimZhou commented 2 years ago

BTW I am using gobigger ver 0.1.3:

Name: gobigger Version: 0.1.3 Summary: Go-Bigger: Multi-Agent Decision Intelligence Environment Home-page: UNKNOWN Author: OpenDILab Author-email: UNKNOWN License: Apache License, Version 2.0 Location: /home/zhou/miniconda3/envs/gobigger/lib/python3.6/site-packages Requires: opencv-python, easydict, gym, pygame, numpy, pytest Required-by:

SimZhou commented 2 years ago

and my python ver is:

Python 3.6.13 :: Anaconda, Inc.

mingzhang96 commented 2 years ago

Thanks for your issue.

In GoBigger, we apply color for different teams and unfortunately we only define 6 kinds of color here. We will add more colors to avoid this issue in the following version.

mingzhang96 commented 2 years ago

@SimZhou hi, we add more colors for up to 16 team in the game. You can check more details here.