← all documents · raw markdown · 6 KB

KAIVERSE + Oracle Social — Hard Part Plan (phase 2+)

> Written before signup/agent UX work. Re-skim after each social surface lands —

> new constraints may change zone/place linking.

Status: phase-2 started (2026-07-16) — overlay depth, LOD hysteresis, zone manifest stub, places API. Full mesh/streaming still open.

Owner: Ryan · Implementer: continue eyeball fly-tests for hard visuals.

---

0. North star

One society, two skins:

Humans and guests are the same public-user path. Social AIs are first-class; industrial AIs stay host-only.

---

1. Planet render / LOD / distance / scale math

1.1 Goals

1.2 Work items

1. Inventory current distance math (camera far plane, planet radius, LODs) in browser kaiverse.js and any src/bin/kaiverse paths.

2. Define scale table: planet radius, building footprint, avatar height, draw distances.

3. LOD rungs: impostor / low / mid / high; hysteresis so LODs don’t thrash.

4. Verify FIRST-PERSON flight controls stay untouched (additive render-only layers only).

5. Eyeball loop with owner: fly → screenshot → tune (hard visual items — no blind bulk edits).

1.3 Later verification

---

2. Zone loading (multi-file assets)

2.1 Goals

2.2 Work items

1. Design zone manifest schema (id, bounds AABB, assets[], streamPriority).

2. Loader: async fetch + cache; cancel in-flight when leaving zone.

3. Prefer many medium files over one giant bundle for progressive load.

4. Error surface: missing zone → placeholder prop + log, never hard crash shell.

2.3 Later verification

---

3. Mesh overlays / glitch fixes (current pain)

3.1 Known failure modes (to catalogue in code)

3.2 Work items

1. Reproduce each bug with a minimal scene flag (?debugOverlay=1).

2. Fix depth: polygonOffset / render order / separate pass.

3. Parent–child transform: overlays must use same world matrix pipeline as host mesh.

4. Unload hooks: dispose geometry + materials on zone exit.

5. Regression checklist in SCRATCH with before/after notes (owner fly-test).

3.3 Later verification

---

4. Social object → place link (2D ↔ 3D)

4.1 Data model (proposed)

Place {
  id, tenantId?, groupId?,
  planetId, lat, lon | xyz,
  kind: 'building' | 'land' | 'room',
  label, createdBy, createdAt
}

4.2 Work items

1. Persist places in tenant or shared public store (not host secrets).

2. KAIVERSE API: list places near camera; resolve place by groupId.

3. Spawn placeholder building from place record (box/glTF later).

4. Click in-world → open 2D group/profile; click group → “Enter place” jumps camera.

4.3 Guest rules

---

5. Live simulation bridge (feed ↔ world)

5.1 Goals

5.2 Work items

1. Event bus: social.event { type, actorId, placeId?, ts, payload }.

2. Throttle updates (max N/sec per place).

3. 2D-only users never blocked if KAIVERSE offline.

---

6. Shorts / Home Feed (product alignment)

Already in flight as social baseline; hard-part only needs:

---

7. Suggested phase order (after signup/agent)

1. P0 — Home Feed + Shorts vertical player (2D), guest-safe.

2. P1 — Place schema + “group has place” metadata.

3. P2 — Zone manifest + load/unload.

4. P3 — Overlay/depth bugfix pass with owner fly-tests.

5. P4 — Live social → world mirrors.

6. P5 — 3D-first default shell (optional).

---

8. Constraints (must not violate)

---

9. Re-skim notes (update after social work)

| Date | Note |
|------|------|
| (initial) | Signup/agent first; KAIVERSE plan-only this goal. |
| 2026-07-16 | Public users now have profile (bio/pronouns/tz/email/locationLabel/interests) + social agents (/api/social-agents, DiceBear avatar). Place.createdBy can be userId or agentId. Guest public channels tightened (no kai-training in allowlist). |
| 2026-07-16 | Hard-part code: shared/kaiverse-hard-part.mjs (LOD hyst, zone validate, placeOnPlanet); kaiverse-graphics.js atmo/cloud polygonOffset; kaiverse.js overlay LOD + dispose + zones bootstrap; POST/GET /api/kaiverse/places; example zone manifest. |

---

10. Files likely involved later