How ucsd-cse125-sp22/cse125-sp22-group1 works
1. Monorepo structure
- The repository is split into four main products: chariot-client, chariot-server, chariot-core, and chariot-web.
- The Rust crates handle the game; the web app is a separate Next.js/TypeScript companion UI.
- Top-level GitHub Actions workflows cover build, test, lint, formatting, and release packaging.
2. High-level runtime model
- This is a networked 3D game with a clear client/server split.
- The server owns authoritative game state and simulation.
- The client handles rendering, local input, audio, and presentation.
- The web app is a lightweight auxiliary interface, not the game runtime itself.
3. Shared game contract: chariot-core
- chariot-core contains the shared data types and rules that must match on both sides of the network.
- It includes player state, choices, lap info, settings, questions, sound-effect identifiers, and networking packet definitions.
- This crate is the boundary that keeps client and server in sync without duplicating protocol logic.
4. Server-side simulation: chariot-server
- The server crate contains the actual game logic: phases, voting, checkpoints, chairs, powerups, and progress tracking.
- game/ appears to orchestrate match flow and interactions; physics/ handles movement, collisions, ramps, triggers, and state changes.
- Server code likely consumes input packets, updates authoritative physics/game state, and emits state changes back to clients.
5. Networking path
- Networking abstractions live in chariot-core/src/networking, with connection, packet, and websocket-related code.
- The server and client share packet definitions, so the wire format is centralized.
- The design suggests a real-time state exchange loop: client inputs go to server, and server updates are broadcast back.
6. Client application: chariot-client
- The client is the thick runtime: it owns windowing/game loop entry, input handling, rendering, UI state, and audio playback.
- Main subsystems include application.rs, game.rs, graphics.rs, menu_input.rs, ui_state.rs, and utility modules.
- The client is organized around presentation layers rather than game authority.
7. Rendering pipeline
- Rendering is structured as a reusable renderer layer plus drawable techniques.
- renderer/ manages render context, render jobs, reflections, and utilities.
- drawable/technique/ contains multiple GPU passes/shaders such as geometry, shadow, skybox, bloom, downsampling, UI, probe lighting, and anti-aliasing.
- This indicates a multi-pass graphics pipeline with deferred or hybrid techniques rather than a single forward pass.
8. Asset system
- Client assets are bundled in-tree: shaders, 3D models, fonts, sprites, UI art, audio, and sound effects.
- Asset modules under src/assets/* suggest compile-time or package-time inclusion and strongly typed access.
- The repo also depends on an external track/map asset that must be downloaded separately and placed in tracks/track.glb, which is a key runtime dependency for the game world.
9. Audio subsystem
- Audio is separated from rendering and has its own thread/context modules.
- There are distinct ambient music, soundtrack, and SFX asset groups, plus fade-source/options helpers.
- The structure suggests asynchronous playback and mixing, likely with runtime control for background ambience and event-driven effects.
10. Scene/data representation on the client
- scenegraph/, resources/, and drawable/ indicate a layered client architecture: scene entities, GPU/resource caches, and renderable techniques.
- Resource modules include static meshes, materials, glyph caching, framebuffers, and surfel-related processing, which support both rendering and UI text.
- Particle systems and UI string utilities imply a mix of world rendering and in-game interface rendering.
11. Web companion app: chariot-web
- chariot-web is a separate Next.js app with React components, SCSS styling, and small utility modules.
- It includes pages for the home screen and game-related UI, plus reusable components like buttons, grids, and standings.
- A networking.tsx utility hints that it may connect to the game backend for harassment/observer-style interaction, as described in the README.
12. Operational and delivery boundaries
- The project supports local development by running server and client separately, with configuration via config.yaml for port changes.
- Release workflows are present, including Windows release builds.
- This setup reinforces that the deployable units are the Rust server/client binaries plus the independent web frontend, with shared game types central to correctness.
Main entry points: game Game flow · application.rs App loop · networking Networking · lib.rs Core lib
Components 22
Monorepo
Top-level repository layout and delivery surfaces.
- Repo root · Workspace root that ties the Rust crates, web app, and CI together.
Client
Thick presentation runtime for the game.
- Client entry · Application startup and game loop entry for the local player runtime.
chariot-client/src/main.rs - App loop · Windowing, main loop, input routing, and high-level client coordination.
chariot-client/src/application.rs - Client game · Client-side game state and presentation logic.
chariot-client/src/game.rs - Renderer · Render context, jobs, reflections, and renderer utilities.
chariot-client/src/renderer - GPU passes · Multi-pass rendering techniques for geometry, shadowing, skybox, bloom, UI, and AA.
chariot-client/src/drawable/technique - Resources · GPU and runtime resources such as meshes, materials, glyphs, and framebuffers.
chariot-client/src/resources - Audio · Dedicated audio runtime with thread, fade, and playback options.
chariot-client/src/audio - Scene graph · Entity/component scene data and particle system support.
chariot-client/src/scenegraph - Client assets · In-tree shaders, models, fonts, sprites, UI art, and sound assets.
chariot-client/src/assets
Server
Authoritative simulation and match flow.
- Server entry · Authoritative game server startup and runtime entry.
chariot-server/src/main.rs - Game flow · Phases, voting, interactions, map flow, and powerup orchestration.
chariot-server/src/game - Physics · Movement, collisions, ramps, triggers, and state changes.
chariot-server/src/physics - Progress · Race progress and server-side progression bookkeeping.
chariot-server/src/progress.rs
Shared core
Networked data contract shared by client and server.
- Core lib · Shared network contract and common game data.
chariot-core/src/lib.rs - Networking · Connection management, packets, and websocket transport helpers.
chariot-core/src/networking - Player data · Player state, inputs, choices, and lap info.
chariot-core/src/player - Rules data · Shared settings, questions, sound effects, and entity location data.
chariot-core/src/settings.rs
Web app
Separate Next.js companion interface.
- Web app · Separate React/TypeScript companion UI.
chariot-web/pages - Components · Reusable UI building blocks such as buttons, grids, and standings.
chariot-web/src/components - Web utils · Browser and networking utilities for the companion site.
chariot-web/src/utils
Delivery
Build, test, lint, and release automation.
- CI/CD · Build, test, lint, format, and release workflows.
.github/workflows
Connections 27
- Repo root → CI/CD: automates · Repository-level build and release automation.
- Repo root → Client entry: contains · Primary client binary.
- Repo root → Server entry: contains · Primary server binary.
- Repo root → Core lib: contains · Shared crate used by client and server.
- Repo root → Web app: contains · Companion web frontend.
- Client entry → App loop: starts · Bootstraps the application loop.
- App loop → Client game: drives · Coordinates client-side game presentation.
- App loop → Renderer: uses · Delegates frame rendering.
- Renderer → GPU passes: executes · Runs the multi-pass graphics pipeline.
- Renderer → Resources: consumes · Uses cached GPU/runtime resources.
- Client game → Scene graph: reads · Consumes world and entity presentation data.
- App loop → Audio: plays · Triggers and manages audio playback.
- App loop → Client assets: loads · Uses bundled art, shaders, and sounds.
- Server entry → Game flow: orchestrates · Controls match flow and interactions.
- Game flow → Physics: updates · Simulation and authoritative movement changes.
- Game flow → Progress: tracks · Maintains progress and race state.
- Game flow → Networking: receives · Consumes client packets and connection events.
- Game flow → Player data: reads · Uses shared player and input state.
- Game flow → Rules data: uses · Depends on shared rules and settings.
- Core lib → Networking: exposes · Central networking definitions.
- Core lib → Player data: exposes · Shared player-facing state and inputs.
- Core lib → Rules data: exposes · Shared rules, questions, and settings.
- Networking → Server entry: serves · Server-side protocol transport.
- Networking → Client entry: serves · Client-side protocol transport.
- Web app → Components: composes · Pages assemble reusable components.
- Web app → Web utils: uses · Uses browser and networking helpers.
- Web app → Networking: may connect · Auxiliary UI can interact with the backend protocol.