Simulation & World Building
A game world runs on several independent clocks at once, and keeping them in agreement is the hard part. A day/night cycle, drifting seasons, a deep-time strategy map, and a shared multiplayer world state are all the same problem at different scales — and they drift apart the moment frame rate stutters, a server restarts, or two instances disagree about when things happened. temporalBLOCK gives your simulation a single multi-scale coordinator: feed it your world's epoch and tick rate, and it returns one coordinate spanning sub-second pulses to geologic epochs, deterministic in elapsed time and identical across every server.
Why a hosted clock?
Three properties are hard to get right by yourself and easy to get from one endpoint:
- Determinism. The simulation stamp is a pure function of
elapsedRealMs— the same inputs always return the same coordinate. The server never reads its own wall clock for this call, so replays and lock-step multiplayer stay reproducible. - One coordinate, every scale. A single response carries every rung from sub-second pulses up to the millennium scale, so your physics step, your in-world calendar, and your epoch UI all read from the same source of truth.
- Isolation. The simulation surface is structurally separate from the real anchored "now" — reversed time and arbitrary rescaling are allowed here because they never touch the live anchor or any stateful feature.
Pick your engine
TemporalBlockClient.cs (from sdk/unity/) into your project's Assets/ folder — single file, zero dependencies, uses UnityWebRequest.Day/night cycle
One in-world day in 20 real minutes — pick a rate, sample the sim clock about once a second, and drive your sun from the returned phase.
using TemporalBlock;
using UnityEngine;
// A day/night cycle where one in-world day lasts 20 real minutes.
// 24h of world time = 86_400_000 sim ms; 20 real min = 1_200_000 ms.
// rate = 86_400_000 / 1_200_000 = 72 (world ms per real ms).
public class DayNightCycle : MonoBehaviour
{
private TemporalBlockClient _tb;
private float _elapsedRealMs;
private void Start()
{
_tb = new TemporalBlockClient("tblk_live_yourkeyhere");
}
private async void Update()
{
_elapsedRealMs += Time.deltaTime * 1000f;
// Sample roughly once per second, not every frame.
if (Time.frameCount % 60 != 0) return;
string json = await _tb.SimStampAsync(
epochMs: 0,
rate: 72,
elapsedMs: _elapsedRealMs);
// Parse json (e.g. with JsonUtility) and drive your sun's
// rotation from the returned "day" / "hour" rung phase.
Debug.Log(json);
}
}Multi-scale world epoch
A deep-time clock running 100,000 in-world years per real hour. The same response carries every rung from sub-second pulses to the millennium scale.
using TemporalBlock;
using UnityEngine;
// A multi-scale world epoch: the same coordinate spans sub-second
// pulses to geologic epochs. Here a deep-time strategy game runs
// 100_000 in-world years per real hour, anchored 1,000,000 years ago.
public class WorldEpoch : MonoBehaviour
{
private async void Start()
{
var tb = new TemporalBlockClient("tblk_live_yourkeyhere");
// 100_000 yr / real hour. 1 yr ≈ 31_557_600_000 ms;
// 1 real hour = 3_600_000 ms → rate ≈ 876_600.
// Anchor the epoch 1,000,000 years before the Unix epoch.
string json = await tb.SimStampAsync(
epochMs: -31_557_600_000_000.0,
rate: 876_600,
elapsedMs: 3_600_000); // one real hour elapsed
// The response is one coordinate from sub-second rungs all the
// way up to "millennium" — read whichever scale your UI needs.
Debug.Log(json);
}
}World calendar calculator
Describe your world in plain terms and get back the sim rate and a complete calendar definition. Pick a planet preset or set your own day/year. The same math runs on the server at POST /v1/spiral/sim/derive and in the deriveWorldCalendar SDK helper.
1 in-world year = 100 days over 4 seasons (25 days each); 1 day = 6 min real time; sim rate 240 (world-ms per real-ms).
rate = 240Pass as ?rate= to GET /v1/spiral/sim.
{
"id": "world",
"yearDays": 100,
"monthCount": 4,
"weekDays": 7
}POST to /v1/calendars (Standard+), then stamp with ?calendar=custom:world.
/v1/calibrate — all tiersEvery POST /v1/calibrate response bundles a free basic Spiral preview (meta.spiralCoordinate + meta.spiral) at no extra cost. Add includeBridgePreview: true and a bridgePreviewQuery to also get a short briefing with cited sources in meta.bridgePreview — run on our operator key as a rate-limited demo. For production briefings, pass your own syncApiKey to /v1/bridge or /v1/full.
curl -X POST https://api.temporalblock.com/api/v1/calibrate \
-H "Content-Type: application/json" \
-H "X-API-Key: $TEMPORALBLOCK_API_KEY" \
-d '{
"model": "gpt-4o",
"includeBridgePreview": true,
"bridgePreviewQuery": "What are the latest developments in AI hardware?"
}'{
"calibrationBlock": "<paste into your system prompt>",
"resolvedCutoffYear": 2023,
"currentYear": 2026,
"meta": {
"algorithmVersion": "5.0.0",
"spiralCoordinate": {
"scales": ["us","ms","s","min","hr","day","wk","mo","yr","dec","cen","mil"],
"sin": [/* 12 values */],
"cos": [/* 12 values */]
},
"spiral": {
"upgradeReason": "Upgrade to Standard for confidenceBreakdown + syncCyclePhase"
},
"bridgePreview": {
"query": "What are the latest developments in AI hardware?",
"briefing": "<neutralized briefing text>",
"citations": [{ "url": "https://…", "claim": "…", "confidence": "VERIFIED" }],
"evidence": { "tier": "briefing", "sourceCount": 8, "vettedCount": 3 }
}
}
}meta.bridgePreview is omitted — never a 4xx — when the preview is rate-limited. Always check for its presence. meta.spiral.upgradeReason appears on Lite as a plain-language pointer to what Standard+ adds.
Every call needs a TemporalBlock API key. Get one at temporalblock.com. Calibration and the stateless simulation stamp are available on every tier.
REST API reference — GET /v1/spiral/sim
All query parameters are optional. The sim instant is computed as epochSimMs + elapsedRealMs × rate × sign(direction) — deterministic in elapsedRealMs, never reads the server wall clock.
| Parameter | Type | Default | Description |
|---|---|---|---|
| epochSimMs | number | 0 | Sim instant (ms since Unix epoch) the clock's anchor maps to. Any finite value; deep-time epochs encode via the year-only path. |
| rate | number | 1 | Sim ms advanced per real ms. Must be finite and ≥ 0. Use direction to reverse — a negative rate is rejected. |
| direction | "forward" | "reverse" | forward | Direction of sim-time flow. Backward-moving time is permitted because the domain is isolated from the live anchor. |
| elapsedRealMs | number | 0 | Real milliseconds elapsed since the anchor. The sim instant is derived from this value deterministically. |
| precision | string | — | Optional precision floor: us, ms, s, min, hr, day, wk, mo, yr, dec, cen, mil. Ignored on the deep-time year-only path. |
Response includes sim (echoed inputs + computed simInstantMs), resolution, deepTime, year, compact (sin/cos coordinate), spiralString, anchor.sourceLabel: "simulation", and isolation (both affectsAnchoredLoop and affectsStatefulPrimitives are false).
Custom calendars
Your world may not run on Gregorian months. The Spiral encoder accepts a calendar id so your in-world dates, seasons, and year lengths come back in your own system. Pass calendar to the spiral call (or ?calendar= on the REST endpoint).
Temporal Spiral is patent pending — U.S. Provisional Application No. 64/065,213 (filed 2026-05-14).