Skip to content
AegeanWorksPublic

About

A small, game-agnostic 3D engine core in Python: OpenGL 3.3 PBR rendering, scene graph, meshes/OBJ, fixed-step loop, rebindable input, animation, particles, audio, collision, replay, atomic saves, batch planning/merging, and a HUD/profiler overlay with an embedded bitmap font.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Keystone (Rust)

Keystone is a game-agnostic 3D engine core rewritten entirely in Rust. The Python package has been removed; the Rust implementation in src/ is the only engine. Python-derived values are pinned as parity vectors in tests/parity.rs.

Prerequisites

  • Rust 1.100+ (the pinned rust-toolchain.toml selects the GNU toolchain on Windows because the MSVC linker is not installed in this environment).
  • No display or GPU is required: rendering is deterministic and headless.

Build and test

cargo test
cargo build --release
cargo run -- --describe
cargo run -- --simulate 120 --seed 7
cargo run -- --headless --size 320x240 --out rust_frame.png --frames 1

cargo test runs unit tests for every module plus cross-language parity tests covering RNG streams, hashes, routes, scenes, animation, navigation, audio and renderer statistics.

Quick reference

Task Command
Describe engine capabilities cargo run -- --describe
Deterministic trace hash cargo run -- --simulate 120 --seed 7
Render a headless frame cargo run -- --headless --size 320x240 --out rust_frame.png
Full gate cargo test && cargo build --release

Verification semantics

  • Frame-report hash includes the artifact path. analysis::report_hash hashes the entire image block, whose fields are path, width, height, rgba_sha256 and png_sha256. Two reports for byte-identical pixels stored at different paths therefore have different report hashes. To compare pixels only, compare image.png_sha256 (or image.rgba_sha256) directly — do not compare the top-level report hash across machines or folders.
  • Determinism has two scopes. testing::verify_determinism runs two passes in one process (fast, CI default); testing::verify_determinism_across_processes spawns separate processes with a seed in KEYSTONE_HASH_SEED (or a custom env name via ..._with_env) and compares their stdout. Only the latter detects hash-order dependence between processes.
  • Hidden replay state is opt-in. testing::state_hash / full_state_hash cover rng, spawn_queue, velocity and cooldowns from a game's full_state() hook without changing the public snapshot() progress record.

Architecture

  • math3d, geometry, scene, physics, input, clock — deterministic core.
  • animation, animation_blend, animation_state, root_motion*, particles, character, navigation, nav_agent, pathfinding, steering — gameplay primitives.
  • persistence, project, assets, asset_io, content, gltf*, export, and the *_library modules — projects and file-backed content.
  • gpu, gpu_passes, render, png, ui*, audio*, web* — rendering, interface, audio and console layers. See GPU_PARITY.md for the mapping from the former OpenGL backend to the headless renderer.
  • ecs, runtime, plugin, engine, headless — engine architecture: entities/components, ordered systems with deferred commands, plugins, a fixed-step application loop, transform hierarchy and render queue.
  • testing, evidence, analysis, agents, playtest — verification and AI adapters.

Every former Python module name has a same-named Rust module in src/. Consolidated implementations live in gpu, ui, web_routes and gltf; the same-named modules delegate to them and each has behavior-level tests.

Game contract

A game implements the GameModule trait (five operations: name, build_scene, update, snapshot, actions, status plus optional bind_input/full_state). samples::CubeDemo is a complete example with no genre rules. Games can be driven headlessly through engine::Engine or headless::run_simulation.

Layout

Cargo.toml          package manifest
src/                one Rust module per former Python module + core layers
tests/parity.rs     Python-derived parity vectors
RUST.md             full module map
GPU_PARITY.md       OpenGL -> headless renderer mapping
rust_frame.png      generated sample screenshot
assets/foundry/     preserved Foundry packs, schemas and targets (data only)

The former Foundry Python tooling was removed after the Rust port; its authored packs, schemas and target manifests are preserved under assets/foundry/.

License

AL-1.1 — see LICENSE.

About

A small, game-agnostic 3D engine core in Python: OpenGL 3.3 PBR rendering, scene graph, meshes/OBJ, fixed-step loop, rebindable input, animation, particles, audio, collision, replay, atomic saves, batch planning/merging, and a HUD/profiler overlay with an embedded bitmap font.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages