How babyhamsta/aimmy works
Project Type and Purpose
• Aimmy is a Windows application built with C# using .NET 8 and WPF. It is an AI-based aim alignment mechanism that leverages DirectML, ONNX, and YOLOv8 to assist gamers, particularly those facing physical or visual challenges.
• Its purpose is to provide real-time player detection and adjust the user's mouse position based on AI recognition, plus additional functionalities like configurable anti-recoil, ESP (visual highlighting), and model switching.
• The project also integrates support for training and contributing new AI models.
Analyzing the File Structure
• The top-level has the solution file (AimmyWPF.sln) and the main project folder (AimmyWPF) which contains most of the application code.
– Application configuration files (App.config, App.xaml, etc.) that establish the WPF application.
– A collection of C# source files representing models, UI components, animation controllers, and managers (e.g., AIModel.cs, PredictionManager.cs, InputBindingManager.cs, etc.).
– Directories such as “UserController”, “SecondaryWindows”, and “Visualization” that indicate distinct UI modules and components.
• There are additional folders for external resources:
– “configs” for different game configuration files.
– “models” and “Universalv3_web_model” holding ONNX models and binary shards, which support the AI detection mechanism.
• Other assets include fonts, FodyWeavers configuration (indicating use of weaving for aspects), and GitHub CI/CD files.
Using README for Architectural Details
• The README clearly explains the overall workflow – from screen grabbing to using YOLOv8 (via DirectML and ONNX) for detection, decisions based on adjustments, and finally triggering the mouse cursor update.
• It mentions the UI’s features (full-fledged UI, customization menus, model store) and clarifies the integration of gameplay adjustability.
a. Main Components:
• User Interface (WPF front-end): Consisting of main windows (MainWindow.xaml, OverlayWindow.xaml), secondary UI modules (under SecondaryWindows and UserController), and visualization components.
• Core AI Processing: The detection module which utilizes DirectML, ONNX, and YOLOv8 (AIModel.cs, PredictionManager.cs).
• Input/Output Management: Screen grabbing functionality, InputBindingManager.cs, and the “triggering functionality” that reads game events to capture screen data.
• Decision Engine: Logic for processing AI outputs with additional adjustments (e.g., anti-recoil, FOV, X+Y adjustments) contained in components like RequirementsManager.cs and PredictionManager.cs.
• Config & Models Management: Handling of configuration files (from the “configs” folder) and model selection/caching (using folders “models” and “Universalv3_web_model”).
• External Services: Integration points for model downloading and community contributions (described in the README regarding pull requests and downloadable models).
b. Out Relationships and Interactions:
• Data flow should be shown from the game system to the screenshot capture module.
• This image data is then passed to the AI recognition module (illustrated with components like YOLOv8 detection).
• Detection results feed into the decision engine where adjustments (FOV, X+Y corrections) are applied.
• The final computed output controls the movement of the mouse cursor.
• The UI layer constantly feeds user-defined settings and customizations into the decision engine.
• The configuration management subsystem should be depicted as a repository that supplies models and game-specific configurations.
c. Important Architectural Patterns/Design Principles:
• Separation of Concerns:
– Present UI versus business logic (detection, decision making) versus configuration management.
• Modularity:
– Group different UI components into modules (windows and controllers) and clearly separate the AI model management.
• Extensibility:
– The design supports hot-swappable models and configurations, so include a component for “Model & Config Store” that interfaces with remote repositories.
d. Relevant Technologies:
• .NET (C#) and WPF for the user interface.
• DirectML, ONNX, and YOLOv8 as the core AI libraries.
• Use of Fody for aspect-oriented enhancements.
• Integration of external resources (game configuration files and downloadable models).