Skip to content

WosberbonDesu/AI-T-rex-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI-T-rex-game

⭐ Self-playing artificial intelligence for T-rex game

These code blocks take data from the t-rex game and allow the artificial intelligence to play the game itself.

You need to train the model first for the training process you must run the train code then I will tell you step by step

Before this process, you need to run a code named data first to collect data, this will provide you with data that continuously records that area in a certain area.

After running the code, you need to switch to the game without wasting time You can open the game from this site http://www.trex-game.skipser.com/

The data will appear in the code block as you press the up and down key, you can also look here while playing.

Data saved with classes like right left up will diversify your data depending on how far you go in the game

In other words, the further you go in the game, the more different data you collect, which will give you a great advantage and your model will be better trained.

When you press the q key, the recording is interrupted, you can change it in the code block next to the waitkey module and do something according to your own

After collecting the data, your data will be saved in the folder with the codes, in this case, make sure that the data you collect is as equal as possible, delete it if necessary.

After collecting your data, you can start the training process.

You need to run the train code for the spinning process.You can increase the number of neural networks for a better training. I saw this enough because I could not progress much.

After the spinning process is completed, a file with h5 extension will be saved to the folder containing the codes.

In this case, when you switch to the code named play and run it, the model will start to play itself while the game is open.

I am installing the model I trained for you, if you want to use it, all you have to do is throw the file where the code is and run it by saying play.

The data you collect is recorded as in the example I left below.

down_420e3ffa-b45b-4644-ace1-a2074b6bb72c_107 down_420e3ffa-b45b-4644-ace1-a2074b6bb72c_108

forthebadge made-with-python

About

⭐ Self-playing artificial intelligence for T-rex game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages