Skip to content

Replace six Canvas gameplay renderers with native Three.js scenes - #10

Merged
EmergentMonk merged 35 commits into
mainfrom
codex/native-three-gameplay
Sep 27, 2026
Merged

EmergentMonk merged 35 commits into
mainfrom
codex/native-three-gameplay

Conversation

@EmergentMonk

Copy link
Copy Markdown
Member

The six legacy browser titles still rendered their playable worlds with Canvas 2D underneath a decorative Three.js stage. This PR replaces those drawing paths with native Three.js gameplay scenes while preserving the existing simulations, controls, audio, progression and replay boundaries.

Game Simulation Primary gameplay renderer Camera Native Three.js entities Legacy Canvas gameplay renderer
BLACKSTAR_AGA Existing fixed-point campaign and receipts Three.js/WebGL Perspective FPS Rooms, doors, enemy models, pickups, exit console, weapon models and combat effects No
CARTRIDGE_ZERO All seven existing canonical programs and CZ01 receipts Three.js/WebGL Orthographic with cabinet projection Bricks/paddle/ball; lanes/ships; formations; river banks/fuel/towers; tanks/walls/shells; aircraft/boats/subs/turrets No
PIXELWARFRONT Existing deterministic RTS and command receipts Three.js/WebGL Orthographic with cabinet projection Terrain, resources, buildings, units, bullets, selection/order indicators, health and construction bars No
VECTOR_ZERO Existing fixed-point 6DOF mines and VZ02 receipts Three.js/WebGL Perspective using simulation orientation basis Mine surfaces and seams, enemies, cores/supplies, projectiles, exit lattice and cockpit No
SEEDSTORM Existing fixed-tick shooter and receipts Three.js/WebGL Orthographic Extruded player and enemy silhouettes, bullets, pickups, health/focus indicators, explosions, bomb wave and terrain No
SUBSPACE / INERTIA ZERO Existing 60 Hz inertial combat and campaign Three.js/WebGL Following orthographic Eight hull silhouettes, obstacles, objectives, ordnance, pickups, shields, trails, explosions and offscreen threats No

All six core.js files are unchanged. SIGNAL BREACH, Ternary Drift web, and the separate native Windows renderer retain their existing architectures.

Architecture and visuals

  • Each game has a dedicated renderer.js adapter driven by its existing update loop.
  • QsolNative.Stage creates the WebGLRenderer on the original gameplay canvas, a Scene and an appropriate Camera. Repeated entities use persistent, growing-on-demand InstancedMesh batches.
  • Retire qsol-three-stage.js, its translucent overlay CSS and the six unused overlay-sampler script references.
  • BLACKSTAR now has real rooms, depth occlusion, faceted opposition and camera-relative weapons. VECTOR uses BufferGeometry mine surfaces, LineSegments seams and native 6DOF perspective.
  • CARTRIDGE retains seven separate designs with beveled geometry and visible depth. PIXELWARFRONT gains raised structures, faceted resources and world command indicators. SEEDSTORM keeps its craft outlines as extruded geometry over an industrial canyon. SUBSPACE uses its original eight silhouettes as hull geometry.
  • Handle CSS dimensions, capped DPR, live reduced-motion preferences, WebGL context recovery and resource/listener disposal. Replacement mine meshes are disposed on sector changes.

UI / remaining 2D canvas usage

There is no 2D-canvas usage in the six migrated titles, including offscreen texture generation. Conventional HUDs and controls remain HTML; tactical maps/radar use SVG. In-world indicators remain WebGL geometry. There is no CanvasTexture, second gameplay canvas or retained Canvas drawing path.

Executed validation

  • All existing JavaScript core/offline suites: BLACKSTAR, CARTRIDGE, PIXELWARFRONT, VECTOR, SEEDSTORM, SIGNAL BREACH and Ternary Drift web.
  • SUBSPACE core tests and its 600-tick simulation/AI/system/objective harness. The latter now explicitly stubs presentation and makes no rendering claim.
  • Native Ternary Drift C determinism test via make -C TERNARYDRIFT test.
  • Rust sampler unit/doc tests via cargo test --manifest-path SIGNAL_BREACH/rust/Cargo.toml --locked (available local Rust 1.74.1).
  • All six existing Playwright browser suites: startup, live controls/combat, seven cartridge programs, RTS selection/building/production, pause/restart, receipt playback and mobile layout.
  • New static dependency-graph gate: exactly one gameplay canvas; no 2D context acquisition, CanvasTexture, OffscreenCanvas or old overlay dependency.
  • New real-WebGL suite for all six: reject every 2D-context request; inspect actual renderer/scene/camera types; verify populated gameplay groups and finite instance matrices; compare instance coordinates with simulation state; read GPU pixels; hide gameplay groups and verify substantial framebuffer loss; test resize, live reduced-motion changes, context loss/recovery, repeated scene synchronization without geometry growth or state mutation, and disposal.
  • Screenshot review for visual depth and game-specific identity; git diff --check and JavaScript syntax checks.

Local browser runs used Chromium 153 with software WebGL through an isolated loopback HTTP server. Existing browser tests retain direct-file startup as their default; repository CI exercises that path. Tests accept an explicit browser executable and test origin without changing production runtime. Two timing-sensitive browser assertions now wait for simulation behavior / replay duration rather than short fixed delays.

The new Native Three.js gameplay workflow retains screenshots as an artifact. The per-title source audit, scene inventories, lifecycle contract and validation commands are documented in docs/NATIVE_RENDERING.md, with corrected root and game READMEs.

Final removal gate: for every migrated title, removing the sole Three.js canvas removes the actual rendered game world. Only conventional interface elements remain. The framebuffer ablation check also verifies that the native gameplay groups materially produce the image.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @EmergentMonk, your pull request is larger than the review limit of 150,000 diff characters

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T05:17:03.530235Z 39e360f Manual request
🔒 Security Review ✅ Completed 2026-09-27T03:47:45.841317Z ae26e0e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae26e0ecaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shared/qsol-native.js
Comment thread shared/qsol-native.css
@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28feeeabd7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread BLACKSTAR_AGA/renderer.js Outdated
Comment thread PIXELWARFRONT/renderer.js Outdated
Comment thread shared/qsol-native.js Outdated
@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 58377da00d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shared/qsol-native.js Outdated
Comment thread SEEDSTORM/app.js Outdated
@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36c921e5a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread BLACKSTAR_AGA/app.js Outdated
Comment thread VECTOR_ZERO/app.js Outdated
Comment thread PIXELWARFRONT/app.js Outdated
Comment thread SUBSPACE/renderer.js Outdated
Comment thread BLACKSTAR_AGA/renderer.js Outdated
Comment thread VECTOR_ZERO/renderer.js Outdated
@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 39e360fee9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@EmergentMonk
EmergentMonk merged commit ea04e1d into main Sep 27, 2026
16 checks passed
@EmergentMonk
EmergentMonk deleted the codex/native-three-gameplay branch September 27, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant