How jelmerta/kloenk works
Main Components
a) Client-Side Core Components:
• Render System (prominently featured in /src/render/)
• State Management System (from /src/state/)
• Game Systems (from /src/systems/)
• Resource Management (from /src/resources.rs)
b) Platform Targets:
• Web Platform (WASM)
• Native Platform (Windows/Linux)
Architectural Layers (from bottom to top)
Layer 1 - Core Engine:
• RenderContext Manager as the primary interface to graphics
• Material, Model, and Texture managers
Layer 2 - Game Systems:
• Related systems into logical clusters:
• World Systems (Collision, Position, Movement)
• Interaction Systems (Object Detection, Selection, Item Pickup)
• UI Systems (Dialogue, Chat, Inventory)
• Audio System
Layer 3 - State Management:
• GameState as the central state container
• FrameState, UIState, and Input components
• State flow between systems
Layer 4 - Application Layer:
• Main Application container
• GUI and CursorManager
• Platform-specific bindings (WASM/Native)
Important Relationships to Highlight
• Blue: Render-related components
• Green: Game logic systems
• Yellow: State management
• Purple: Platform-specific code
Top Section:
[Web Browser] ←→ [WASM Bundle] ↔ [Application Core]
• ↓
[WebGPU API]
Middle Section:
[Game Systems] ←→ [State Management] ←→ [Render Pipeline]
• ↓ ↓ ↓
[Component Managers] [Frame State] [Graphics Resources]
Bottom Section:
[Asset Loading] → [Resource Management] → [Memory Management]
Technical Details
• WebGPU as the primary graphics API
• WASM compilation pathway
• Where shaders (WGSL) are utilized
• System communication patterns