Skip to content

Project structure ​

text
shagger/
├── Cargo.toml              workspace: members, edition 2024, rust-version, lints
├── deny.toml               cargo deny: licences and advisories
├── crates/
│   ├── shagger_shared/     SHAG src/shared: no GPU, no window, no async
│   │   ├── src/
│   │   └── tests/          golden tests, tests/golden/ holds the vectors
│   └── shagger/            SHAG src/engine (minus editor and server), src/lobby client
│       ├── src/
│       └── tests/          golden, offscreen and fuzz tests
├── tools/golden/           Node scripts that write the golden vectors from SHAG
└── docs/manual/            this manual

The two crates ​

CrateSHAG counterpartRule
shagger_sharedsrc/sharedDepends on nothing that touches a GPU, a window or an async runtime. Its only dependency is flate2 (gzip demos). It can serve a Rust game server or a WebAssembly build without changes.
shaggersrc/engine (minus the editor and the server), the client side of src/lobbyDepends on shagger_shared and the native backends.

unsafe_code is denied in both.

Paths follow SHAG's ​

Module folders follow SHAG's, and file names are SHAG's in snake case, so a SHAG path points at its SHAGGER file:

SHAGSHAGGER
src/engine/loader/pk3/PK3PublishedIndex.tscrates/shagger/src/loader/pk3/published_index.rs
src/engine/core/Cvar.tscrates/shagger/src/core/cvar.rs
src/shared/demo/DemoReader.tscrates/shagger_shared/src/demo/demo_reader.rs
src/shared/net/BinaryProtocol.tscrates/shagger_shared/src/net/binary_protocol.rs

Every ported file names its TypeScript source in its first doc comment, and says where and why the Rust differs. To find the port of a SHAG file, search for its name:

sh
grep -rl "SequenceBuilder.ts" crates

shagger_shared modules ​

ModuleSHAGContents
netsrc/shared/net, src/engine/network/protocolBinaryEncoder/BinaryDecoder, commands, message envelopes, snapshot decoding, the decoded game state
collisionsrc/shared/collisionthe simulation's CollisionWorld and ground detection over a sweep backend
bspsrc/shared/bspmap entities, spawn points, triggers, lifts, brush model state
server::simulationsrc/shared/server/simulationthe input sanitizer and the simulation's value types
demosrc/shared/demothe .shagdemo reader, recorded inputs, the highlight analyzer, the reel's sequence builder and camera paths
entitiessrc/shared/entitiesprojectile definitions
settingssrc/shared/settingswhich settings sync with the account, and their blob
spread_utilssrc/shared/SpreadUtils.tsmulberry32 and the pellet cone
js, fdlibm, json, math_randomnoneJavaScript number semantics, V8's sin/cos/atan2, a JSON.parse reader, a cosmetic random source (JavaScript parity)

shagger modules ​

ModuleSHAGContentsGuide
coresrc/engine/corecvars, crash reports, the console log file, whole-file writes, bounded thread joinsCvars and console, Native runtime
consolesrc/engine/consolethe command trait, the registry, the engine's commandsCvars and console
debugsrc/engine/debugthe drop-down consoleCvars and console
inputsrc/engine/inputactions and bindings, key codes, gamepads, the device in useInput
loadersrc/engine/loaderpk3, bsp, shader, texture, modelPackages and maps, Models and animation
animationsrc/engine/animationthe player model, its fit, clips and aim poseModels and animation
renderingBabylon's scene, src/engine/renderingthe wgpu device, world and model renderers, sky, water, fog, dynamic lights, offscreen framesRendering
lightingsrc/engine/lightingsky lights, emissive surfacesRendering
effectssrc/engine/effectscolour correctionRendering
babylonBabylon.jsthe Babylon code the port needs, Apache-2.0Rendering, Contributing
audiosrc/engine/AudioManager.ts, src/engine/audiodecoding, the mixer, the sound card, spatial sound, effects and musicAudio
networksrc/engine/networkthe game server connection, snapshots, clock sync, the movement contractsNetworking and lobby
lobbysrc/lobby (client)the lobby connection, player keys, settings syncNetworking and lobby
physicssrc/engine/physicsthe Q3 brush and patch sweep, the rapier world for ragdollsCollision and physics
movementsrc/engine/movementmovement variablesCollision and physics
camera, viewportsrc/engine/camera, src/engine/viewportshake, kick, field of view, first-person view effectsViewport and weapons
weaponsrc/engine/weaponthe view model, its motion, and weapon effectsViewport and weapons
worldsrc/engine/worldpickup model placementModels and animation
uisrc/engine/uithe egui layer, the 2D HUD batch, fonts, shared componentsUI

Released under the MIT License. Babylon.js ports under Apache-2.0.