Skip to main content

Project Structure & Architecture

Understanding the file structure is crucial for maintaining a clean project lifecycle, ensuring safe upgrades, and managing version control effectively.

The Game Event System adheres to a strict "Logic vs. Data" Separation Principle. This architecture ensures that updating the plugin (Core Logic) never overwrites your created events, graphs, or generated code (User Data).


πŸ“‚ The Directory Tree​

Below is the standard hierarchy. We use distinct icons to indicate the nature of each folder:

  • πŸ›‘οΈ Immutable Core: Never modify, move, or rename.
  • πŸ’Ύ Mutable Data: Your project data. Safe to commit, safe to modify.
  • πŸ—‘οΈ Disposable: Safe to delete for optimization.
Assets/
β”œβ”€β”€ πŸ“ TinyGiants/ # [CORE LOGIC] The immutable plugin root
β”‚ └── πŸ“ GameEventSystem/
β”‚ β”œβ”€β”€ πŸ“ API/ # πŸ›‘οΈ Interfaces & Public APIs
β”‚ β”œβ”€β”€ πŸ“ Demo/ # πŸ—‘οΈ Example Scenes & Assets (Safe to delete)
β”‚ β”œβ”€β”€ πŸ“ Editor/ # πŸ›‘οΈ Custom Inspectors & Window Logic
β”‚ β”‚ └── πŸ“ Icons/ # πŸ—‘οΈ UI Textures (Delete for <1.2MB builds)
β”‚ β”œβ”€β”€ πŸ“ Runtime/ # πŸ›‘οΈ Core Engine & Event Types
β”‚ β”œβ”€β”€ πŸ“„ LICENSE.txt
β”‚ └── πŸ“„ Readme.txt
β”‚
└── πŸ“ TinyGiantsData/ # [USER DATA] Your generated content sanctuary
└── πŸ“ GameEventSystem/
β”œβ”€β”€ πŸ“ CodeGen/ # πŸ’Ύ Auto-Generated C# Classes
β”‚ β”œβ”€β”€ πŸ“ Basic/ # πŸ›‘οΈ Primitive Types (Required)
β”‚ └── πŸ“ Custom/ # πŸ’Ύ Your Custom Types (Auto-regenerated)
β”œβ”€β”€ πŸ“ Database/ # πŸ’Ύ Your Event Database Assets (.asset)
└── πŸ“ FlowGraph/ # πŸ’Ύ Your Visual Flow Graphs (.asset)
Architecture Note

TinyGiants contains the tool itself (The Hammer). TinyGiantsData contains what you build with it (The House).


β›” CRITICAL: The "Plugins" Folder Warning​

DO NOT MOVE TO "PLUGINS"

You MUST NOT move the TinyGiants or TinyGiantsData folders into the standard Assets/Plugins/ directory.

Why is this critical?​

  1. Compilation Order (Scripting Phase): Unity compiles the Plugins folder before your standard game scripts (Assembly-CSharp).
    • Our plugin needs to reference your custom classes (e.g., PlayerStats, InventoryItem) to generate events for them.
    • If the plugin sits in Plugins, it cannot see your gameplay code, leading to "Type Not Found" errors.
  2. Relative Path Dependencies: The automated Code Generator and Database Manager rely on specific relative paths to locate assets. Breaking this structure may cause the "Hub" to lose track of your databases.
  3. Asset Protection Mechanism: The plugin includes a background AssetProtector service. If it detects these folders being moved to Plugins, it will attempt to warn you or block the operation to prevent project corruption.

πŸ’Ύ Version Control (Git/SVN) Strategy​

For teams working with Source Control, here is the recommended configuration:

Folder PathStrategyReasoning
TinyGiants/CommitContains the core plugin code required for the project to run.
TinyGiantsData/.../DatabaseCommitContains your actual Event Assets. Critical data.
TinyGiantsData/.../FlowGraphCommitContains your visual logic graphs. Critical data.
TinyGiantsData/.../CodeGenCommitRecommended. While these can be regenerated, committing them ensures the project compiles immediately for other team members without needing to run the Wizard first.

🧹 Optimization Guide: Deployment Strategy​

The Game Event System is modular. Depending on your project stage, you can strip it down to reduce build size.

Deployment Tiers​

Use this table to decide what to keep:

TierFolder to DeleteSize SavingsConsequence
DevelopmentKeep Everything0 MBFull experience with Demos and high-res UI.
ProductionTinyGiants/GameEventSystem/Demo/~10 MBRemoves examples. Safe for all projects once you know the basics.
Minimalist.../Editor/Icons/~4 MBUI degrades. Custom icons disappear; Windows use default Unity styling. Logic remains 100% functional.

πŸ“‰ Extreme Compression (< 1.2 MB)​

If you are building for ultra-lightweight platforms (e.g., Instant Games), you can achieve the Minimalist tier.

  1. Delete the Demo folder.
  2. Delete the Icons folder.
  3. Ensure your CodeGen/Custom folder only contains event types you actually use. Use the Cleanup Tools to remove unused generated classes.
tip

For most PC/Mobile projects, Level 1 (Deleting Demo) is sufficient. We recommend keeping the Icons folder to maintain a pleasant workflow for your designers.