Welcome to Eddie Zuma World, a colorful and challenging ball-shooting game! In this magical world, you’ll play as Eddie, a brave frog who uses his precise tongue-shooting skills to eliminate advancing colorful balls. Are you ready for the challenge? Let’s dive into Eddie’s vibrant world!
🎮 Game Features
🌀 Spiraling queue of colorful balls
🎯 360-degree rotating shooting system
🧠 Intelligent AI opponent
🔥 Dynamic difficulty adjustment
🏆 Real-time scoring system
🛠 Tech Stack
🐍 Python 3.x
🎨 Pygame - Game graphics and sound
🤖 PyTorch - AI model training
🔌 Socket - Network communication
🧵 Threading - Multi-threaded processing
🚀 Quick Start
Clone the repository:
https://gitlink.org.cn/eddie2001/ZumaWorld.git
Install dependencies:
pip install -r requirements.txt
Start the server:
python zuma.py
Launch the client:
python client.py
(Optional) Start the AI client:
python rl_client.py
🕹 Controls
⬅️ Left Arrow Key: Rotate Eddie counter-clockwise
➡️ Right Arrow Key: Rotate Eddie clockwise
🚀 Spacebar: Shoot a colored ball
🧠 AI Mode
Want to challenge yourself further? Try our AI mode! The AI uses deep reinforcement learning algorithms to autonomously learn and continuously improve its game skills. Launch rl_client.py to watch the AI in action or compete against it!
🧠 AI Logic
Our AI client (rl_client.py) uses Deep Q-Learning (DQN), a powerful reinforcement learning algorithm, to master Eddie Zuma World. Here’s a breakdown of the AI logic:
State Representation:
The game state is represented as a 7-dimensional vector, including:
Shooter angle (normalized)
Shooter color (encoded)
Number of balls on the field
Current score
Game over status
Current difficulty level
Path length
Action Space:
The AI can perform 3 actions:
Rotate left
Rotate right
Shoot
Neural Network:
A 3-layer fully connected neural network (DQN) is used to approximate the Q-function.
Input: 7-dimensional state vector
Hidden layers: 2 layers with 128 neurons each
Output: Q-values for each of the 3 possible actions
Exploration vs Exploitation:
Epsilon-greedy strategy is employed for action selection.
The AI starts with high exploration (epsilon = 1.0) and gradually shifts towards exploitation (epsilon_min = 0.01).
Experience Replay:
A replay buffer stores past experiences (state, action, reward, next_state, done).
The AI learns from random batches of these experiences, breaking correlations between consecutive samples.
Training Process:
The AI updates its policy every 4 steps.
It uses a separate target network, updated every 1000 steps, for more stable learning.
Reward Function:
Rewards are calculated based on:
Score increase
Reduction in the number of balls on the field
Penalty for game over
Continuous Learning:
The AI client runs in a loop, continuously playing games and updating its policy.
The model is saved periodically, allowing for persistent improvement over time.
This sophisticated AI system allows Eddie to learn and adapt to the game dynamics, continuously improving its performance and providing an ever-evolving challenge for human players!
🤝 Contributing
Issues and feature requests are welcome! If you’d like to contribute to Eddie Zuma World, please follow these steps:
Fork the repository
Create your feature branch (git checkout -b feature/AmazingFeature)
Commit your changes (git commit -m 'Add some AmazingFeature')
Push to the branch (git push origin feature/AmazingFeature)
Open a Pull Request
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
🙏 Acknowledgements
Special thanks to all the developers and players who have contributed to Eddie Zuma World. It’s because of you that Eddie’s world is so amazing!
Are you ready? Let’s join Eddie’s adventure and become the champion of the Zuma world! 🏆🐸
🐸 Eddie Zuma World 🌈
Welcome to Eddie Zuma World, a colorful and challenging ball-shooting game! In this magical world, you’ll play as Eddie, a brave frog who uses his precise tongue-shooting skills to eliminate advancing colorful balls. Are you ready for the challenge? Let’s dive into Eddie’s vibrant world!
🎮 Game Features
🛠 Tech Stack
🚀 Quick Start
Clone the repository:
Install dependencies:
Start the server:
Launch the client:
(Optional) Start the AI client:
🕹 Controls
🧠 AI Mode
Want to challenge yourself further? Try our AI mode! The AI uses deep reinforcement learning algorithms to autonomously learn and continuously improve its game skills. Launch
rl_client.py
to watch the AI in action or compete against it!🧠 AI Logic
Our AI client (
rl_client.py
) uses Deep Q-Learning (DQN), a powerful reinforcement learning algorithm, to master Eddie Zuma World. Here’s a breakdown of the AI logic:State Representation:
Action Space:
Neural Network:
Exploration vs Exploitation:
Experience Replay:
Training Process:
Reward Function:
Continuous Learning:
This sophisticated AI system allows Eddie to learn and adapt to the game dynamics, continuously improving its performance and providing an ever-evolving challenge for human players!
🤝 Contributing
Issues and feature requests are welcome! If you’d like to contribute to Eddie Zuma World, please follow these steps:
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
🙏 Acknowledgements
Special thanks to all the developers and players who have contributed to Eddie Zuma World. It’s because of you that Eddie’s world is so amazing!
Are you ready? Let’s join Eddie’s adventure and become the champion of the Zuma world! 🏆🐸