Add world delta streaming and viewer smoothing

This commit is contained in:
2026-03-12 19:03:13 -04:00
parent 2fb90162ef
commit 9849dbae61
10 changed files with 966 additions and 177 deletions

View File

@@ -1,6 +1,8 @@
export interface WorldSnapshot {
label: string;
seed: number;
sequence: number;
tickIntervalMs: number;
generatedAtUtc: string;
systems: SystemSnapshot[];
nodes: ResourceNodeSnapshot[];
@@ -9,6 +11,26 @@ export interface WorldSnapshot {
factions: FactionSnapshot[];
}
export interface WorldDelta {
sequence: number;
tickIntervalMs: number;
generatedAtUtc: string;
requiresSnapshotRefresh: boolean;
events: SimulationEventRecord[];
nodes: ResourceNodeDelta[];
stations: StationDelta[];
ships: ShipDelta[];
factions: FactionDelta[];
}
export interface SimulationEventRecord {
entityKind: string;
entityId: string;
kind: string;
message: string;
occurredAtUtc: string;
}
export interface Vector3Dto {
x: number;
y: number;
@@ -41,6 +63,8 @@ export interface ResourceNodeSnapshot {
itemId: string;
}
export interface ResourceNodeDelta extends ResourceNodeSnapshot {}
export interface StationSnapshot {
id: string;
label: string;
@@ -54,6 +78,8 @@ export interface StationSnapshot {
factionId: string;
}
export interface StationDelta extends StationSnapshot {}
export interface ShipSnapshot {
id: string;
label: string;
@@ -61,6 +87,8 @@ export interface ShipSnapshot {
shipClass: string;
systemId: string;
position: Vector3Dto;
velocity: Vector3Dto;
targetPosition: Vector3Dto;
state: string;
orderKind: string | null;
defaultBehaviorKind: string;
@@ -73,6 +101,8 @@ export interface ShipSnapshot {
history: string[];
}
export interface ShipDelta extends ShipSnapshot {}
export interface FactionSnapshot {
id: string;
label: string;
@@ -83,3 +113,5 @@ export interface FactionSnapshot {
shipsBuilt: number;
shipsLost: number;
}
export interface FactionDelta extends FactionSnapshot {}