# the-schwilliam/skategm architecture

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

- Interactive diagram: https://gitdiagram.com/the-schwilliam/skategm
- Repository: https://github.com/the-schwilliam/skategm

## Overview

SkateGM brings Skate 3 skating into Garry’s Mod: players provide controller or keyboard input, the engine simulates skating and tricks, and the gamemode presents the result in-game. Its documented product also includes converted Skate 3 assets and maps, minigames, a park editor, and replay and camera features. The graph includes the sampled simulation, map-collision, and speech components; several documented features are represented at their existing source directories because their implementations were not sampled. Connections involving those unsampled features are limited to README documentation.

Main entry points: [`gm_skategm/src/lib.rs`](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/lib.rs) (Lua API), [`gm_skategm/src/engine.rs`](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/engine.rs) (Native Engine Bridge), [`engine/crates/skate-core/src/input/controller.rs`](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/input/controller.rs) (Controller Input), [`engine/crates/skate-core/src/graph/controller.rs`](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/graph/controller.rs) (Intent Graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Garry’s Mod Integration"]
  node_lua_api["Lua API<br/>[lib.rs]"]
  node_native_engine["Native Engine Bridge<br/>[engine.rs]"]
end

subgraph group_simulation["Skating Simulation"]
  node_controller_input["Controller Input<br/>[controller.rs]"]
  node_intent_graph["Intent Graph<br/>[controller.rs]"]
  node_skate_physics["Skate Physics"]
  node_grind_contact["Grind Contact<br/>[manager.rs]"]
  node_camera["Camera Shots<br/>[shot_manager.rs]"]
end

subgraph group_map["Maps and Assets"]
  node_data_conversion["Game Data Conversion<br/>[convert.py]"]
  node_game_archive["BIG Archive Reader<br/>[big.py]"]
  node_map_generation["Skate 3 Map Builder<br/>[build.py]"]
  node_source_map["Source Map Collision<br/>[world.rs]"]
  node_collision_cleanup["Collision Smoothing<br/>[cleanup.rs]"]
  node_collision_pipeline["Collision Pipeline<br/>[pipeline.rs]"]
end

subgraph group_experience["Game Features"]
  node_minigames["Minigames"]
  node_park_editor["Park Editor"]
  node_replays["Replays"]
end

subgraph group_audio["Audio"]
  node_speech["World Speech<br/>[speech.rs]"]
  node_speech_manager["Speech Manager<br/>[speech_manager.rs]"]
  node_ped_speech["Ped Speech<br/>[peds.rs]"]
end

node_player(("Player"))
node_gmod["Garry’s Mod"]

node_player -->|"sends controls"| node_lua_api
node_gmod -->|"hosts module"| node_lua_api
node_lua_api -->|"dispatches simulation"| node_native_engine
node_native_engine -->|"steps session"| node_controller_input
node_controller_input -.->|"produces intents"| node_intent_graph
node_intent_graph -.->|"drives skating"| node_skate_physics
node_skate_physics -.->|"resolves grinds"| node_grind_contact
node_native_engine -.->|"returns pose"| node_camera
node_player -->|"provides game files"| node_data_conversion
node_data_conversion -->|"reads archives"| node_game_archive
node_player -->|"requests map install"| node_map_generation
node_source_map -->|"supplies collision"| node_collision_pipeline
node_collision_pipeline -->|"cleans geometry"| node_collision_cleanup
node_lua_api -.->|"offers modes"| node_minigames
node_lua_api -.->|"opens editor"| node_park_editor
node_lua_api -.->|"offers replays"| node_replays
node_ped_speech -->|"submits speech"| node_speech_manager
node_speech_manager -->|"requests lines"| node_speech

click node_lua_api "https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/lib.rs"
click node_native_engine "https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/engine.rs"
click node_controller_input "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/input/controller.rs"
click node_intent_graph "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/graph/controller.rs"
click node_skate_physics "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/physics/skateboard_controller.rs"
click node_grind_contact "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/physics/grind_contact/manager.rs"
click node_camera "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/camera/shot_manager.rs"
click node_data_conversion "https://github.com/the-schwilliam/skategm/blob/main/exporter/convert.py"
click node_game_archive "https://github.com/the-schwilliam/skategm/blob/main/exporter/tools/owned_game/big.py"
click node_map_generation "https://github.com/the-schwilliam/skategm/blob/main/exporter/mapgen/build.py"
click node_source_map "https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/world.rs"
click node_collision_cleanup "https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/cleanup.rs"
click node_collision_pipeline "https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/pipeline.rs"
click node_minigames "https://github.com/the-schwilliam/skategm/tree/main/gm_skategm/src"
click node_park_editor "https://github.com/the-schwilliam/skategm/tree/main/gm_skategm/src"
click node_replays "https://github.com/the-schwilliam/skategm/tree/main/gm_skategm/src"
click node_speech "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-audio/src/world/speech.rs"
click node_speech_manager "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-audio/src/world/speech_manager.rs"
click node_ped_speech "https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-audio/src/world/peds.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lua_api,node_native_engine toneBlue
class node_controller_input,node_intent_graph,node_skate_physics,node_grind_contact,node_camera toneAmber
class node_data_conversion,node_game_archive,node_map_generation,node_source_map,node_collision_cleanup,node_collision_pipeline toneMint
class node_minigames,node_park_editor,node_replays toneRose
class node_speech,node_speech_manager,node_ped_speech,node_player,node_gmod toneIndigo
```

## Components

### Garry’s Mod Integration

- [Lua API](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/lib.rs): `gm_skategm/src/lib.rs`
- [Native Engine Bridge](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/engine.rs): `gm_skategm/src/engine.rs`

### Skating Simulation

- [Controller Input](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/input/controller.rs): `engine/crates/skate-core/src/input/controller.rs`
- [Intent Graph](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/graph/controller.rs): `engine/crates/skate-core/src/graph/controller.rs`
- [Skate Physics](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/physics/skateboard_controller.rs): `engine/crates/skate-core/src/physics/skateboard_controller.rs`
- [Grind Contact](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/physics/grind_contact/manager.rs): `engine/crates/skate-core/src/physics/grind_contact/manager.rs`
- [Camera Shots](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-core/src/camera/shot_manager.rs): `engine/crates/skate-core/src/camera/shot_manager.rs`

### Maps and Assets

- [Game Data Conversion](https://github.com/the-schwilliam/skategm/blob/main/exporter/convert.py): `exporter/convert.py`
- [BIG Archive Reader](https://github.com/the-schwilliam/skategm/blob/main/exporter/tools/owned_game/big.py): `exporter/tools/owned_game/big.py`
- [Skate 3 Map Builder](https://github.com/the-schwilliam/skategm/blob/main/exporter/mapgen/build.py): `exporter/mapgen/build.py`
- [Source Map Collision](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/world.rs): `gm_skategm/src/world.rs`
- [Collision Smoothing](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/cleanup.rs): `gm_skategm/src/cleanup.rs`
- [Collision Pipeline](https://github.com/the-schwilliam/skategm/blob/main/gm_skategm/src/pipeline.rs): `gm_skategm/src/pipeline.rs`

### Game Features

- [Minigames](https://github.com/the-schwilliam/skategm/tree/main/gm_skategm/src): `gm_skategm/src`
- [Park Editor](https://github.com/the-schwilliam/skategm/tree/main/gm_skategm/src): `gm_skategm/src`
- [Replays](https://github.com/the-schwilliam/skategm/tree/main/gm_skategm/src): `gm_skategm/src`

### Audio

- [World Speech](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-audio/src/world/speech.rs): `engine/crates/skate-audio/src/world/speech.rs`
- [Speech Manager](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-audio/src/world/speech_manager.rs): `engine/crates/skate-audio/src/world/speech_manager.rs`
- [Ped Speech](https://github.com/the-schwilliam/skategm/blob/main/engine/crates/skate-audio/src/world/peds.rs): `engine/crates/skate-audio/src/world/peds.rs`

### Other components

- **Player**
- **Garry’s Mod**

## Connections

- Player → Lua API: sends controls
- Garry’s Mod → Lua API: hosts module (evidence: `gm_skategm/src/lib.rs`)
- Lua API → Native Engine Bridge: dispatches simulation (evidence: `gm_skategm/src/lib.rs`)
- Native Engine Bridge → Controller Input: steps session (evidence: `gm_skategm/src/engine.rs`)
- Controller Input → Intent Graph: produces intents
- Intent Graph → Skate Physics: drives skating
- Skate Physics → Grind Contact: resolves grinds
- Native Engine Bridge → Camera Shots: returns pose
- Player → Game Data Conversion: provides game files
- Game Data Conversion → BIG Archive Reader: reads archives (evidence: `exporter/convert.py`)
- Player → Skate 3 Map Builder: requests map install
- Source Map Collision → Collision Pipeline: supplies collision (evidence: `gm_skategm/src/world.rs`)
- Collision Pipeline → Collision Smoothing: cleans geometry (evidence: `gm_skategm/src/pipeline.rs`)
- Lua API → Minigames: offers modes (evidence: `gm_skategm/src/lib.rs`)
- Lua API → Park Editor: opens editor (evidence: `gm_skategm/src/lib.rs`)
- Lua API → Replays: offers replays (evidence: `gm_skategm/src/lib.rs`)
- Ped Speech → Speech Manager: submits speech (evidence: `engine/crates/skate-audio/src/world/peds.rs`)
- Speech Manager → World Speech: requests lines (evidence: `engine/crates/skate-audio/src/world/speech_manager.rs`)
