Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/programmingrainbow/yellow-snow-neural-network-c
Don't Eat the Yellow Snow! With a Neural Network AI.
https://github.com/programmingrainbow/yellow-snow-neural-network-c
Last synced: 4 days ago
JSON representation
Don't Eat the Yellow Snow! With a Neural Network AI.
- Host: GitHub
- URL: https://github.com/programmingrainbow/yellow-snow-neural-network-c
- Owner: ProgrammingRainbow
- Created: 2024-09-10T13:28:12.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-10T22:48:51.000Z (5 months ago)
- Last Synced: 2024-09-11T16:46:54.573Z (4 months ago)
- Language: C
- Size: 1.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Screenshot](screenshot.png)
# Yellow Snow - Neural Network (C - SDL2)
Earn points by collecting all the tasty white snow flakes that fall. But watch out for the yellow snow. The Neural Network can be loaded from a file if it exist, or a new random network will be created.When training finishes it will save the current top networks back into the neural-networks file. If ai_on is enabled the game will play but the neural-network will have the ablility to move the snowman. If ai_train is on the game will play without delay, with as many FPS as possible. If gfx_off is enabled then the game will not load a graphical window, or load SDL at all. It will play the game but you will not see it happening. This is much, much faster. If threads are used it will complete generations of training even faster. I was able to have it play 20 million games in 2.5 hours, using 16 threads on a laptop.# Build
To build the yellow-snow binary you will need all required build tools needed to compile via Makefile and gcc. You will also need SDL2 with image, ttf and mixer both the libraries and headerfiles.ArchLinux instructions.
```
sudo pacman -S --needed base-devel
sudo pacman -S --needed sdl2 sdl2_image sdl2_mixer sdl2_ttf
./yellow-snow
```
Command line switches. Some switches will turn others on or off. `--ai_train` will enable `--ai_on` and if `--threads` are set then so is `--gfx_off`.
```
--ai_on
--ai_train
--gfx_off
--threads {num}
--generations {num}
```# Controls
Left Arrow - Moves left.\
Right Arrow - Moves right.\
Space Bar - Resets the Game.\
Escape - Quits and closes game. \
F - Prints FPS to the console.