Refactor project structure and implement Rock-Paper-Scissors AI#4
Open
JoshiMinh wants to merge 22 commits into
Open
Refactor project structure and implement Rock-Paper-Scissors AI#4JoshiMinh wants to merge 22 commits into
JoshiMinh wants to merge 22 commits into
Conversation
test
…ing assets, updating model paths, and adding `requirements.txt`.
…Paper-Scissors AI - Implemented the main game loop in `main.py` to handle player creation, AI inference, and collision detection. - Added audio and visual assets for player actions. - Created a training script in `train.py` for the RPS agent using reinforcement learning. - Defined state representation, reward function, and action selection for the agent. - Integrated experience replay and target network for stable training. - Saved the trained model to a specified path after training completion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor and modernization of the LivingRPS project, transforming it from a basic Pygame simulation into an AI-powered Rock-Paper-Scissors environment where each entity is a DQN agent. The codebase is restructured for modularity, maintainability, and AI integration, with improved documentation and user experience.
Key changes include:
1. Major Game Refactor & AI Integration
main.pywith a newsrc/main.pythat uses a neural network (RPSAgentNet) to control agent behavior via deep Q-learning, including state feature extraction and action application for each agent. The game loop is now modular, uses a more robust collision system, and integrates audio/visual assets. [1] [2]src/model.pydefining theRPSAgentNetPyTorch neural network architecture for agent decision-making.src/mover.pyclass, supporting state representation, action application, and physics updates for AI-driven movement and interaction. [1] [2]2. Project Structure & User Experience Improvements
run.batCLI menu for Windows users to install dependencies, train the model, or launch the game, streamlining setup and execution.README.mdwith usage instructions, requirements, and preview images for better onboarding and clarity.Summary of most important changes:
Game logic & AI integration
src/main.pyto use DQN agents, modular functions, and improved event handling. [1] [2]src/model.pywith theRPSAgentNetneural network for agent decision-making.Moverclass insrc/mover.py, supporting AI state/action and physics. [1] [2]Project usability & documentation
run.batCLI menu for running, training, and installing the project on Windows.README.mdwith project description, setup instructions, and visual assets.