Integration patterns

One simulation engine, four kinds of application

Canwu handles simulation time, entities, commands, events, saves, and replay. Domain plugins supply the rules and typed commands for a period. Your application supplies presentation, accounts, orchestration, and content. Each pattern lists what Canwu provides, what you build, and what is still open for contributions.
01

Games · APIs available

Grand strategy and persistent worlds

Run Canwu inside the game process or behind a server, and keep your world rules in a plugin.

Canwu provides

  • Deterministic time, independent of frame rate
  • Command ingress and causal events
  • Entity and domain-record registries
  • Plugin-owned typed state, settled at boundaries

You build

  • 2D or 3D rendering and input
  • Menus, save screens, localization, and accessibility
  • Networking, accounts, and authentication
  • Scenarios, art, audio, and game content

Open for contributions

  • Renderer adapters
  • Multiplayer services
  • Complete playable campaigns
Code shape
canwu.enqueue_command(time, priority, request)?;
canwu.advance_canonical(SimDuration::hours(1))?;
let record = canwu.typed_domain_record(&game_state_ref); // Option<&DomainRecord>
let events = canwu.events();
02

Research · Fork and replay available

Reproducible scenarios and alternative histories

Keep runs independent of your notebooks and charts, then compare alternative histories branched with fork().

Canwu provides

  • Validated snapshots and checkpoint hashes
  • Fork and exact replay
  • Causal events and a journal of random draws
  • Plugin manifests and version identities

You build

  • Research questions and model design
  • Source data and provenance rules
  • Statistical validation and interpretation
  • Notebooks, maps, charts, and publications

Open for contributions

  • Curated historical datasets
  • Statistical analysis packages
  • Frameworks for validating historical models
Code shape
let saved = canwu.snapshot_json()?;
let branch = canwu.fork();
let journal = canwu.replay_journal();
let replayed = Canwu::replay_from_journal(plugins, &journal)?;
assert_eq!(replayed.checkpoint_hash(), canwu.checkpoint_hash());
03

Agents · Per-character loop available

Multi-agent historical environments

Give each model a view limited to its character, and send its typed decisions through the same command path as players.

Canwu provides

  • Viewers tied to the character an agent plays
  • Knowledge queries that return only what that character knows
  • Issuer and revision checks on every command
  • Rule explanations limited to what the character knows

You build

  • Model choice and orchestration
  • Authentication before an agent is assigned an issuer
  • Prompts, memory, and conversation state
  • Rate limits, transport, evaluation, and deployment

Open for contributions

  • Hosted agent services
  • Model and prompt frameworks
  • Application authorization policy
Code shape
let view = canwu.viewer_for_actor(actor)?.query_knowledge(&query)?;
canwu.enqueue_command(time, priority, request)?;
canwu.advance_canonical(duration)?;
let changes = canwu.viewer_for_actor(actor)?.visible_changes_since(time);
04

Education · APIs available

Classroom and public-history tools

Put replayable simulation state behind a timeline, map, exhibit, or guided classroom scenario.

Canwu provides

  • Historical time and stable entity identity
  • Projections supplied by domain integrations
  • Repeatable what-if changes through snapshots and forks
  • Causal records that explain what happened

You build

  • Curriculum, interpretation, and citations
  • Accessible interaction and editorial design
  • Museum hardware or web presentation
  • Media rights, localization, and facilitation

Open for contributions

  • Maintained teaching applications
  • Curriculum packages and museum installations
  • Checks against education standards
Code shape
entities()        → stable identities
domain projection → timeline or map state
events()          → causal history
fork()            → what-if branch