# kazade/simulant-engine architecture

> Architecture diagram of the GitHub repository kazade/simulant-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kazade/simulant-engine
- Repository: https://github.com/kazade/simulant-engine

## Overview

##### Main Components Identification
The system should be divided into these major components:

a) Core Engine Layer
- Platform Abstraction
- Memory Management
- Threading System
- Asset Management
- Event System

b) Rendering System
- Multiple Renderer Implementations (GL1x, GL2x, PSP)
- Material System
- Texture Management
- Shader Management

c) Scene Management
- Scene Graph
- Stage Nodes
- Actor Management
- Camera System
- Lighting System

d) Physics & Animation
- Physics Engine (Bounce integration)
- Animation System
- Particle System

e) Input/Output
- Input Management
- Audio System
- File System (VFS)
- Resource Loading

f) UI System
- Widget Framework
- Screen Management
- Viewport Management

**[Platform Layer (Windows/Linux/Dreamcast/PSP/Android)]**
- ↑↓
**[Core Systems Layer]**
- ↑↓
**[Engine Services Layer]**
- ↑↓
**[Game Systems Layer]**
- ↑↓
**[Application Layer]**

##### Connection Types
- Double lines: Data flow

**[Asset Loaders] → [Asset Manager] → [Resource Cache]**
- ↓               ↓
**[File System] ← [Virtual File System]**

**[Scene Graph] → [Renderer] → [Platform GL/Graphics]**
- ↓            ↓
**[Mesh Data] → [Material System]**

**[Physics World] → [Collision System]**
- ↓
**[Physical Bodies] → [Scene Nodes]**

##### Important Relationships
- Platform abstraction layer interfacing with different OS/hardware
- Asset management system's interaction with the VFS
- Rendering system's relationship with different graphics APIs
- Scene graph hierarchy and node management
- Input system's platform-specific implementations
- Sound system's integration with OpenAL

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Platform Layer"
        PL["Platform Abstraction"]:::platform
        GL["Graphics Layer"]:::platform
        IO["I/O Layer"]:::platform
    end

    subgraph "Core Systems"
        MM["Memory Management"]:::core
        TS["Threading System"]:::core
        ES["Event System"]:::core
        VFS["Virtual File System"]:::core
    end

    subgraph "Engine Services"
        AM["Asset Management"]:::service
        RS["Rendering System"]:::service
        MS["Material System"]:::service
        SS["Sound System"]:::service
        IM["Input Management"]:::service
    end

    subgraph "Game Systems"
        SG["Scene Management"]:::game
        PS["Physics System"]:::game
        AS["Animation System"]:::game
        PTS["Particle System"]:::game
        
        subgraph "Node System"
            SN["Stage Node"]:::node
            AN["Actor"]:::node
            CN["Camera"]:::node
        end
    end

    subgraph "UI Layer"
        UIF["UI Framework"]:::ui
        SCM["Screen Management"]:::ui
        VP["Viewport System"]:::ui
    end

    %% Core relationships
    PL --> MM
    PL --> TS
    PL --> ES
    PL --> VFS

    %% Service relationships
    AM --> VFS
    RS --> GL
    MS --> RS
    SS --> IO
    IM --> IO

    %% Game system relationships
    SG --> RS
    PS --> SG
    AS --> SG
    PTS --> SG
    SN --> SG
    AN --> SN
    CN --> SN

    %% UI relationships
    UIF --> RS
    SCM --> UIF
    VP --> RS

    %% Style definitions
    classDef platform fill:#90EE90
    classDef core fill:#87CEEB
    classDef service fill:#FFD700
    classDef game fill:#FFA500
    classDef node fill:#DEB887
    classDef ui fill:#DDA0DD

    %% Click events
    click PL "https://github.com/Kazade/simulant-engine/tree/next/simulant/platforms/"
    click MM "https://github.com/Kazade/simulant-engine/blob/next/simulant/core/memory.h"
    click TS "https://github.com/Kazade/simulant-engine/tree/next/simulant/threads/"
    click AM "https://github.com/Kazade/simulant-engine/blob/next/simulant/asset_manager.h"
    click ES "https://github.com/Kazade/simulant-engine/blob/next/simulant/event_listener.h"
    click RS "https://github.com/Kazade/simulant-engine/tree/next/simulant/renderers/"
    click MS "https://github.com/Kazade/simulant-engine/tree/next/simulant/assets/materials/"
    click SG "https://github.com/Kazade/simulant-engine/tree/next/simulant/scenes/"
    click SN "https://github.com/Kazade/simulant-engine/blob/next/simulant/nodes/stage_node.h"
    click AN "https://github.com/Kazade/simulant-engine/blob/next/simulant/nodes/actor.h"
    click CN "https://github.com/Kazade/simulant-engine/blob/next/simulant/nodes/camera.h"
    click PS "https://github.com/Kazade/simulant-engine/tree/next/simulant/nodes/physics/"
    click AS "https://github.com/Kazade/simulant-engine/blob/next/simulant/animation.h"
    click PTS "https://github.com/Kazade/simulant-engine/blob/next/simulant/nodes/particle_system.h"
    click IM "https://github.com/Kazade/simulant-engine/tree/next/simulant/input/"
    click SS "https://github.com/Kazade/simulant-engine/tree/next/simulant/sound/"
    click VFS "https://github.com/Kazade/simulant-engine/blob/next/simulant/vfs.h"
    click UIF "https://github.com/Kazade/simulant-engine/tree/next/simulant/nodes/ui/"
    click SCM "https://github.com/Kazade/simulant-engine/blob/next/simulant/screen.h"
    click VP "https://github.com/Kazade/simulant-engine/blob/next/simulant/viewport.h"
```
