# devmilim/alone-engine architecture

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

- Interactive diagram: https://gitdiagram.com/devmilim/alone-engine
- Repository: https://github.com/devmilim/alone-engine

## Overview

Alone Engine is a Rust 2D game engine. A game application starts the App loop; the runtime updates scenes and objects, processes input and events, advances collision and physics, and renders frames from game assets. The graph also preserves documented support for audio, tilemaps and LDtk, sprite animation, cameras, timers, and multiplayer networking. Relationships are limited to those visible in excerpts or stated in the README; some documented feature wiring was not sampled.

Main entry points: [`src/core/base.rs`](https://github.com/devmilim/alone-engine/blob/main/src/core/base.rs) (GameObject model), [`src/runtime/app.rs`](https://github.com/devmilim/alone-engine/blob/main/src/runtime/app.rs) (App loop), [`src/render/mod.rs`](https://github.com/devmilim/alone-engine/blob/main/src/render/mod.rs) (Software renderer), [`src/objects/network/client.rs`](https://github.com/devmilim/alone-engine/blob/main/src/objects/network/client.rs) (WebSocket client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and objects"]
  node_app_loop["App loop<br/>[app.rs]"]
  node_world["World and scenes<br/>[world.rs]"]
  node_dispatcher["Object dispatcher<br/>[dispatcher.rs]"]
  node_object_model["GameObject model<br/>[base.rs]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_input["Input mapping<br/>[input.rs]"]
  node_events["Events and messaging<br/>[event.rs]"]
  node_physics["Kinematic body<br/>[body.rs]"]
  node_colliders["AABB collision<br/>[mod.rs]"]
  node_tilemaps["Tilemaps and LDtk<br/>[tilemap.rs]"]
  node_animation["Sprite animation"]
  node_camera["Follow camera<br/>[camera.rs]"]
  node_timers["Timers<br/>[timer.rs]"]
end

subgraph group_rendering["Rendering and assets"]
  node_renderer["Software renderer<br/>[mod.rs]"]
  node_rasterizer["Rasterizer<br/>[rasterizer.rs]"]
  node_render_queue["Draw queue<br/>[render_queue.rs]"]
  node_resources[("Asset resources<br/>[resources.rs]")]
end

subgraph group_services["Audio and networking"]
  node_audio["Audio playback<br/>[audio.rs]"]
  node_network_client["WebSocket client<br/>[client.rs]"]
  node_network_server["WebSocket server<br/>[server.rs]"]
end

subgraph group_foundation["Core foundation"]
  node_core_systems["Core systems<br/>[mod.rs]"]
  node_ldtk_api["LDtk import API<br/>[ldtk_api.rs]"]
end

node_game_app(("Game application"))

node_game_app -->|"starts"| node_app_loop
node_app_loop -->|"renders world"| node_world
node_app_loop -->|"renders frame"| node_renderer
node_app_loop -->|"dispatches events"| node_events
node_app_loop -->|"updates input"| node_input
node_world -.->|"updates objects"| node_dispatcher
node_dispatcher -->|"runs lifecycle"| node_object_model
node_object_model -->|"composes components"| node_physics
node_object_model -->|"composes components"| node_colliders
node_object_model -->|"composes components"| node_animation
node_object_model -->|"composes components"| node_tilemaps
node_object_model -->|"composes components"| node_camera
node_object_model -->|"composes components"| node_timers
node_physics -.->|"resolves movement"| node_colliders
node_core_systems -->|"steps collisions"| node_colliders
node_core_systems -->|"emits trigger events"| node_events
node_renderer -->|"consumes commands"| node_render_queue
node_renderer -->|"draws pixels"| node_rasterizer
node_renderer -->|"reads assets"| node_resources
node_audio -->|"loads audio assets"| node_resources
node_ldtk_api -->|"supports import"| node_tilemaps
node_network_client -.->|"exchanges messages"| node_network_server
node_network_client -->|"connects by WebSocket"| node_network_server
node_network_server -->|"accepts WebSocket"| node_network_client

click node_app_loop "https://github.com/devmilim/alone-engine/blob/main/src/runtime/app.rs"
click node_world "https://github.com/devmilim/alone-engine/blob/main/src/runtime/world.rs"
click node_dispatcher "https://github.com/devmilim/alone-engine/blob/main/src/runtime/dispatcher.rs"
click node_object_model "https://github.com/devmilim/alone-engine/blob/main/src/core/base.rs"
click node_input "https://github.com/devmilim/alone-engine/blob/main/src/input.rs"
click node_events "https://github.com/devmilim/alone-engine/blob/main/src/event.rs"
click node_physics "https://github.com/devmilim/alone-engine/blob/main/src/components/body.rs"
click node_colliders "https://github.com/devmilim/alone-engine/blob/main/src/collision/mod.rs"
click node_tilemaps "https://github.com/devmilim/alone-engine/blob/main/src/components/tilemap.rs"
click node_animation "https://github.com/devmilim/alone-engine/blob/main/src/components/sprite_animation.rs"
click node_camera "https://github.com/devmilim/alone-engine/blob/main/src/components/camera.rs"
click node_timers "https://github.com/devmilim/alone-engine/blob/main/src/components/timer.rs"
click node_renderer "https://github.com/devmilim/alone-engine/blob/main/src/render/mod.rs"
click node_rasterizer "https://github.com/devmilim/alone-engine/blob/main/src/render/rasterizer.rs"
click node_render_queue "https://github.com/devmilim/alone-engine/blob/main/src/render/render_queue.rs"
click node_resources "https://github.com/devmilim/alone-engine/blob/main/src/resources.rs"
click node_audio "https://github.com/devmilim/alone-engine/blob/main/src/audio.rs"
click node_network_client "https://github.com/devmilim/alone-engine/blob/main/src/objects/network/client.rs"
click node_network_server "https://github.com/devmilim/alone-engine/blob/main/src/objects/network/server.rs"
click node_core_systems "https://github.com/devmilim/alone-engine/blob/main/src/core/mod.rs"
click node_ldtk_api "https://github.com/devmilim/alone-engine/blob/main/src/core/ldtk_api.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_app_loop,node_world,node_dispatcher,node_object_model toneBlue
class node_input,node_events,node_physics,node_colliders,node_tilemaps,node_animation,node_camera,node_timers toneAmber
class node_renderer,node_rasterizer,node_render_queue,node_resources toneMint
class node_audio,node_network_client,node_network_server toneRose
class node_core_systems,node_ldtk_api,node_game_app toneIndigo
```

## Components

### Runtime and objects

- [App loop](https://github.com/devmilim/alone-engine/blob/main/src/runtime/app.rs): `src/runtime/app.rs`
- [World and scenes](https://github.com/devmilim/alone-engine/blob/main/src/runtime/world.rs): `src/runtime/world.rs`
- [Object dispatcher](https://github.com/devmilim/alone-engine/blob/main/src/runtime/dispatcher.rs): `src/runtime/dispatcher.rs`
- [GameObject model](https://github.com/devmilim/alone-engine/blob/main/src/core/base.rs): `src/core/base.rs`

### Gameplay systems

- [Input mapping](https://github.com/devmilim/alone-engine/blob/main/src/input.rs): `src/input.rs`
- [Events and messaging](https://github.com/devmilim/alone-engine/blob/main/src/event.rs): `src/event.rs`
- [Kinematic body](https://github.com/devmilim/alone-engine/blob/main/src/components/body.rs): `src/components/body.rs`
- [AABB collision](https://github.com/devmilim/alone-engine/blob/main/src/collision/mod.rs): `src/collision/mod.rs`
- [Tilemaps and LDtk](https://github.com/devmilim/alone-engine/blob/main/src/components/tilemap.rs): `src/components/tilemap.rs`
- [Sprite animation](https://github.com/devmilim/alone-engine/blob/main/src/components/sprite_animation.rs): `src/components/sprite_animation.rs`
- [Follow camera](https://github.com/devmilim/alone-engine/blob/main/src/components/camera.rs): `src/components/camera.rs`
- [Timers](https://github.com/devmilim/alone-engine/blob/main/src/components/timer.rs): `src/components/timer.rs`

### Rendering and assets

- [Software renderer](https://github.com/devmilim/alone-engine/blob/main/src/render/mod.rs): `src/render/mod.rs`
- [Rasterizer](https://github.com/devmilim/alone-engine/blob/main/src/render/rasterizer.rs): `src/render/rasterizer.rs`
- [Draw queue](https://github.com/devmilim/alone-engine/blob/main/src/render/render_queue.rs): `src/render/render_queue.rs`
- [Asset resources](https://github.com/devmilim/alone-engine/blob/main/src/resources.rs): `src/resources.rs`

### Audio and networking

- [Audio playback](https://github.com/devmilim/alone-engine/blob/main/src/audio.rs): `src/audio.rs`
- [WebSocket client](https://github.com/devmilim/alone-engine/blob/main/src/objects/network/client.rs): `src/objects/network/client.rs`
- [WebSocket server](https://github.com/devmilim/alone-engine/blob/main/src/objects/network/server.rs): `src/objects/network/server.rs`

### Core foundation

- [Core systems](https://github.com/devmilim/alone-engine/blob/main/src/core/mod.rs): `src/core/mod.rs`
- [LDtk import API](https://github.com/devmilim/alone-engine/blob/main/src/core/ldtk_api.rs): `src/core/ldtk_api.rs`

### Other components

- **Game application**

## Connections

- Game application → App loop: starts
- App loop → World and scenes: renders world (evidence: `src/runtime/app.rs`)
- App loop → Software renderer: renders frame (evidence: `src/runtime/app.rs`)
- App loop → Events and messaging: dispatches events (evidence: `src/runtime/app.rs`)
- App loop → Input mapping: updates input (evidence: `src/runtime/app.rs`)
- World and scenes → Object dispatcher: updates objects
- Object dispatcher → GameObject model: runs lifecycle
- GameObject model → Kinematic body: composes components
- GameObject model → AABB collision: composes components
- GameObject model → Sprite animation: composes components
- GameObject model → Tilemaps and LDtk: composes components
- GameObject model → Follow camera: composes components
- GameObject model → Timers: composes components
- Kinematic body → AABB collision: resolves movement
- Core systems → AABB collision: steps collisions (evidence: `src/core/mod.rs`)
- Core systems → Events and messaging: emits trigger events (evidence: `src/core/mod.rs`)
- Software renderer → Draw queue: consumes commands (evidence: `src/render/mod.rs`)
- Software renderer → Rasterizer: draws pixels (evidence: `src/render/mod.rs`)
- Software renderer → Asset resources: reads assets (evidence: `src/render/mod.rs`)
- Audio playback → Asset resources: loads audio assets (evidence: `src/audio.rs`)
- LDtk import API → Tilemaps and LDtk: supports import
- WebSocket client → WebSocket server: exchanges messages
- WebSocket client → WebSocket server: connects by WebSocket (evidence: `src/objects/network/client.rs`)
- WebSocket server → WebSocket client: accepts WebSocket (evidence: `src/objects/network/server.rs`)
