Skip to content

Claude/takeon game engine editor alsy8q - #2

Merged
Gizmotronn merged 6 commits into
claude/rover-game-module-eq347ofrom
claude/takeon-game-engine-editor-alsy8q
Aug 1, 2026
Merged

Gizmotronn merged 6 commits into
claude/rover-game-module-eq347ofrom
claude/takeon-game-engine-editor-alsy8q

Conversation

@Gizmotronn

Copy link
Copy Markdown
Member

Fair bit of changes here, like Magnum

claude added 6 commits July 31, 2026 20:09
Two things a game built on TakeOn needs: a place to author worlds, and a UI
it can adapt.

Engine (authoring APIs, all pure/DOM-free so they stay testable):
- world/registry.ts — runtime body registry; getBody/listBodies resolve
  registered bodies before built-ins, so editor drafts and backend rows can
  shadow a shipped destination without patching the catalog.
- world/analysis.ts — heightField, slopeField, reachableMask, crossSection and
  analyzeTerrain (relief, slope distribution, drivable fraction for a climb
  limit, surface mix, recoverable resources).
- world/authoring.ts — drafts, validation (errors + playability warnings), the
  BODY_FIELDS inspector schema with dotted get/set, JSON/TS export and import.
- GAME_EVENT_KEYS with a compile-time exhaustiveness guard, so hosts can
  subscribe to every engine event.

@takeon/ui (new): MissionProvider owns the mission (engine loop, HUD snapshot,
toasts, autosave through SyncAdapter) and every component is resolved through
a registry — a parent app can replace, wrap, restyle, relabel or extend any
part of the HUD via TakeOnUIProvider, or drop it entirely and build its own
from useMission(). The Next.js mission page is now a thin host over it.

@takeon/editor (new): TakeOnEditor, a mountable Unity/Godot-shaped tool —
project tree, schema-generated inspector with live validation, isometric scene
view with camera controls and a day/night scrub, elevation/slope/surface/ore/
drivability maps plus raw noise preview and vertical cross-section, terrain
analysis, rover picker, undo/redo, JSON/TS export, and a play mode that boots
a real mission on the edited world with the real HUD. Its panels use the same
slot registry, so hosts can replace those too.

Also: /editor route, optional Electron shell for running the editor as a Mac
app, docs/UI.md + docs/EDITOR.md, refreshed verify skill selectors, CI builds
and publishes the two new packages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8nBHoPvmqenMDt2RJ4whw
…rm card grid

Gameplay UI, styled after Out There: Ω's pulp-comics instrumentation:

- Hex cells for everything you press — the action bank is a two-column
  honeycomb (cells tile at 0.75× height with the second column offset half a
  pitch), and the drive pad matches.
- Segmented resource gauges with icon, uppercase label and tabular readout, in
  one notched instrument rack: power / hull / hold.
- Notched panel frames with hairline neon edges (clip-path, no images), a
  bracketed survey map, comic-caption toasts, modal title bars, and a vignette
  over the scene. Deep-space navy with cyan/amber accents, uppercase condensed
  type. No web fonts and no assets are fetched — the whole look is CSS
  variables, borders and clip-paths, so hosts still retheme it with `--tk-*`.

Editor: everything in line, nothing ragged.

- One grid of uniform cards (scene 2×2, every other panel the same footprint,
  each with a 38px header and its own scroll) replaces the two sidebars.
  Maps, Analysis and Rover are now cards in their own right rather than tabs
  inside a sidebar, so nothing is hidden behind a switch.
- Light chrome by default with a remembered dark toggle; the scene stays dark
  so it reads as a viewport. The app bar above it follows the editor's theme.
- Play mode runs inside the scene card, so entering it doesn't move anything.

Both packages now guard their styling at the boundary: the editor's
bare-element rules are scoped by one class (to beat a host's `button {}`) and
excluded from `.tk-mission` (so they can't repaint the game HUD they host),
and card titles no longer inherit the site's `h2` styling.

Verified in-browser: uniform card geometry at 1600/1440/900px, identical
header heights, no horizontal overflow, play mode + event console, the full
mission flow (drive, mine, build, manifest, end) and mobile at 390×760.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8nBHoPvmqenMDt2RJ4whw
Restructures the engine around the concepts a game engine is expected to
have, without moving a single gameplay rule out of sim/.

Scenes and views:
- scene/ flattens a running mission into renderer-agnostic entities
  (position, height, facing, variant, flags, live ref). buildScene() is pure
  and DOM-free, so a host can draw TakeOn with its own technology.
- render/view.ts defines SceneView (draw, pick, resize, rotate, photo,
  minimap). IsoRenderer implements it, and a new FlatRenderer adds the 2D
  top-down map: hillshaded heightfield, contour shading, grid, scanner reach,
  home pin, entity glyphs. Terrain rasterises once per world change, so a
  frame is one scaled blit plus entities; the map fits the world on open.
- RoverGame.setView('iso'|'flat')/toggleView() switch at runtime over a
  shared camera, so input and host references stay valid. Toggle lives in the
  HUD bar and in the editor's scene card; tile picking works in both.
- Layering test extended: util → world → sim → scene → render → input.

Entities as components:
- The rover moved to render/rover.ts and is assembled from registered parts
  with when/order/sprung, so its look is a function of build and state.
  Hosts add hardware with registerRoverPart instead of forking the painter.
- New detail: cargo crates that stack with the hold, a charge LED strip, hull
  scorch and sparks under damage, a status strobe that reddens in trouble,
  drilling chips, a sweeping dish, a pulsing scanner tip, solar glint, RTG
  heat glow, wheel dust.
- The 2D view has its own painter per entity kind (registerFlatPainter).

Noise:
- util/noise/ adds Perlin, simplex, Worley (F1 / F2−F1 / cells), white and
  blue noise (void-and-cluster mask, Poisson-disk, scatterPoints), plus
  fbm/ridged/billow fractals, domain warp and a NoiseConfig + makeNoise
  factory. Bodies opt in through terrain.noise; without it the shipped worlds
  regenerate byte-for-byte, which a test asserts — saves store only edits, so
  a changed field would corrupt every resume.
- The editor gained a Noise field inspector group, a preview of the exact
  field the generator will use, and a blue-noise Scatter preview.
- BodyField.defaultValue so inspectors show the effective default, not 0.

Docs: docs/ENGINE.md maps the layers, concepts, registries and determinism
rules; README/CLAUDE.md/INTEGRATION.md/verify skill updated.

Verified in-browser: 3D⇄2D in both the mission and the editor, tile menu and
driving in the flat view, live noise-type switching regenerating terrain and
previews, plus the existing mission and editor flows. 107 engine + 6 UI tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8nBHoPvmqenMDt2RJ4whw
The hotbar showed up to 9 hex buttons at once (Mine/Photo/Scan/Build/Craft/
Place/Repair/Deposit/Hold), which read as a control panel rather than the
handful of buttons a HUD hotbar should be.

- ActionItem gained a `menu` flag. Only mine/photo/scan (the frequent,
  capability-gated, "do it now" verbs) stay on the hotbar directly; build,
  craft, place, repair, deposit and hold are now `menu: true` and collapse
  behind one "More" hex.
- The More hex opens `.tk-tray`, a pop-up list anchored above the honeycomb
  (matches the tile-menu's notched dark-panel style). It closes itself after
  any item is clicked, on an outside click, or on Escape.
- Backward compatible: a custom `items`/`extraItems` array with no `menu`
  flags renders exactly as before (everything on the hotbar).

Verified in-browser: hotbar drops from 9 buttons to 4 (Mine/Photo/Scan/More)
on a full-science rover; opening the tray lists all six secondary actions;
clicking Build opens the build panel and closes the tray; outside-click and
Escape both dismiss it; Deposit fires immediately and closes. Full mission
flow (customise → launch → drive → mine → tray → build → hold → end) still
passes end to end. 107 engine + 6 UI tests, full workspace build clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8nBHoPvmqenMDt2RJ4whw
…nd view for Landnam readiness

Audited planet-hunters-experiment-1 (Landnam)'s construction, underground and
settlement/exploration scenes against @takeon/engine and closed three gaps:

- Material/ResourceKey/StructureType are now open, registry-backed vocabularies
  (registerMaterial/registerResource/registerResourceValue/registerStructure)
  instead of closed enums/unions, so a host can add its own minerals and
  buildings without forking the engine.
- Terrain generation supports optional depth-stratified ore bands
  (terrain.bands, fraction-of-column-depth, opt-in per body) so an
  underground view can reflect real strata instead of a fixed illustration;
  shipped bodies stay byte-identical when bands are absent.
- The cross-section painter moved out of @takeon/editor's internal maps.ts
  into @takeon/engine (crossSectionImage/renderCrossSection, DOM-free where
  possible) and is now wrapped as @takeon/ui's <CrossSectionView/>, a
  mission-driven panel a host game can mount directly.

See docs/LANDNAM.md for the full scene-by-scene mapping. No changes made to
the Landnam repository itself (read-only audit).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8nBHoPvmqenMDt2RJ4whw
…n seam

Landscapes now divide into seeded chunks with simple biomes instead of one
continuous skin, and bodies can inherit from parent presets (planet, moon,
asteroid, gaseous, earth-like) that a host game can layer real properties
onto at instantiation time:

- world/kinds.ts: an inheritable BodyKind tree (body -> planet -> earth-like,
  body -> moon -> ice-moon, etc). instantiateBody(kindId, overrides) resolves
  the chain and layers host-supplied data (e.g. a real temperature reading)
  on top, producing a concrete, generatable BodyDef. BodyType gains 'gaseous'.
- world/biomes.ts: opt-in (terrain.biomes) CHUNK_SIZE-grid biome selection,
  gated by a body's kind (allowedBiomesForKind) and climate. Ore veins stay
  OreBand's job, so the surface skin and the mineral economy stay independent
  layers. 11 biomes ship (grassland, redrock desert, icefield, metallic
  regolith, cloud-platform, ...), plus 3 new materials (Grass/Sand/Snow).
- world/layers.ts: a registration seam for a module built on top of TakeOn to
  attach a second world grid (caves, sky) to generateTerrain's output. Core
  registers none, so mining stays exactly what it is today (top-down,
  deposits and ice) -- this is groundwork for a future terrain module, not
  new gameplay.
- Five new preset bodies (terra, kepler-rust, frostmoon, ironrock, skyhaven)
  demonstrate the system end to end, and the editor gets a "Biomes" map view
  to visualise the chunk grid.

Every addition is opt-in per body; existing generation stays byte-identical
(covered by test/noise.test.ts and the new kinds/biomes/layers test suites).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8nBHoPvmqenMDt2RJ4whw

@Gizmotronn Gizmotronn left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Am I going to review 14,000 changed lines? Yep, you bet

@Gizmotronn
Gizmotronn merged commit 6b4fb5f into claude/rover-game-module-eq347o Aug 1, 2026
2 checks passed
@Gizmotronn
Gizmotronn deleted the claude/takeon-game-engine-editor-alsy8q branch August 1, 2026 13:35
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.

2 participants