How oakwarrior/deathandtaxes works
Main Project Type and Purpose
• Project Type: Unity game.
• Purpose: DeathAndTaxes is a game released on Steam. Although the code isn’t “perfect,” it’s released open source to serve as a learning resource and inspiration for other developers.
• Key Features: Integration with art assets, narrative content generation (via Articy), a variety of game systems (Core, Desktop, Dialogue, Elevator, Shop, UI, etc.), and support for external libraries like TwitchLib for additional functionality.
File Structure to Define Components
• Assets Folder: Contains everything “Unity” related.
• ArticyContent & ArticyImporter: These directories include generated scripts and settings for narrative management coming from articy:draft. They form the narrative data layer that feeds into in-game dialogue, conditions, and events.
• Gizmos and Plugins: These include visual aids, editor utilities, and third-party libraries (such as TwitchLib licensing information) used by the game.
• _Scripts Directory: This is the core of the game’s functionality and is further subdivided into modules:
▫ Core: Contains core managers (GameManager, AudioManager, ProfileManager, SaveManager, etc.).
▫ UI: Handles all user interface elements (DialogueScreen, HUDManager, SpeechBubble, etc.).
▫ Desktop: Manages desktop interactions and objects that appear in that section (with subfolders for objects like Bed, Mirror, etc.).
▫ Dialogue: Contains dialogue management (DialogueManager and related components).
▫ Elevator: Contains components for elevator interactions, notifications, and scene management.
▫ Comic, Shop, Particles, Util, and Bedroom: All specialized modules each responsible for a part of the game’s logic (comic panels presentation, in-game shopping, particle effects, utility functions, and bedroom interactions).
• Other Directories: Packages and ProjectSettings house Unity configuration and dependency info.
• Base Layer – Unity Engine:
• Unity game engine, which acts as the container running the game.
• Narrative & Content Generation:
• ArticyContent and ArticyImporter components, which:
▫ Provide auto-generated scripts (like Dialogue, GlobalVariables, etc.).
▫ Feed narrative data and branching logic into the game.
▫ Communicate with Core and Dialogue modules.
• Core Game Management:
• Core module inside _Scripts (GameManager, AudioManager, SaveManager, etc.) acts as the backbone.
• Gameplay Systems Modules:
• Desktop, Elevator, Bedroom, and Comic: Each module represents distinct game scenes or interactive environments.
▫ Emphasize integration with external input management (InputManager in Core), which aggregates user input.
• Presentation and User Interface:
• UI folder components (DialogueScreen, HUDManager, SpeechBubble, etc.) represent the game’s visual feedback.
▫ Connect these components with both the Core and individual gameplay modules (e.g., Desktop, Elevator) to display game state and interactions.
• External Libraries and Plugins:
• Utility and Helper Systems:
• Util and the various Editor/Gizmos assets: These underpin debugging, editor visualization, and general helper functions.
▫ They support development and are linked to multiple modules, especially during runtime diagnostics.
Architectural Principles and Patterns
• Separation of Concerns: The project clearly separates gameplay elements (Desktop, Elevator, Comic, etc.) from core systems and narrative handling.
• Modularization: Each subfolder in _Scripts groups related functionality, making it easier to replace or extend modules.
• Data Flow: Data flows from narrative content (ArticyContent) to game logic (Core, Dialogue) and out to the UI.
• External Dependencies: Note the integration with TwitchLib for network-based or streaming functionalities.
Recommended Elements
• Use clear labels for each component. For example:
▫ “Unity Engine / Runtime”
▫ “Core Managers (GameManager, AudioManager, etc.)”
▫ “Articy Content & Importer (Narrative Generator)”
▫ “Gameplay Modules: Desktop, Elevator, Bedroom, Comic, Shop”
▫ “UI Components”
▫ “External Plugins (TwitchLib, etc.)”
▫ Data flow from narrative content to game logic.
▫ Interactions between core managers and gameplay modules.
▫ UI updates triggered by gameplay events.
▫ Each module from the _Scripts folder should be a component.
▫ The relationship between the generated code (Articy content) and the core gameplay systems should be explicitly drawn.