Skip to content

Commit 88ab2a2

Browse files
v1.0.3
1 parent cd92fc1 commit 88ab2a2

15 files changed

Lines changed: 1630 additions & 18 deletions

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Added
6+
7+
- Game events: `ClickEvent` (mouse-click picking against the active camera) and `CollisionEvent` (bounding-sphere overlap), both wired into every `App` by default
8+
- `RuntimeInput` resource for raw keyboard/mouse/cursor state, fed from real window events during Play
9+
- `ActionMap` resource for named input actions bound to keyboard/mouse (gamepad-ready)
10+
- Shared `runtime::picking` ray-casting module used by gameplay click picking
11+
- `unload_scene` runtime API to despawn a loaded scene without loading a replacement
12+
- glTF import now pulls in base-color, normal, metallic-roughness, occlusion, and emissive textures with correct sRGB/linear color space
13+
314
## [1.1.0] - 2026-08-31
415

516
### Added

‎Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rusting_engine"
3-
version = "1.0.2"
3+
version = "1.0.3"
44
authors = ["Vasyl Trefilov <drenfor228@gmail.com>"]
55
edition = "2021"
66
description = "Vulkan 3D game engine with GPU-accelerated physics for massive physics-heavy scenes"

‎architecture.md‎

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@ editor composition
2020

2121
Dependencies and data flow move downward. Rendering and editor code may observe runtime state through extraction, but must not become canonical owners of scene entities, transforms, materials, or asset identity.
2222

23+
### Crate layers
24+
25+
Each layer may depend only on layers below it. Crates sharing a layer are siblings and must not depend on each other.
26+
27+
```text
28+
0 rusting-math deterministic scalar/vector math, fixed-point, seeded RNG streams
29+
1 rusting-core ECS components, schedules, time, input, hierarchy, events
30+
2 rusting-assets typed handles, cache, importers, serialization, hot reload
31+
3 rusting-physics CPU physics, GPU compute simulation, synchronization, queries
32+
4 rusting-terrain volumetric chunks, fracture, structural load, Scar persistence
33+
5 rusting-nav navigation volumes, flow fields, crowd agents
34+
6 rusting-render Vulkan context, extraction, frame graph, materials, profiling
35+
rusting-net authority, wire protocol, replication, interest mechanism
36+
rusting-audio device management, mixing, buses, spatialization
37+
7 rusting-gameplay teams, match state, abilities as forces, vision, bots
38+
8 rusting-editor egui panels, viewport, inspector, gizmos, play controls
39+
9 rusting-engine plugins, application facade, compatibility API
40+
10 game projects vertical slice, Sundering
41+
```
42+
43+
`rusting-math` sits below everything because both the CPU solver and the generated shader math must use one implementation. Splitting it later means rewriting every solver.
44+
45+
Game-specific content — heroes, ability definitions, map layouts — belongs in the game project at layer 10, not in `rusting-gameplay`. Layer 7 owns the machinery; layer 10 owns the content.
46+
2347
## Frame flow
2448

2549
```text
@@ -96,6 +120,65 @@ editor-authored .rscene → scene cooker ┘
96120
- Normal gameplay must not wait for GPU readback. Same-tick queries use CPU bodies; GPU mirrors always expose the tick that produced them.
97121
- The editor writes physics components into `.rscene`; backend buffers and dispatch groups remain derived data.
98122

123+
### Simulation state and presentation state are separate
124+
125+
This is the boundary that makes deterministic networked play possible, and the easiest one to break by accident.
126+
127+
- **Simulation state** is anything that contributes to the per-tick world-state hash: transforms, velocities, terrain volumes, navigation results, visibility, match state, ability state.
128+
- **Presentation state** is everything else: interpolation, prediction smoothing, camera shake, audio voices, particles, decals, UI animation.
129+
- Presentation systems may read simulation state. They may never write it, including through corrections that look harmless.
130+
- Prediction error smoothing is presentation. It adjusts what is drawn, never what is simulated.
131+
- The enforcing test is mechanical: disabling audio, particles, and all presentation systems must not change a replay's hash sequence.
132+
133+
### Determinism has exactly one owner
134+
135+
- `rusting-math` owns the simulation number format and the seeded RNG. Nothing else defines simulation arithmetic.
136+
- Simulation code may not call standard-library transcendental functions, read a wall clock, read frame delta, or use an unseeded or thread-local RNG.
137+
- Physics and terrain compute shaders include the same math module and compile with fast-math and relaxed precision disabled. Rendering shaders are unaffected.
138+
- Every container iterated by simulation code has a defined, stable order that survives compaction, reuse, and re-sorting.
139+
- Simulation state must never be accumulated through order-dependent atomic operations. Atomics remain fine for counters that do not feed results.
140+
- The per-tick world-state hash is part of the engine, not a test utility, and stays enabled in release builds.
141+
142+
### Authority belongs to the server
143+
144+
- The server's ECS world is canonical. A client's ECS world is a replica.
145+
- A client may hold presentation-only components the server does not have. It may not hold authoritative simulation state the server does not have.
146+
- Clients predict only their own hero's input. No client predicts terrain destruction unless cross-vendor determinism is proven.
147+
- The server validates all input and never accepts a client-reported position, velocity, or terrain state.
148+
- Desync is detected by comparing state hashes, reported explicitly, and recovered by full resynchronization. It is never silently corrected.
149+
150+
### Terrain is canonical simulation state
151+
152+
- The terrain volume plus its ordered modification history is the source of truth.
153+
- Collision geometry, render meshes, navigation data, and visibility are all derived from it and may be discarded and rebuilt at any time.
154+
- Terrain modifications arrive as commands applied at a deterministic point in the tick, through the same bridge as physics commands.
155+
- Scar is not a separate list of permanent bodies. Settled debris re-enters the terrain volume and becomes ordinary static terrain.
156+
- Terrain replicates as modification events. Individual debris transforms are never replicated.
157+
158+
### Navigation is derived, never authored
159+
160+
- Navigation data is built from terrain collision, not from a designer-authored mesh. There is no authored navigation asset to fall out of sync.
161+
- Rebuilds are incremental and budgeted. The budget is a hard cap: overruns are reported and deferred, never exceeded by running longer.
162+
- Rebuild results are deterministic regardless of how many regions were dirtied, or in what order.
163+
- Unreachable destinations are an observable gameplay state, not a stalled agent.
164+
165+
### Vision is simulation, not a rendering effect
166+
167+
- Per-team visibility is computed from actual terrain geometry, on the tick, deterministically.
168+
- The server and every client compute identical visibility. A mismatch is a desync, not a cosmetic difference.
169+
- Visibility feeds network interest management and gameplay rules. Fog rendering consumes the same data through extraction and is presentation only.
170+
171+
### Networking owns mechanism, gameplay owns policy
172+
173+
- `rusting-net` owns transport, protocol versioning, snapshot encoding, delta compression, and the interest-management mechanism.
174+
- `rusting-gameplay` supplies interest policy — what a given team may currently see — through a trait that `rusting-net` defines.
175+
- `rusting-net` must not depend on `rusting-gameplay`. This is what keeps the replication layer reusable and testable without a match running.
176+
177+
### Audio and effects are consumers only
178+
179+
- Audio and particles are triggered by gameplay and physics events, never by polling simulation state in a way that writes back.
180+
- Voice limiting, effect budgets, and quality scaling are presentation policy and must produce identical simulation results whether they are applied or not.
181+
99182
### Renderer APIs are target-oriented
100183

101184
- `SceneRenderer` receives an image target, extent, `RenderWorld`, and `AssetServer`.
@@ -119,6 +202,13 @@ editor-authored .rscene → scene cooker ┘
119202
5. Do not silently drop work when a buffer or grid reaches capacity.
120203
6. Keep fallible window, asset, and renderer operations as structured `Result` APIs.
121204
7. Add a focused test whenever a new cache, identity mapping, or ownership boundary is introduced.
205+
8. Do not introduce wall-clock time, frame-rate dependence, or unseeded randomness into simulation code.
206+
9. Do not accumulate simulation state through order-dependent atomic operations.
207+
10. Do not replicate derived data across the network. Replicate the commands that produce it.
208+
11. Do not make a client authoritative over any simulation state.
209+
12. Do not author navigation data by hand. Derive it from terrain collision.
210+
13. Do not let presentation systems write simulation state, including through smoothing or correction.
211+
14. Give every system with an unbounded per-tick cost a budget, a reported measurement, and a defined behaviour at the cap.
122212

123213
## Near-term architecture sequence
124214

@@ -128,3 +218,24 @@ editor-authored .rscene → scene cooker ┘
128218
4. Upload only extraction dirty ranges into growable instance buffers.
129219
5. Add typed editor widgets and animation assets over the scene component registry.
130220
6. Add stable physics IDs, GPU event readback, CPU command upload, and selective state synchronization before expanding the self-written solvers.
221+
222+
## Sundering architecture sequence
223+
224+
This sequence begins once the hybrid physics bridge above is complete. It corresponds to roadmap Milestones 8-15.
225+
226+
1. Extract `rusting-math` and move both the CPU solver and every physics shader onto it. Add the per-tick world-state hash and headless mode.
227+
2. Prove or disprove cross-vendor determinism. Record the result in this document, because it decides the networking model for everything that follows.
228+
3. Add replay recording and playback on top of the hash, then use replays as the primary debugging tool for everything after this point.
229+
4. Add `rusting-net` with a headless server, treating clients as pure renderers until determinism is proven.
230+
5. Add `rusting-terrain` as canonical simulation state, with collision and render meshes derived from one volume.
231+
6. Add `rusting-nav` deriving navigation from terrain collision, with a hard per-tick budget.
232+
7. Add `rusting-audio` and the presentation systems, verifying that disabling them does not alter replay hashes.
233+
8. Add `rusting-gameplay` with vision, and wire vision into network interest management through the trait boundary.
234+
235+
## Recorded decisions
236+
237+
Decisions that later work must not silently reverse. Add to this list rather than changing a boundary above.
238+
239+
- *(pending)* Simulation number format: fixed-point or constrained IEEE-754. Decided by Milestone 8.
240+
- *(pending)* Networking model: lockstep with rollback, or server-authoritative without. Decided by the Milestone 8 determinism result.
241+
- *(pending)* Terrain chunk size and volume representation. Decided by Milestone 10.

0 commit comments

Comments
 (0)