@vib3code/sdk 2.0.3-canary.d0c4221 → 2.0.3-canary.d677f12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/DOCS/AGENT_HARNESS_ARCHITECTURE.md +2 -0
  2. package/DOCS/ANDROID_DEPLOYMENT.md +59 -0
  3. package/DOCS/ARCHITECTURE.md +1 -0
  4. package/DOCS/CI_TESTING.md +2 -0
  5. package/DOCS/CLI_ONBOARDING.md +2 -0
  6. package/DOCS/CONTROL_REFERENCE.md +2 -0
  7. package/DOCS/CROSS_SITE_DESIGN_PATTERNS.md +2 -0
  8. package/DOCS/ENV_SETUP.md +2 -0
  9. package/DOCS/EPIC_SCROLL_EVENTS.md +2 -0
  10. package/DOCS/EXPANSION_DESIGN.md +2 -0
  11. package/DOCS/EXPANSION_DESIGN_ULTRA.md +389 -0
  12. package/DOCS/EXPORT_FORMATS.md +2 -0
  13. package/DOCS/GPU_DISPOSAL_GUIDE.md +2 -0
  14. package/DOCS/HANDOFF_LANDING_PAGE.md +2 -0
  15. package/DOCS/HANDOFF_SDK_DEVELOPMENT.md +2 -0
  16. package/DOCS/LICENSING_TIERS.md +2 -0
  17. package/DOCS/MASTER_PLAN_2026-01-31.md +2 -0
  18. package/DOCS/MULTIVIZ_CHOREOGRAPHY_PATTERNS.md +3 -1
  19. package/DOCS/OBS_SETUP_GUIDE.md +2 -0
  20. package/DOCS/OPTIMIZATION_PLAN_MATH.md +119 -0
  21. package/DOCS/PRODUCT_STRATEGY.md +2 -0
  22. package/DOCS/PROJECT_SETUP.md +2 -0
  23. package/DOCS/README.md +5 -3
  24. package/DOCS/REFERENCE_SCROLL_ANALYSIS.md +2 -0
  25. package/DOCS/RENDERER_LIFECYCLE.md +2 -0
  26. package/DOCS/REPO_MANIFEST.md +2 -0
  27. package/DOCS/ROADMAP.md +2 -0
  28. package/DOCS/SCROLL_TIMELINE_v3.md +2 -0
  29. package/DOCS/SITE_REFACTOR_PLAN.md +2 -0
  30. package/DOCS/STATUS.md +2 -0
  31. package/DOCS/SYSTEM_INVENTORY.md +2 -0
  32. package/DOCS/TELEMETRY_EXPORTS.md +2 -0
  33. package/DOCS/VISUAL_ANALYSIS_CLICKERSS.md +2 -0
  34. package/DOCS/VISUAL_ANALYSIS_FACETAD.md +2 -0
  35. package/DOCS/VISUAL_ANALYSIS_SIMONE.md +2 -0
  36. package/DOCS/VISUAL_ANALYSIS_TABLESIDE.md +2 -0
  37. package/DOCS/WEBGPU_STATUS.md +2 -0
  38. package/DOCS/XR_BENCHMARKS.md +2 -0
  39. package/DOCS/archive/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +1 -34
  40. package/DOCS/archive/DEV_TRACK_ANALYSIS.md +1 -80
  41. package/DOCS/archive/DEV_TRACK_PLAN_2026-01-07.md +1 -42
  42. package/DOCS/archive/SESSION_014_PLAN.md +1 -195
  43. package/DOCS/archive/SESSION_LOG_2026-01-07.md +1 -56
  44. package/DOCS/archive/STRATEGIC_BLUEPRINT_2026-01-07.md +1 -72
  45. package/DOCS/archive/SYSTEM_AUDIT_2026-01-30.md +1 -741
  46. package/DOCS/archive/WEBGPU_STATUS_2026-02-15_STALE.md +1 -38
  47. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-01-31.md +2 -0
  48. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-06.md +2 -0
  49. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-13.md +2 -0
  50. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-15.md +2 -0
  51. package/DOCS/dev-tracks/DEV_TRACK_SESSION_2026-02-16.md +2 -0
  52. package/DOCS/dev-tracks/PERF_UPGRADE_2026-02-16.md +2 -0
  53. package/DOCS/dev-tracks/README.md +2 -0
  54. package/package.json +2 -4
  55. package/src/cli/index.js +59 -5
  56. package/src/experimental/GameLoop.js +72 -0
  57. package/src/experimental/LatticePhysics.js +100 -0
  58. package/src/experimental/LiveDirector.js +143 -0
  59. package/src/experimental/PlayerController4D.js +154 -0
  60. package/src/experimental/VIB3Actor.js +138 -0
  61. package/src/experimental/VIB3Compositor.js +117 -0
  62. package/src/experimental/VIB3Link.js +122 -0
  63. package/src/experimental/VIB3Orchestrator.js +146 -0
  64. package/src/experimental/VIB3Universe.js +109 -0
  65. package/src/experimental/demos/CrystalLabyrinth.js +202 -0
  66. package/src/export/SVGExporter.js +9 -5
  67. package/src/geometry/generators/Crystal.js +2 -2
  68. package/src/geometry/warp/HypersphereCore.js +53 -24
  69. package/src/math/Mat4x4.js +302 -127
  70. package/src/math/Projection.js +39 -4
  71. package/src/math/Rotor4D.js +69 -46
  72. package/src/math/Vec4.js +265 -111
  73. package/src/scene/Node4D.js +74 -24
  74. package/src/testing/ProjectionClass.test.js +38 -0
  75. package/tools/update_projection.py +109 -0
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ Agent Harness Architecture
2
4
 
3
5
  **Purpose**: Close the feedback loop between AI agents and VIB3+ visualization, enabling agents to design ultra-intricate reactive choreographed visuals that would be impractical via manual UI.
@@ -0,0 +1,59 @@
1
+ Last reviewed: 2026-02-17
2
+
3
+ # Building VIB3+ Ultra for Android
4
+
5
+ This guide explains how to build the "Crystal Labyrinth" demo as an Android APK using the existing Flutter integration.
6
+
7
+ ## Prerequisites
8
+
9
+ - Flutter SDK installed
10
+ - Android Studio / Android SDK installed
11
+ - Connected Android device or emulator
12
+
13
+ ## Quick Build (GitHub Actions)
14
+
15
+ The repository includes a workflow `.github/workflows/flutter-apk.yml` that automatically builds an APK on push to `examples/flutter_demo/`.
16
+
17
+ To trigger a build for the Crystal Labyrinth demo:
18
+ 1. Copy the built web assets to the Flutter assets directory (see Local Build below).
19
+ 2. Push changes.
20
+ 3. Download the artifact from the Actions tab.
21
+
22
+ ## Local Build Instructions
23
+
24
+ 1. **Build the Web Demo**
25
+ Run the Vite build to bundle the Crystal Labyrinth demo:
26
+ ```bash
27
+ npm install
28
+ npm run build:web
29
+ ```
30
+ This will output optimized files to `dist/`.
31
+
32
+ 2. **Prepare Flutter Assets**
33
+ Copy the build output to the Flutter project's asset folder:
34
+ ```bash
35
+ mkdir -p examples/flutter_demo/assets/vib3/
36
+ cp -r dist/* examples/flutter_demo/assets/vib3/
37
+ ```
38
+
39
+ 3. **Configure Entry Point**
40
+ Open `examples/flutter_demo/lib/vib3_controller.dart` and ensure the WebView points to the local index file or the deployed GitHub Pages URL:
41
+ `https://<your-username>.github.io/vib3codeSDK/examples/dogfood/crystal_labyrinth.html`
42
+
43
+ 4. **Build APK**
44
+ Navigate to the Flutter directory and build:
45
+ ```bash
46
+ cd examples/flutter_demo
47
+ flutter build apk --release
48
+ ```
49
+
50
+ 5. **Install**
51
+ ```bash
52
+ flutter install
53
+ ```
54
+
55
+ ## VIB3Link Networking on Android
56
+
57
+ For multi-user features (`VIB3Link`) to work on Android:
58
+ - Ensure the device has internet access.
59
+ - If using local dev server, use `adb reverse tcp:5173 tcp:5173` to forward ports.
@@ -0,0 +1 @@
1
+ Last reviewed: 2026-02-17
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # CI and testing guide
2
4
 
3
5
  This guide outlines the baseline CI/test expectations for the project and a recommended set of
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # Agentic CLI onboarding
2
4
 
3
5
  This guide aligns the current CLI surface (package scripts and telemetry helpers) with an agentic workflow. It is intentionally explicit so automation agents and humans can share the same runbook.
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # Control & API Reference
2
4
 
3
5
  This document walks through every control surface in `index.html` and the JavaScript entry points they call so you can quickly map UI inputs to runtime behavior.
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # Cross-Site Design Pattern Synthesis
2
4
 
3
5
  **Based on actual visual analysis of 4 reference sites via Playwright screenshots**
package/DOCS/ENV_SETUP.md CHANGED
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # Environment setup (Firebase, gcloud, Flutter, Android, GH CLI)
2
4
 
3
5
  This doc provides a **copy/paste** bootstrap script to install and configure:
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # EPIC SCROLL EVENTS — VIB3+ Landing Page Choreography Plan
2
4
 
3
5
  **20 scroll-driven events that combine GSAP, GPU visualizers, CSS effects, and masking layers
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ Premium Tier — Expansion Design Document
2
4
 
3
5
  **Purpose**: Technical specification for `@vib3code/premium`, a separate npm package that extends the free `@vib3code/sdk` with fine-grained shader control, axis locking, per-layer geometry, event-triggered state changes, and live CSS/framework integration.
@@ -0,0 +1,389 @@
1
+ Last reviewed: 2026-02-17
2
+
3
+ # VIB3+ Ultra — The Emergent Media Engine
4
+
5
+ **Purpose**: This document defines the **Ultra Tier** expansion for VIB3+. While the Premium Tier (`EXPANSION_DESIGN.md`) focuses on professional visualization tools, the Ultra Tier transforms the SDK into a **full-stack emergent media engine** capable of powering 4D video games, generative cartoons, and multi-user hallucinations.
6
+
7
+ **Status**: Vision Document / Technical Specification.
8
+ **Dependencies**: Requires `@vib3code/sdk` (core) and `@vib3code/premium` (for fine-grained control).
9
+
10
+ ---
11
+
12
+ ## I. Architecture: The VIB3 Universe
13
+
14
+ The core shift is from **Single Instance** to **Orchestrated Universe**.
15
+
16
+ ### The Concept
17
+ Instead of "a canvas on a page," we treat the browser window as a **Universe** containing multiple **Entities** (VIB3 instances). These entities share a clock, a physics lattice, and a narrative context.
18
+
19
+ ### The `VIB3Orchestrator`
20
+ A new singleton that manages the lifecycle and coordination of all VIB3 instances.
21
+
22
+ ```javascript
23
+ class VIB3Orchestrator {
24
+ constructor() {
25
+ this.entities = new Map(); // id -> VIB3Entity
26
+ this.clock = new MasterClock({ bpm: 120 }); // Shared beat sync
27
+ this.physics = new LatticePhysicsEngine(); // 4D collision detection
28
+ this.link = new VIB3Link(); // WebRTC multi-user sync
29
+ }
30
+
31
+ // Spawn a new entity (actor, prop, or environment)
32
+ spawn(type, config) { ... }
33
+
34
+ // Global tick loop
35
+ tick(deltaTime) {
36
+ this.physics.update(this.entities, deltaTime);
37
+ this.entities.forEach(e => e.update(deltaTime));
38
+ this.link.sync(this.entities);
39
+ }
40
+ }
41
+ ```
42
+
43
+ ---
44
+
45
+ ## II. HyperNarrative: Animating Stories & Cartoons
46
+
47
+ VIB3+ can tell stories. Characters are not mesh rigs but **VIB3 Actors** — distinct visualization instances with "souls" (parameter personalities) that express emotion through math.
48
+
49
+ ### 1. The `VIB3Actor`
50
+ Wraps a `VIB3Engine` instance with identity, role, and emotional state.
51
+
52
+ ```javascript
53
+ class VIB3Actor {
54
+ constructor(engine, personalityProfile) {
55
+ this.engine = engine;
56
+ this.profile = personalityProfile; // e.g., 'AnxiousGlitch', 'StoicCrystal'
57
+ this.emotion = { valence: 0, arousal: 0 }; // -1 to 1
58
+ this.voice = new AudioEmitter(); // Spatial audio source
59
+ }
60
+
61
+ // Express an emotion (modulates parameters based on profile)
62
+ emote(emotionName, intensity) {
63
+ const params = this.profile.mapEmotion(emotionName, intensity);
64
+ this.engine.transition(params, 500, 'easeOut');
65
+ }
66
+
67
+ // "Speak" with audio-reactive mouth modulation
68
+ speak(audioBuffer) {
69
+ this.voice.play(audioBuffer);
70
+ this.voice.onAnalysis((amplitude) => {
71
+ // Modulate geometry to simulate speech/expression
72
+ this.engine.setParameter('morphFactor', 0.5 + amplitude * 1.5);
73
+ this.engine.setParameter('intensity', 0.6 + amplitude * 0.4);
74
+ });
75
+ }
76
+ }
77
+ ```
78
+
79
+ ### 2. The Script Format (`.vib3script`)
80
+ A JSON-based screenplay format that controls actors, cameras, and environment.
81
+
82
+ ```json
83
+ {
84
+ "title": "The Geometric Encounter",
85
+ "bpm": 110,
86
+ "cast": {
87
+ "Hero": { "system": "faceted", "geometry": 0, "profile": "heroic" },
88
+ "Villain": { "system": "quantum", "geometry": 16, "profile": "chaotic" }
89
+ },
90
+ "sequence": [
91
+ {
92
+ "time": "0:00",
93
+ "action": "camera_cut",
94
+ "target": "Hero",
95
+ "shot": "close_up" // Adjusts zoom/projection
96
+ },
97
+ {
98
+ "time": "0:02",
99
+ "actor": "Hero",
100
+ "action": "speak",
101
+ "text": "Why do you disturb the lattice?",
102
+ "audio": "hero_line_1.mp3",
103
+ "emotion": "stern"
104
+ },
105
+ {
106
+ "time": "0:05",
107
+ "actor": "Villain",
108
+ "action": "emote",
109
+ "emotion": "rage",
110
+ "intensity": 0.8 // Triggers red hue, high chaos, spike geometry
111
+ }
112
+ ]
113
+ }
114
+ ```
115
+
116
+ ### 3. LipSync & Performance
117
+ Use `WebAudioAPI` analysis on dialogue tracks to drive `morphFactor` (mouth opening) and `intensity` (energy).
118
+ - **Consonants (High Freq)**: Trigger `chaos` spikes (sharp edges).
119
+ - **Vowels (Mid Freq)**: Trigger `morphFactor` swells (round shapes).
120
+ - **Volume**: Drives `gridDensity` (louder = larger/closer).
121
+
122
+ ---
123
+
124
+ ## III. HyperGame: FPV Gameplay Engine
125
+
126
+ Transform VIB3+ from a passive visualizer into an active **4D Game Engine**.
127
+
128
+ ### 1. 4D Player Controller (`FPVController`)
129
+ Maps WASD + Mouse to 6D motion, allowing navigation *through* the hyperspace lattice.
130
+
131
+ - **W/S**: Move forward/back in Z (depth).
132
+ - **A/D**: Strafe in X.
133
+ - **Space/Shift**: Move in Y (up/down).
134
+ - **Q/E**: Rotate in XW plane (portal strafe).
135
+ - **Mouse**: Rotate XY (look left/right) and YZ (look up/down).
136
+
137
+ ```javascript
138
+ // Inside game loop
139
+ if (input.forward) {
140
+ // Move "camera" through 4D noise space
141
+ // We don't move geometry; we offset the noise coordinate system!
142
+ uniforms.u_noiseOffset.z += speed * dt;
143
+ }
144
+ if (input.portalLeft) {
145
+ // Rotate the entire world in 4D
146
+ uniforms.u_rot4dXW += rotationSpeed * dt;
147
+ }
148
+ ```
149
+
150
+ ### 2. Lattice Physics (`LatticeCollider`)
151
+ Collision detection is not mesh-based (too expensive/abstract). It is **Function-Based**.
152
+ Since VIB3+ geometries are defined by math functions (SDFs or lattice grids), we check the player's coordinate against the active function.
153
+
154
+ ```javascript
155
+ function checkCollision(playerPos, activeGeometry) {
156
+ // Sample the density function at player position
157
+ const density = getDensityAt(playerPos, activeGeometry);
158
+ if (density > 0.8) {
159
+ // Hit a "solid" part of the fractal/lattice
160
+ return true;
161
+ }
162
+ return false;
163
+ }
164
+ ```
165
+
166
+ ### 3. Entity System
167
+ Game objects are lightweight VIB3 instances or simplified shader particles.
168
+ - **Projectiles**: Small `Quantum` instances (single particle geometry) moving in XYZW.
169
+ - **Pickups**: `Faceted` geometries (spinning crystals) that trigger events on collision.
170
+ - **Enemies**: `Holographic` instances that track player position.
171
+
172
+ ### 4. Game State Manager
173
+ Tracks score, health, and inventory.
174
+ - **Health**: Low health = high `chromaticAberration` + desaturation + `glitch` effect.
175
+ - **Powerup**: Ingesting a "hypercube" powerup transitions the player's view to `HyperMode` (geometry 17, max color).
176
+
177
+ ---
178
+
179
+ ## IV. Emergent Media: AI & Multi-User Sync
180
+
181
+ The final frontier: VIB3+ experiences that are alive, shared, and intelligent.
182
+
183
+ ### 1. VIB3Link (Multi-User Hallucination)
184
+ Uses WebRTC/WebSockets to synchronize the `VIB3Orchestrator` state across clients.
185
+ - **Shared Seed**: All clients start with same RNG seed.
186
+ - **Input Sync**: Player A's rotation is broadcast to Player B.
187
+ - **State Consensus**: "If Player A explodes the star, Player B sees it explode."
188
+
189
+ **Use Case**: A shared "VR" room (on flat screens) where users float in a 4D chatroom, represented by their `VIB3Actor` avatars.
190
+
191
+ ### 2. The Live Director (AI Agent)
192
+ An autonomous agent (MCP-connected) that watches the "audience" (user input, webcam, mic) and adjusts the show.
193
+
194
+ - **Sentiment Analysis**: If audience audio is loud/happy -> increase `speed` and `saturation`.
195
+ - **Attention Tracking**: If user stops interacting -> trigger `FocusLock` or `Explosion` to regain attention.
196
+ - **Generative Scripting**: The AI writes the `.vib3script` in real-time based on a prompt ("Make it scary", "Make it romantic").
197
+
198
+ ---
199
+
200
+ ## V. New MCP Tools for Ultra Tier
201
+
202
+ To empower agents to build these experiences, we add the following tools:
203
+
204
+ ### `spawn_actor`
205
+ Creates a `VIB3Actor` with a specific personality and role.
206
+ ```json
207
+ { "role": "protagonist", "personality": "glitch_witch", "system": "holographic" }
208
+ ```
209
+
210
+ ### `direct_scene`
211
+ Issues a high-level direction to the `LiveDirector`.
212
+ ```json
213
+ { "mood": "increasing_tension", "pacing": "frenetic", "focus_target": "villain" }
214
+ ```
215
+
216
+ ### `configure_game_rules`
217
+ Sets up the `HyperGame` mechanics.
218
+ ```json
219
+ { "physics": "lattice_heavy", "collision_damage": 10, "goal": "collect_shards" }
220
+ ```
221
+
222
+ ### `sync_session`
223
+ Initializes `VIB3Link` for a multi-user session.
224
+ ```json
225
+ { "room_id": "lobby_1", "max_users": 4, "sync_mode": "strict" }
226
+ ```
227
+
228
+ ---
229
+
230
+ ## VI. Deep Multilayer Architecture
231
+
232
+ To support `VIB3Universe`, we need a robust system for managing interactions between multiple VIB3 instances. This is not just visual layering; it's logic layering.
233
+
234
+ ### 1. Visual Compositing (`VIB3Compositor`)
235
+ Managing 10+ layers (e.g., 2 instances × 5 holographic layers) requires a dedicated compositor to avoid DOM explosion and Z-fighting.
236
+
237
+ * **Render Targets**: Instead of rendering directly to the DOM, each VIB3 instance renders to an offscreen canvas.
238
+ * **Unified Stage**: The Compositor draws these offscreen buffers onto a single `GlobalCanvas` using WebGL blending.
239
+ * **Depth Sorting**: Instances are sorted by their "World Z" coordinate.
240
+ * **Masking**: Instances can mask each other (e.g., a character standing behind a portal).
241
+
242
+ ```javascript
243
+ class VIB3Compositor {
244
+ registerInstance(instanceId, textureSource) { ... }
245
+ setLayerOrder(instanceIds) { ... }
246
+ render() {
247
+ // Draw background instances
248
+ // Draw foreground instances with blending
249
+ // Apply global post-processing (unifying the look)
250
+ }
251
+ }
252
+ ```
253
+
254
+ ### 2. Logic Layering (`LoopCoordinator`)
255
+ We have three distinct loops running at different frequencies:
256
+ 1. **Physics Loop (Fixed Step, 60hz)**: Collision detection, movement integration. Deterministic for multiplayer sync.
257
+ 2. **Narrative Loop (Event Driven)**: Script execution, state machine transitions.
258
+ 3. **Reactive Loop (Frame Rate)**: Audio analysis, visual parameter smoothing.
259
+
260
+ The `VIB3Orchestrator` must prioritize these:
261
+ * Physics updates *must* happen before Visual updates.
262
+ * Narrative events trigger Physics state changes.
263
+
264
+ ### 3. State Hydration (`UniverseSerializer`)
265
+ Saving a multi-instance universe is complex. We need a schema that captures the relationships, not just individual parameters.
266
+
267
+ ```json
268
+ {
269
+ "universe_id": "u_8823",
270
+ "timestamp": 12044,
271
+ "entities": [
272
+ { "id": "hero", "type": "actor", "pos": [0,0,0], "params": {...} },
273
+ { "id": "world", "type": "environment", "params": {...} }
274
+ ],
275
+ "global_state": {
276
+ "gravity": 9.8,
277
+ "tension": 0.4
278
+ }
279
+ }
280
+ ```
281
+
282
+ This allows "save games" for HyperGame and "bookmarks" for HyperNarrative.
283
+
284
+ ---
285
+
286
+ ## VII. VIB3Link Protocol
287
+
288
+ VIB3Link uses WebRTC DataChannels for low-latency state synchronization between clients in a `VIB3Universe`.
289
+
290
+ ### Protocol Message Format
291
+
292
+ Messages are JSON-encoded packets:
293
+ ```json
294
+ {
295
+ "t": "type", // 'update', 'event', 'sync'
296
+ "s": 1023, // sequence number (for ordering)
297
+ "p": { ... } // payload
298
+ }
299
+ ```
300
+
301
+ ### Core Message Types
302
+
303
+ 1. **Entity Update (`upd`)**: High-frequency (20Hz) updates of position/rotation.
304
+ ```json
305
+ { "t": "upd", "id": "actor_1", "pos": [x,y,z], "rot": [x,y,z,w] }
306
+ ```
307
+ 2. **Parameter Delta (`prm`)**: When a visual parameter changes.
308
+ ```json
309
+ { "t": "prm", "id": "actor_1", "k": "chaos", "v": 0.8 }
310
+ ```
311
+ 3. **Universe Event (`evt`)**: Narrative triggers or game events.
312
+ ```json
313
+ { "t": "evt", "n": "explosion", "loc": [10, 0, 5], "pow": 0.9 }
314
+ ```
315
+
316
+ ### Synchronization Strategy
317
+
318
+ * **Authority**: One client is the **Host** (orchestrator). Others are **Peers**.
319
+ * **Prediction**: Peers predict entity movement based on velocity.
320
+ * **Reconciliation**: If Peer state diverges > threshold from Host state, snap to Host.
321
+ * **Interpolation**: Visuals render at `t - buffer` to ensure smooth interpolation between network packets.
322
+
323
+ ---
324
+
325
+ ## VIII. HyperGame Engine
326
+
327
+ The VIB3+ Ultra HyperGame Engine enables 4D First-Person View (FPV) experiences. It decouples the physics simulation from the render loop and provides a 4D-native player controller.
328
+
329
+ ### 1. The Game Loop (`GameLoop`)
330
+ A fixed-timestep loop for physics and logic, separate from the variable-timestep render loop. This ensures deterministic physics and smooth rendering even under load.
331
+
332
+ ```javascript
333
+ class GameLoop {
334
+ constructor(updateFn, renderFn) {
335
+ this.accumulator = 0;
336
+ this.step = 1 / 60; // 60hz physics
337
+ }
338
+ // ... accumulates time and calls update() multiple times if needed
339
+ }
340
+ ```
341
+
342
+ ### 2. Lattice Physics (`LatticePhysics`)
343
+ Physics in VIB3+ is not about mesh-mesh intersection. It is about **Point-Field intersection**. We define the world as a scalar field (density) and check if the player's 4D point is inside a high-density region.
344
+
345
+ * **Collision**: `getDensity(pos) > threshold`
346
+ * **Gravity**: Constant force in -Y (or arbitrary 4D vector)
347
+ * **Friction**: Velocity decay
348
+
349
+ ### 3. Player Controller 4D (`PlayerController4D`)
350
+ Handles input mapping for 6-degree-of-freedom movement.
351
+
352
+ * **Input**: WASD (Translation), Mouse (Rotation), QE (Portal/4D Rotation).
353
+ * **State**: Position (Vec4), Rotation (Rotor4D/Quat).
354
+ * **Smoothing**: Inputs are smoothed to prevent motion sickness in 4D space.
355
+
356
+ ```javascript
357
+ update(dt) {
358
+ // Apply inputs to velocity
359
+ // Apply physics (gravity, friction)
360
+ // Integrate position: pos += vel * dt
361
+ // Resolve collisions: if (collision) pos -= normal * penetration
362
+ }
363
+ ```
364
+
365
+ ---
366
+
367
+ ## IX. Demo: The Crystal Labyrinth
368
+
369
+ A vertical slice demo showcasing all Ultra capabilities in one cohesive experience.
370
+
371
+ ### Story & Premise
372
+ The player is a **Lattice Runner** navigating a fractured 4D hyperspace maze. The goal is to collect **Resonance Crystals** (Facet engines) while avoiding **Void Shadows** (Holographic engines) that hunt based on noise (movement speed).
373
+
374
+ ### Gameplay Loop
375
+ 1. **Explore**: Navigate the 4D maze using WASD+Mouse+QE.
376
+ 2. **Collect**: Find blue crystals. Touching one triggers a `VIB3Actor` "Collection" animation (implosion + sound).
377
+ 3. **Evade**: Red "Shadows" drift towards you. If they touch you, the screen glitches (`chromaticAberration` spike) and health drops.
378
+ 4. **Win**: Collect 5 crystals to stabilize the universe (trigger "Victory" state).
379
+
380
+ ### Technical Integration
381
+ * **Universe**: One `VIB3Universe` managing the Player, 5 Crystal Actors, and 3 Shadow Actors.
382
+ * **Physics**: `LatticePhysics` handles wall collisions (fractal noise walls).
383
+ * **AI**: `LiveDirector` adjusts Shadow aggression based on player movement speed (stealth mechanic).
384
+ * **Networking**: (Optional) `VIB3Link` allows a spectator to watch the runner.
385
+
386
+ ---
387
+
388
+ *VIB3+ Ultra — The Future of Emergent Media*
389
+ *Draft v5.0 — Added Crystal Labyrinth Demo Design — Feb 16, 2026*
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # Export formats
2
4
 
3
5
  This reference documents the target export formats supported by the agentic pipelines and how they are validated.
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # GPU disposal patterns
2
4
 
3
5
  This guide documents safe GPU resource disposal patterns to prevent memory leaks across rendering backends.
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ Landing Page & Marketing Handoff Prompt
2
4
 
3
5
  **Copy this entire document as the initial prompt when starting a new session focused on the landing page, marketing site, and forward-facing aspects.**
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ SDK — Comprehensive Agent Handoff
2
4
 
3
5
  **Copy this entire document as the initial prompt when starting a new session focused on SDK development.**
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # Licensing tiers (draft)
2
4
 
3
5
  This document outlines the proposed licensing tiers for the VIB3+ SDK and agentic tooling. It is intended as a working draft for Phase 5.
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ CORE — Master Plan & Full Audit
2
4
 
3
5
  **Date**: January 31, 2026
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ Multi-Visualizer Choreography Patterns
2
4
 
3
5
  **Generated: 2026-02-09**
@@ -11,7 +13,7 @@
11
13
  1. [Depth Illusion Engine](#1-depth-illusion-engine)
12
14
  2. [Multi-Visualizer Coordination Modes](#2-multi-visualizer-coordination-modes)
13
15
  3. [Section-by-Section Choreography Upgrades](#3-section-by-section-choreography-upgrades)
14
- 4. [Accent & Texture Effects Library](#4-accent--texture-effects-library)
16
+ 4. [Accent & Texture Effects Library](#4-accent-texture-effects-library)
15
17
  5. [Mathematical Intertwining Functions](#5-mathematical-intertwining-functions)
16
18
  6. [Implementation Priority Map](#6-implementation-priority-map)
17
19
 
@@ -1,3 +1,5 @@
1
+ Last reviewed: 2026-02-17
2
+
1
3
  # VIB3+ OBS Setup Guide
2
4
 
3
5
  Use VIB3+ as a live visualization overlay in OBS Studio.