snake-ai icon indicating copy to clipboard operation
snake-ai copied to clipboard

Migration to Gymnasium + bug fixes + QOL features

Open Moonflower2022 opened this issue 10 months ago • 0 comments

Changes

Fixed bug (random.sample doesnt work on sets) Migration to Gymnasium Changed name from SnakeEnv to SnakeEnvCNN and SnakeEnvMLP added win rewards for MLP made win detection better in snake_game.py added print variable to testing scripts to disable prints
Small QOL features:

  • Added option to disable sound but still render
  • updated default delays on testing scripts to make sure sound plays correctly
  • hamiltonian_agent.py checks if board_size is even
  • added support for different board sizes (for some reason the CNN observation shape has to be (84, 84, 3) and 4x4 doesn't work so it can only support board sizes that are factors of 84 greater than 4)
  • removed check for eating fruit and colliding at the same time because that cant happen
  • made tensor board logs specific to the model instead of just "PPO_{some number}"

Not sure how to get rid of the warnings that come up while training:

UserWarning: WARN: env.action_masks to get variables from other wrappers is deprecated and will be removed in v1.0, to get this variable you can do env.unwrapped.action_masks for environment variables or env.get_wrapper_attr('action_masks') that will search the reminding wrappers.

Moonflower2022 avatar Apr 02 '24 19:04 Moonflower2022