Janus Engine

An engine that thinks.A game that stays yours.

Janus is the AI-native game engine. A deterministic Rust core holds canonical reality; asynchronous AI cognition makes your world react and remember; one audited gateway joins the two. The AI does the plumbing. You keep authorship.

Face one

Deterministic ECS

Canonical reality. Every gameplay fact, Epoch-versioned, fixed-point, replayable.

EntitiesComponentsSnapshotsRollback
The gateway

Semantic Action Compiler

Every intent from every source passes the same seven stages. The audit entry is written before anything commits.

Face two

Asynchronous cognition

Characters, the Director and the content pipeline think off the frame loop and propose, never mutate.

NPCsDirectorGenerationMods
01

AI-native ECS + Semantic Action Compiler

Janus has two faces. One is a deterministic Entity Component System that holds every gameplay fact. The other is asynchronous AI cognition that makes the world feel alive. They meet at exactly one place: the Semantic Action Compiler. NPCs, the Director, players, systems and mods all speak the same typed intent language, and every intent runs the same seven-stage pipeline before it commits.

  • Constrained decoding makes malformed intents physically un-emittable
  • Epoch-versioned snapshots for rollback, save/load and replay
  • Structured, stage-tagged rejections so agents never loop on a doomed plan
  • Games and mods extend the intent language through the same gate
The seven stages, in fixed order
  1. 1Constrained decodingVerify the intent came from an active, signed cognition profile.
  2. 2Schema validationParse into typed Rust; enforce cross-field invariants.
  3. 3Capability checkVerify the token covers the action and only ever narrows.
  4. 4Epoch validationReject thoughts that ran on a rolled-back world.
  5. 5World-state legalityResolve references; run engine and game-registered rules.
  6. 6Consequence forecastSimulate significant intents ahead; reject second-order damage.
  7. 7Commit + auditWrite the audit entry first, then commit atomically.
02

Cognition Tier Scheduler

The scheduler decides when each character thinks, on which tier, and on whose budget. Moment-to-moment decisions run on small local models; long-horizon reasoning and narrative pacing escalate to frontier cloud models. The render thread never waits on a thought, and under load the engine degrades in a fixed, predictable order.

  • Six dispatch tiers, from the frame loop to the Director
  • Semantic level of detail: attention follows narrative weight, not just distance
  • Separate compute and token budgets you control
  • Deterministic graceful degradation and automatic recovery
Six dispatch tiers
TierCadence
1Render / PhysicsFrame loop · reads cache60–144 Hz
2Animation hintLocal heuristics15–30 Hz
3TacticalLocal model5–10 Hz
4StrategicHybrid local + cloud1–2 Hz
5World simulationDeterministic + cloud0.1–1 Hz
6DirectorFrontier cloud + local fallbackEvent-driven
Fast · local · cheapDeep · cloud · deliberate
03

NPC memory

Janus persists memory at character granularity. Working memory is assembled per thought; episodic memory records what each character lived through; long-term beliefs live as ECS components on the character itself. Nothing becomes a belief without passing a five-stage consolidation pipeline built to resist memory poisoning.

  • Working, episodic and long-term layers, isolated per character
  • Provenance on every memory entry
  • Consolidation with anomaly detection and population-level coherence checks
  • Monotonic skepticism: trust is earned back, never assumed
Three layers, one way in
Working memory
Assembled fresh for every thought from the layers below, filtered by what the character is allowed to know.
Episodic memory
What this character lived through: who, what, when, and from whom it heard it.
Long-term memory
Consolidated beliefs, stored as ECS components on the character itself.
Consolidation pipeline
  1. 1 Provenance verification
  2. 2 Anomaly detection
  3. 3 Population coherence
  4. 4 Sandboxed validation
  5. 5 Cryptographic commit
04

The Director

The Director reasons outside the frame budget to keep an emergent world dramatically coherent: when to raise the pressure, when to let the player breathe, which thread to escalate. Its authority is a closed allow-list of seven intent types with hard caps, and it can never touch player-owned state.

  • Seven allow-listed intents: spawn events, surface opportunities, modulate tension and more
  • Hard caps on scope and intensity per action
  • Reads snapshots, never writes directly; every decision audited
  • Player stats, inventory and agency are out of reach by design
The Director's whole vocabulary
  • SpawnNarrativeEvent
  • SurfaceOpportunity
  • ModulateTension
  • AdjustNarrativeThread
  • AdjustNarrativeSignificance
  • RegisterForeshadowing
  • RequestOperatorAttention
  • anything else → rejected
≤ 5
entities per action
± 0.15
tension per nudge
0
player state reachable
05

Generative content pipeline

The content pipeline orchestrates the best image, audio, video and language models into game-ready content that fits Janus component contracts. Describe what you want, compose proven building blocks, then refine any single knob. The same pipeline powers all 17 tools in Janus Studio, with prompt-IP lint, AI marking, fingerprints and a provenance record on every asset.

  • Describe → compose → refine, with every module explicit and editable
  • Vendor-agnostic service ports with multi-provider fallback
  • Provenance record per asset: model, prompt, settings and cost
  • Exports to Bevy, Phaser and Godot
Describe → compose → refine
01
Describe
Plain language, any detail
02
Compose
Proven modules, selected for you
03
Refine
Turn one knob, keep the rest
The same pipeline powers all 17 Janus Studio tools
Exports: Bevy · Phaser · Godot
06

Identity Anchor

Identity Anchor pairs AI-native characters with cryptographically verified players. It ships standalone with Ed25519 signatures and post-quantum Dilithium ready, and plugs into the IDFire Identity Platform when you want it. It is opt-in and configured at runtime, so a single-player prototype pays nothing for it.

  • Standalone Ed25519 by default; Dilithium for post-quantum readiness
  • Opt-in, runtime-configured
  • Integrates with the IDFire Identity Platform
  • Capability tokens that only ever narrow when delegated
Identity, your way
  • Ed25519Default signatures. Standalone, fast, battle-tested.Default
  • DilithiumPost-quantum signatures, ready when you are.PQ-ready
  • IDFire Identity PlatformVerified-real players across your games, when you want it.Optional
07

Audit-anchored AI decisions

Audit-before-commit is non-negotiable in Janus: if the audit entry cannot be written, the change does not happen. Standalone, decisions go to a local append-only signed log with checkpoint rotation; integrated, they anchor to a Merkle transparency log. You can always answer "why did that character do that?"

  • Audit completeness is exactly one entry per committed intent
  • Fail-closed by default
  • Local signed log or Merkle transparency anchoring
  • Built for regulated markets and trust-critical games
audit.log — one entry per committed intent
{
  "epoch": 184223,
  "intent": "SurfaceOpportunity",
  "origin": "director",
  "capability": "narrative.surface:region",
  "stages": ["decode", "schema", "capability", "epoch", "legality", "forecast", "commit"],
  "forecast": {
    "epochs": 5,
    "invariants": "ok"
  },
  "committed": true,
  "signature": "ed25519:9f2c…41ab",
  "prev": "sha256:7d1e…c09f"
}
08

Rust + Bevy foundation

Janus is written in Rust and stands on Bevy and Rapier, behind trait surfaces Janus owns, so the core stays fast, memory-safe and swappable. Gameplay state uses fixed-point transforms for bit-identical replays on the same architecture. Game definitions and module manifests are text, so git just works.

  • Rust core on Bevy with Rapier physics
  • Fixed-point transforms; deterministic replays
  • Machine-readable module manifests: pick the what, defer the how
  • Text-based, git-mergeable game definitions
janus.module.toml
# Every module describes itself, so Janus can pick it from a sentence
[module]
name = "grudge-memory"
purpose = "Characters remember who wronged them, and act on it"
triggers = ["hold grudges", "remember insults"]
capability = "memory.long_term"

[presets.forgiving]
decay_days = 3

[presets.never_forgets]
decay_days = 0
Platforms

Ship where your players are.

Janus builds on Bevy's cross-platform foundation, and Janus Studio exports straight into the engines you already use.

Windows
macOS
Linux
Web (WASM)
iOS
Android
Janus Studio exports: Bevy · Phaser · Godot atlases, frames, GLB, WAV and playable HTML5.
Ownership, in writing

The engine is ours. Everything you make with it is yours.

Your game, your IP

Everything you build and everything Janus generates for you belongs to you. Commercial use included.

Never retroactive

License terms you ship under are the terms you keep. No surprise runtime fees, no per-install or per-player charges.

Text all the way down

Game definitions and module manifests are plain text. Diff them, review them, merge them. Git just works.

Inspectable AI

No black boxes: every module stays explicit and editable, and every authority-bearing AI decision is on the record.

Free until your game earns $1M, then a simple 5% royalty, or a custom license. See licensing →

Build your world on Janus.

Get engine access for your studio, or start making in Janus Studio right now.