# jessfdm-codes/shiphappens architecture

> Architecture diagram of the GitHub repository jessfdm-codes/shiphappens, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jessfdm-codes/shiphappens
- Repository: https://github.com/jessfdm-codes/shiphappens

## Overview

##### Main Components Identification

The system should be divided into these key components:

a) Core VR Infrastructure
- SteamVR Integration Layer
- VR Input/Output Systems
- Player Interaction System

b) Game Systems
- Semaphore Communication System
- Ship Navigation System
- Environment System
- Audio System

**[VR Hardware Layer]**

**[SteamVR Framework Layer]**

**[Core Game Systems]**

**[Game Logic Layer]**

**[Presentation Layer]**

##### Specific Implementation Details

a) VR Integration Components:
- SteamVR_Camera
- SteamVR_Controller
- VR Input Processing
- Tracking Systems

b) Game Logic Components:
- SemaphoreGenerator
- SemaphoreGrid
- ShipAI
- GameMode Controller

c) Environmental Systems:
- WaterPlaneGen
- WaterNoiseScript
- Environment Audio

##### Key Relationships

- Player input → VR Controller → Game Logic
- Game Logic → Ship Movement → Environment Response
- Semaphore System → Ship AI Response
- Environment → Player Feedback Loop

##### Additional Elements

Supporting elements:
- System boundaries
- Data flow direction indicators
- Component state indicators

##### Technical Details to Highlight

- SteamVR integration points
- Script communication paths
- Resource loading flows
- Event system architecture

Remember to include:
- Clear component labels
- Interface points between systems
- Data flow directions
- System boundaries
- Resource dependencies

This will provide a comprehensive view of how the VR game systems interact while maintaining clarity about the overall architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Hardware
        VRH[VR Hardware]
    end

    subgraph SteamVR
        SVRM[SteamVR Manager]:::steamvr
        SVRC[SteamVR Camera]:::steamvr
        SVRCT[SteamVR Controller]:::steamvr
        PIS[Player Interaction System]:::steamvr
    end

    subgraph GameSystems
        direction TB
        subgraph SemaphoreSystem
            SG[Semaphore Generator]:::game
            SGR[Semaphore Grid]:::game
            SGE[Semaphore Gesture]:::game
        end

        subgraph Navigation
            SAI[Ship AI]:::game
            GT[Grid Threshold]:::game
        end

        subgraph Environment
            WPG[Water Plane Generator]:::environment
            WNS[Water Noise Script]:::environment
        end

        subgraph Audio
            RAD[Radio System]:::audio
            AMB[Ambient Sound]:::audio
        end
    end

    subgraph GameLogic
        GMC[Game Mode Controller]:::logic
    end

    subgraph Assets
        direction TB
        Models[3D Models]:::asset
        Sounds[Sound Files]:::asset
        Scenes[Scene Files]:::asset
    end

    %% Connections
    VRH --> SVRM
    SVRM --> SVRC & SVRCT
    SVRCT --> PIS
    PIS --> GMC
    
    GMC --> SemaphoreSystem
    GMC --> Navigation
    
    SG --> SGR
    SGR --> SGE
    SGE --> SAI
    
    SAI --> GT
    WPG --> WNS
    
    RAD --> AMB
    Environment --> GMC
    Audio --> GMC

    %% Styling
    classDef steamvr fill:#1E90FF
    classDef game fill:#32CD32
    classDef environment fill:#DAA520
    classDef audio fill:#8B4513
    classDef logic fill:#DC143C
    classDef asset fill:#808080

    %% Click Events
    click SVRM "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/SteamVR/Scripts/SteamVR.cs"
    click SVRC "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/SteamVR/Scripts/SteamVR_Camera.cs"
    click SVRCT "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/SteamVR/Scripts/SteamVR_Controller.cs"
    click PIS "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/SteamVR/InteractionSystem/Core/Scripts/Player.cs"
    click SG "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/SemaphoreGenerator.cs"
    click SGR "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/SemaphoreGrid.cs"
    click SGE "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/SemaphoreGesture.cs"
    click SAI "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/ShipAI.cs"
    click WPG "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/WaterPlaneGen.cs"
    click WNS "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/WaterNoiseScript.cs"
    click RAD "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/Radio.cs"
    click GMC "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/Gamemode.cs"
    click GT "https://github.com/jessfdm-codes/shiphappens/blob/master/Assets/Scripts/GridThreshold.cs"
    click Models "https://github.com/jessfdm-codes/shiphappens/tree/master/Assets/Models"
    click Sounds "https://github.com/jessfdm-codes/shiphappens/tree/master/Assets/Sounds"
    click Scenes "https://github.com/jessfdm-codes/shiphappens/tree/master/Assets/Scenes"
```
