Skip to content

Short own implementation of the game snake. In this project I'am using the ray library together with ray tune and a custom PPO model.

Notifications You must be signed in to change notification settings

GerTheMessiah/Snake-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PPO - Reinforcement Learning

Snake-AI

forthebadge

Project SonarCloud License: GPL v3 Build Status Version Contributors

obs

Visual observation

  • Visual observation. The AI is observing a 13x13 space around this head. Six on the left and right site and the Head in the middle.

Static observation

  • Ray tracing along the yellow dashed lines. The AI is able to see himself, walls and the apple.
  • Direction (red line) of the snake.
  • apple (blue point) and tail compass. Indicates the relativ position according to the apple or the last part of the snake.
  • step counter. If the snake doesn't eat an apple in a descried amount of steps the game ends.

+100 if the snake reaches the max length. | win

+2.5 if snake eats an apple.

-10 if the snake dies. | loss

  • Implementation with ray tune.

License

GPLv3 (General Public License 3)

Results

0

Dependencies

Install packages: pip install -r requirements.txt
Be careful with pytorch dependencies. They often might not work with. If so, install on your own.

About

Short own implementation of the game snake. In this project I'am using the ray library together with ray tune and a custom PPO model.

Topics

Resources

Stars

Watchers

Forks

Languages