How tazdraperm/poe2autosplit works
Project Type and Purpose
Poe2AutoSplit is a LiveSplit component designed to enable auto-splitting functionality for the game Path of Exile 2. Its primary purpose is to automate the splitting process during gameplay, enhancing the live streaming and speedrunning experience by interfacing directly with LiveSplit.
Key Indicators:
• Project Type: LiveSplit component (plugin/extension)
• Purpose: Auto-splitting for Path of Exile 2 to automate splits based on in-game events.
File Structure
Top-Level Directories and Files:
• .gitattributes & .gitignore: Configure Git behavior.
• Poe2AutoSplit.sln & Poe2AutoSplit.csproj: Solution and project files for a C# application using .NET.
• Poe2AutoSplit/Component: Contains the core components of the application.
• AutoSplitter: Handles splitting logic based on game events.
• AreaEvent.cs, BossEvent.cs, SplitEvent.cs, Splitter.cs: Manage different types of events and the splitting mechanism.
• ClientLog: Manages log reading from the game's client.
• LogReader.cs: Reads and parses the Client.txt log file.
• UI: Manages the settings and user interface.
• Settings.Designer.cs, Settings.cs, Settings.resx: Define and manage UI components for configuration.
• Poe2AutoSplitComponent.cs & Poe2AutoSplitComponentFactory.cs: Integrate the component with LiveSplit.
• Properties/AssemblyInfo.cs: Contains assembly metadata.
Architectural Patterns and Choices:
• Modular Architecture: Separation into components like AutoSplitter, ClientLog, and UI.
• Event-Driven Design: Utilizes events (e.g., SplitEvent) to trigger actions.
• Factory Pattern: Implemented via Poe2AutoSplitComponentFactory for creating component instances.
Configuration and Build:
• .csproj & .sln Files: Indicate a C# project managed with Visual Studio.
• AssemblyInfo.cs: Manages assembly-level attributes and metadata.
README for Additional Insights
Architecture and Dependencies:
• Integration with LiveSplit: Acts as a plugin/component within LiveSplit.
• Log File Monitoring: Reads the Client.txt log file from Path of Exile 2 to detect in-game events.
• UI for Configuration: Provides a settings interface to customize splitting behavior.
Key Features:
• Automatic Splits: Based on area and boss events.
• Settings Customization: Users can select specific areas and bosses to trigger splits.
• Split Generation: Option to automatically generate splits based on user selections.
a. Identify the Main Components:
LiveSplit Integration
• Poe2AutoSplitComponent: Main plugin component for LiveSplit.
• Poe2AutoSplitComponentFactory: Factory for creating component instances.
AutoSplitter Module
• Splitter: Core logic for determining when to split.
• Event Handlers:
• AreaEvent
• BossEvent
• SplitEvent
Client Log Module
• LogReader: Reads and parses the Client.txt log file to detect game events.
User Interface (UI)
• Settings Interface: Allows users to configure which areas and bosses trigger splits.
External Systems
• Path of Exile 2 Game: Generates log entries that are read by LogReader.
• LiveSplit Application: Hosts and interacts with the Poe2AutoSplit component.
b. Determine Relationships and Interactions:
• LiveSplit loads Poe2AutoSplitComponent via Poe2AutoSplitComponentFactory.
• Poe2AutoSplitComponent initializes the AutoSplitter and UI modules.
• LogReader continuously monitors Client.txt from Path of Exile 2.
• Detected events from LogReader are passed to AutoSplitter.
• AutoSplitter processes events via Event Handlers (AreaEvent, BossEvent) and triggers SplitEvent.
• SplitEvent communicates with LiveSplit to perform the actual split.
• UI allows users to configure settings, which influence AutoSplitter behavior.
c. Highlight Architectural Patterns and Design Principles:
• Modularity: Clear separation of concerns among LiveSplit integration, AutoSplitter logic, log reading, and UI.
• Event-Driven Architecture: Utilizes events to decouple event detection from split execution.
• Factory Pattern: Simplifies component instantiation and enhances scalability.
• Single Responsibility Principle: Each class/module has a distinct responsibility.
d. Include Relevant Technologies and Frameworks:
• Programming Language: C# (.NET Framework)
• Development Environment: Visual Studio (implied by .sln and .csproj files)
• LiveSplit API: For integrating the component into the LiveSplit application.
• UI Framework: Likely Windows Forms or WPF for the settings interface.
Elements
• Clear Labels for Each Component:
• How LogReader sends data to AutoSplitter.
• AutoSplitter communicating with LiveSplit.
• User interactions with the UI Settings affecting AutoSplitter.
• Integration Components: e.g., LiveSplit elements in blue.
• Core Logic: e.g., AutoSplitter in green.
• UI Elements: e.g., Settings interface in orange.
• External Systems: e.g., Path of Exile 2 and LiveSplit in grey.
Detail and Essential Architectural Elements
• Modular Breakdown: Ensure each component and its sub-components (e.g., within AutoSplitter) are individually represented.
• Technology Stack: Highlight key technologies like C#/.NET and LiveSplit API connections.
• Event Handling: Clearly show the flow from log detection to event triggering to split execution.
LiveSplit Integration Layer
• Poe2AutoSplitComponent
• Poe2AutoSplitComponentFactory
Core AutoSplitter Module
• Splitter
• AreaEvent
• BossEvent
• SplitEvent
Client Log Module
• LogReader
User Interface Layer
• Settings Interface
External Systems
• Path of Exile 2 (generating Client.txt log)
• LiveSplit Application
Interactions:
• LogReader → Splitter (from Client.txt)
• Splitter triggers SplitEvent → LiveSplit performs split
• UI Settings → Splitter (configures which events to listen to)
Visual Representation Tips:
• Use rectangles for components.
• Related components within larger sections or containers.