linyiLYi / snake-ai

An AI agent that beats the classic game "Snake".
Apache License 2.0
1.59k stars 352 forks source link

Migration to Gymnasium + bug fixes + QOL features #34

Open Moonflower2022 opened 5 months ago

Moonflower2022 commented 5 months ago

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:

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.