Download the PHP package gheb/tamagotchi without Composer
On this page you can find all versions of the php package gheb/tamagotchi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gheb/tamagotchi
More information about gheb/tamagotchi
Files in gheb/tamagotchi
Informations about the package tamagotchi
Tamagotchi
A colleague of mine once came with a fish at work. At first I thought, waow, I need one too ! And then I thought of every single day I won't be able to feed him :( This is when I decided as a side project to build a Tamagotchi Like project, and use an AI to decide what's to do next.
The tamagotchi has need such as hunger, sleepiness and sometimes wants to play. Each has an influence on it's health. If you do not take care of feeding him, put it to bed or play with it, the tamagotchi will eventually die faster.
Since my skills in animations/drawing are bellow zero, I used some free spritesheets.
I could have used tensorflow or phpml but I wanted to use this project to learn how it works. And this project is the result with the idea of reuse it later for other projects.
There is many things I would change, or not do the same way I did, but this is an experimental project. Maybe I'll code a better one later :)
The Front is designed to be displayed on a 800x480 raspberry screen but should works on any screen that respect the ratio.
Play
Clone the project or install it with composer:
This project comes with a docker file for the database. and a dev compose file with adminer to navigate through the db while debugging.
with adminer
then
and when you are done
If you do not use docker, clone this project. You'll need yarn, composer, mysql, php7.1. And then execute the commands:
Then you need to train the AI. I encourage you to read how NEAT (Neuro Evolution of Augmented Topology) Génetic Algorithm works. To create a bunch of population and let the neat-bundle evaluate each genome to learn, run:
It's an infinite loop that'll try it's best to evolve a neural network and smash the score !
In order to get the best genome and play it's network upon the inputs, run:
If you don't use docker, you can run a webserver and the websocket by using the start script.
you can now launch your navigator and open the http://localhost:8000
to run the all thing in the background you'll need supervisor
Create a configuration file for the program
Then you must tell supervisor to get and load this new config.
TROUBLESHOUTING
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
if you got this message when lauching supervisorctl
command,
update /etc/supervisor/supervisor.conf
and change the unix_http_server
chmod to 766
Todo
- Define the rythm to call a new evaluation and provide a way to use crontab or something else.
- for demonstration purposes, display a graph of the network.
All versions of tamagotchi with dependencies
doctrine/doctrine-bundle Version ^1.6
doctrine/doctrine-cache-bundle Version ^1.2
doctrine/doctrine-fixtures-bundle Version ^2.3
doctrine/orm Version ^2.5
gheb/neat-bundle Version ^1.0@dev
incenteev/composer-parameter-handler Version ^2.0
mybuilder/phpunit-accelerator Version ^1.1
sensio/distribution-bundle Version ^5.0
sensio/framework-extra-bundle Version ^3.0.2
stof/doctrine-extensions-bundle Version ^1.2
symfony/assetic-bundle Version ^2.8
symfony/monolog-bundle Version ^2.8
symfony/swiftmailer-bundle Version ^2.3
symfony/symfony Version 3.2.*