How analoganddigital/dqn_play_sekiro works
Based on both the file tree and README, this project is a specialized reinforcement learning (RL) system that uses Deep Q Networks (DQN) to let an agent play the game Sekiro. The system’s overall purpose is to use real-time game screen data to provide feedback (reward signals) while the DQN agent learns to play the game by interacting with it using simulated keystrokes.
Main Components
• Data Acquisition Module: Represent the “grabscreen.py” component which continuously captures the game’s screen. This is the entry point for visual data.
• Reward and State Processing: Include “find_blood_location.py” since this module processes the captured images to extract health bar positions and compute rewards that guide the learning process.
• Input Simulation Module: Show the “directkeys.py” and “getkeys.py” components that convert the DQN decisions into keystroke events to interact with the game.
• Game Management/Restart Module: “restart.py” is used to quickly restart the game (leveraging the game modifier) and ensure continuous training episodes.
• Legacy or Alternative Implementation: Optionally note “DQN_tensorflow_gpu.py” as an alternative implementation or historical reference to past supervised learning approaches.
Relationships and Data Flow
– One indicating the output decision (action) directed toward the Input Simulation module (“directkeys.py” and “getkeys.py”) which then provides simulated keystroke commands to the game.
– Another feedback loop that records the interaction outcomes (game state after an action) and updates the learning process.
• Finally, include a component for Game Restart (“restart.py”) that interfaces with the game environment to ensure minimal downtime, connecting back to the Screen Capture module for a new training episode.
Architectural Patterns and Design Principles
• Reinforcement Learning Loop: Illustrate the cyclical nature of the RL feedback loop (state capture → action decision → game simulation → reward determination → learning update).
• Integration with External Modifiers: Note that the system depends on a game modifier (specified in the README) to handle the game restart efficiently. Highlight this as an external dependency.
Technologies and Frameworks
• That the DQN training leverages GPU capabilities (as indicated by the “_gpu” suffix in most scripts) and it is built on Python with TensorFlow (or an alternative neural network framework, given the mention of AlexNet in the README).
• Although not explicitly shown in the file tree, include a note on the use of reinforcement learning principles, along with the AlexNet architecture for the visual component, which is part of the proposed system architecture.