Skip to content

chronomancy-io/chronoengine

Repository files navigation

Chronoengine

Rust game engine core with CDE-optimized hot paths.

standard-readme compliant License WASP v1.0.0 CDE v1.0.0 MSS v1.0.0

Applies Coleman Dimensional Encoding (CDE) to turn common engine hot paths from O(n) scans into O(1) lookups with O(k) bounded iteration. Morton-encoded spatial grids, query planning, deterministic simulation with checksums and replay, WebAssembly support.

Background

CDE Implementation

Dimensions

  • Entity ID: stable integer identifier for each entity.
  • Component mask: bitset indicating which components are attached.
  • Component data: dense, columnar storage per component type.
  • Spatial partition: grid or tree cell index per entity for spatial queries.

Query Workload

ChronoEngine is optimized for:

  • "Given a system and frame, iterate entities matching a component mask efficiently."
  • "Given a region, return all entities within spatial bounds."
  • "Given an entity, fetch or mutate its component data."

Minimal Sufficient Statistic

An ECS can be reduced to:

  • Entity IDs,
  • Component masks,
  • Component storage, and
  • Spatial index.

This is both necessary and sufficient for all ECS systems and queries. Encoding these dimensions yields a CDE layout that is MSS for engine behavior and performance.

Install

# Requires Rust 1.92.0+ (pinned via rust-toolchain.toml)
# WebAssembly target for browser builds:
rustup target add wasm32-unknown-unknown

Usage

cargo test --workspace --all-targets
cargo clippy --workspace --all-targets -- -D warnings
cargo check --workspace --target wasm32-unknown-unknown

Benchmarks:

cargo bench -p chronoengine_core --bench core_benches
cargo bench -p chronoengine_core --bench phase1_benches

Architecture

ChronoEngine implements proven optimizations from ChronoUO (800-1000 concurrent players at 120 FPS):

  • O(1) spatial operations via Morton-encoded grids
  • Query planning for optimal execution paths
  • Deterministic simulation with checksums and replay
  • WebAssembly support for browser deployment
  • Strict memory safety (core crate forbids unsafe)
Document Purpose
ARCHITECTURE.md Component breakdown, SOLID analysis
PERFORMANCE.md Complexity proofs, benchmark methodology

Contributing

See CONTRIBUTING.md for development process and code review checklist.

License

Apache-2.0 © 2026 Jacob Coleman — See LICENSE for details.

About

Rust game engine core. CDE-driven O(1) lookups, Morton-encoded spatial grids, deterministic simulation, WASM support.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages