glmcdona / LuxPythonEnvGym

Matching python environment code for Lux AI 2021 Kaggle competition, and a gym interface for RL models.
MIT License
73 stars 38 forks source link

Improve random map generation speed in training. #78

Closed glmcdona closed 2 years ago

glmcdona commented 2 years ago

Use python random number generator when a seed is not specified. In this case, matching the exact same results per seed is not needed and increases training speed. Resolves #77. Also shallow copy config just in case.

StoneT2000 commented 2 years ago

is the seedgen that slow? I guess other thing is just comment that if you don't need to use the online visualizer, this is okay.

royerk commented 2 years ago

Yes, the drop in fps (steps per second) is significant and there is no need to visualize when training (not with the online one at least).

glmcdona commented 2 years ago

Seconding @royerk, it does make it slower by quite a bit. Here is the game run speed unit test with/without seed specified:

.Testing game simulation speed
Simple empty game: 1.663 seconds per full game.
.Testing game simulation speed with no seed
Simple empty game: 0.084 seconds per full game.

So it seems to take ~1.5 seconds to generate and parse the 1M random numbers.