https://github.com/mansurpro/dinomindevolution
This project uses neural evolution to train a neural network to play the Google Chrome Dinosaur Game autonomously.
https://github.com/mansurpro/dinomindevolution
ai algorithms dinosaur-game game neat-algorithm neat-python neural-networks pygame python3
Last synced: 9 months ago
JSON representation
This project uses neural evolution to train a neural network to play the Google Chrome Dinosaur Game autonomously.
- Host: GitHub
- URL: https://github.com/mansurpro/dinomindevolution
- Owner: MansurPro
- License: mit
- Created: 2024-11-30T20:37:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-01T00:16:51.000Z (about 1 year ago)
- Last Synced: 2025-03-27T12:14:31.409Z (9 months ago)
- Topics: ai, algorithms, dinosaur-game, game, neat-algorithm, neat-python, neural-networks, pygame, python3
- Language: Python
- Homepage:
- Size: 853 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🦖 Dino AI Game
**A thrilling AI-powered game where dinos evolve to dodge obstacles and reach high scores!**
Built with **Python**, **Pygame**, and **NEAT**, this project is a showcase of NeuroEvolution in action.

---
## 🚀 Features
✨ **AI Evolution:** Watch dinos learn and improve with each generation.
🎨 **Customizable Skins:** Choose from a variety of dino skins.
🌵 **Dynamic Obstacles:** Randomly generated cacti with increasing difficulty.
📈 **Score Tracking:** Real-time score display with generation stats.
🧠 **Neural Networks:** Powered by NEAT to create intelligent dino players.
---
## 🛠️ Prerequisites
Ensure you have the following installed before starting:
- **Python 3.8 or higher**
- **Pygame library**
- **NEAT-Python library**
---
## 📥 Installation
1. Clone the repository:
```bash
git clone https://github.com/MansurPro/DinoMindEvolution.git
cd DinoMindEvolution
```
2. Install dependencies:
```bash
pip install pygame neat-python
```
3. Place sprite assets in the `sprites/` directory:
- `sprites/dino/`
- `sprites/cactus/`
- `sprites/road.png`
---
## 🎮 How to Play
1. Run the game:
```bash
python main.py
```
2. Sit back and watch the AI dinos evolve to avoid obstacles.
3. Play the game
```bash
python dino_game.py
```
---
## ⚙️ Configuration
The AI configuration is defined in `config-feedforward.txt`. Modify parameters to customize the AI behavior.
Example:
```txt
[NEAT]
fitness_criterion = max
pop_size = 20
fitness_threshold = 10000
```
💡 *Tip: Adjust `pop_size` and `fitness_threshold` to balance performance and complexity.*
---
## 🖼️ Screenshots
### Main Game

### Neural Network in Action

---
## 🧠 How It Works
1. **Initialization:**
- Creates a population of dinos, each controlled by a neural network.
2. **Gameplay Loop:**
- Dinos dodge cacti by learning to jump.
- Fitness scores improve with survival and penalize unnecessary jumps.
3. **Evolution:**
- NEAT evolves the neural networks, refining dino behavior across generations.
---
## 🔮 Future Enhancements
- 🎵 Add sound effects and background music.
- 🏆 Create a leaderboard for players.
- 🔍 Visualize neural networks in real time.
- 🌌 Introduce dynamic backgrounds and weather effects.
---
## 📝 License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
---
## 💬 Contact
👤 **Your Name**
📧 Email: [mansurbek1203@gmail.com](mailto:mansurbek1203@gmail.com)
🌐 GitHub: [@MansurPro](https://github.com/MansurPro)