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
461 stars 34 forks source link

Speed up dev #15

Closed mingzhang96 closed 3 years ago

mingzhang96 commented 3 years ago

Content

  1. Add filters before EnvRender.get_overlap() to reduce the num of balls to detect.
  2. Decrease state_tick_per_second when doing training, because we don't need so many state tick to perform the game well.
  3. Optimize PrecisionCollisionDetection in utils/collision_detection.py to get faster.
  4. Update related doc.

Performance

The settings of the game is as following:

team_num=4,
player_num_per_team=3,
map_width=1000,
map_height=1000,
match_time=60*10,
state_tick_per_second=10, # frame
action_tick_per_second=5,
save_video=False,
obs_settings=dict(
    with_spatial=False,
    with_speed=False,
    with_all_vision=False,
),
In our testing machine(AMD EPYC 7742 64-Core Processor), we get the following testing results: item cost time (ms)
server.step() 7
server.obs() 4

As the state of game is unstable, there may be somewhat fluctuating.

codecov[bot] commented 3 years ago

Codecov Report

Merging #15 (c92d165) into main (5b08903) will increase coverage by 0.77%. The diff coverage is 98.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
+ Coverage   93.37%   94.14%   +0.77%     
==========================================
  Files          55       55              
  Lines        3379     3398      +19     
==========================================
+ Hits         3155     3199      +44     
+ Misses        224      199      -25     
Flag Coverage Δ
unittests 94.14% <98.97%> (+0.77%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gobigger/server/server_default_config.py 100.00% <ø> (ø)
gobigger/render/env_render.py 85.19% <98.71%> (+9.46%) :arrow_up:
gobigger/utils/collision_detection.py 98.00% <100.00%> (-0.24%) :arrow_down:
gobigger/agents/bot_agent.py 78.94% <0.00%> (-0.59%) :arrow_down:
gobigger/server/server.py 72.41% <0.00%> (+2.15%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5b08903...c92d165. Read the comment docs.