How triformine/delixia works
Main Components
• Client:
• A React-based user interface (UI) that renders via the browser.
• A Babylon.js-powered 3D game scene (components like BabylonScene.tsx), which includes game components such as CharacterController, GameEngine, MapLoader, etc.
• Hooks and utilities that manage state and handle real-time communication with the game server (e.g., use-colyseus.ts).
• Assets management: Public assets (3D models, textures, skyboxes, etc.) are stored under the public folder.
• Server:
• A Colyseus game server running on Bun (as seen by src/server, including Dockerfile, index.ts, and rooms such as GameRoom.ts).
• Server configuration (app.config.ts) and utilities for handling game maps and room logic.
• Shared Library:
• Code in src/shared (such as shared schemas, type definitions, maps configuration) that is used by both the client and the server for consistent game state and communication.
Relationships and Interactions
• The Client communicates with the Server using Colyseus protocols (WebSocket/real-time messaging) for synchronizing game state.
• The Server manages real-time game sessions (GameRoom) and orchestrates player interactions and game events.
• The Shared module provides common types, schemas, and map data to ensure that both client and server remain in sync with the gameplay logic.
• Assets (3D models, textures, etc.) stored in the public folder support the rendering in the Babylon.js 3D scene.
• The build/deployment pipelines (Dockerfile, .env files, and Github workflows) indicate that containerization and CI/CD are part of the broader deployment architecture.
Architectural Patterns and Technologies
• Separation of Concerns: The client and server codebases are clearly separated into distinct folders (src/client and src/server), along with a shared module for common data.
• Real-Time Communication: The integration with Colyseus for handling multiplayer synchronization and state, with Bun providing performance benefits on the server side.
• 3D Rendering: Babylon.js for rendering the immersive 3D game environment.
• Component-Based UI: React (with Tailwind CSS) forms a minimalistic yet dynamic user interface.
• Game Engine Logic: Custom game-related logic (character and map loaders, interaction controllers, shader management) encapsulated in separate game modules.
Essential Components and Details
• The “Client” container should encapsulate both the visual user interface (HTML entrypoint like index.html, React components in src/client) and the game logic (Babylon.js integration and game controllers).
• The “Server” container should include game room orchestration (located in src/server/rooms), initialization (index.ts), and integration with Bun.
• External libraries/frameworks (Babylon.js, Colyseus, React, Tailwind, Bun) near the corresponding components.
• To include asset management (the public folder with its extensive 3D models) as it’s a key enabler for the 3D game environment.