Skip to content

GerTheMessiah/Bachelor-Snake-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snake Machine Learning Implementation

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

  • Raytracing 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

The current built was inspired by:
Phil Tabor: Phil Tabor - Repository
Nikhil Barhate: nikhilbarhate99 - Repository

References

License

GPLv3 (General Public License 3)

Results

Dependencies

Libraries           | Functions
-----------------------------------------------
...                 | ...
python 3.7          | Python version
gym 0.21.0          | Game setup
pygame 2.0.2        | Game gui
numpy 1.21.2        | Creating observations
Pytorch 1.9.1 cuda  | Machine Learning API
scipy 1.7.1         | Linear regression
matplotlib 3.4.3    | Result plots
pandas 1.3.3        | Hadling the generated data
pathlib 1.0.1       | Hadling the paths

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published