Skip to content

Dev to Main#6

Merged
KudenikovNS merged 79 commits into
mainfrom
dev
Mar 25, 2026
Merged

Dev to Main#6
KudenikovNS merged 79 commits into
mainfrom
dev

Conversation

@KudenikovNS
Copy link
Copy Markdown
Collaborator

No description provided.

z-hunter and others added 30 commits March 8, 2026 19:17
Implemented a first-pass text asset system for scenes and objects with runtime resolution and editor tooling.

Added support for text asset files under public/text for scenes and objects, plus a new TextAssetManager responsible for loading assets, resolving title/description fields, applying runtime text redirects, and duplicating/deleting/opening TA files.

Updated the scene editor properties panel so Title is read-only and sourced from the linked text asset. Added Create/Open/Sync/Delete TA actions, including backend file operations for creating, opening, reading, and deleting text asset files.

Integrated text assets into parser and runtime behavior:
- LOOK now resolves scene descriptions from scene TA
- LOOK object title resolves objects by TA title and prints TA description
- LOOK AROUND / LOOK HERE / LOOK SCENE resolve to the current scene description
- clicking visible scene objects with a TA title prints "You see <title>" instead of walking
- Subtrigger clicks resolve title from the forwarded target object

Adjusted click hit-testing so layer ordering is respected between entities and triggerboxes, and restored correct close-on-click-outside behavior for subscenes while preserving title detection inside subscenes.

Also unified command handling between closed and popup console modes so gameplay commands in the expanded console follow the parser path instead of being treated as console-only commands.

Included current scene file updates and added TextAssets.md documentation describing the chosen asset model and redirect rules.
Add a separate service text-asset layer under public/text/system for parser, engine and script strings, with dotted key lookup and placeholder interpolation via TextAssetManager.

Expose game.text(key, params?) as the base runtime access point for service TA and mirror it in ScriptAPI as api.text(key, params?) for script-side convenience. Keep api.log() as output-only, and document the distinction between lookup and output.

Implement runtime text redirect mutators on Scene and SceneObject so scripts can switch standard TA fields like description to alternate fields at runtime via scene.setTextRedirect()/clearTextRedirect() and entity.setTextRedirect()/clearTextRedirect().

Migrate the first set of hardcoded strings in Parser, ComponentSystem, SceneInteraction and DemoScripts to service TA lookups, including parser feedback, click titles, distance/lock messages and demo script narration.

Expand GDD scripting/API documentation into a coherent guide covering ScriptContext, game/api responsibilities, currentScene access, object lookup helpers, text redirects, entity and actor operations, and the distinction between script context and browser-console globals.
Remove .md from the lint-staged prettier rule so Husky no longer rewrites Markdown files during pre-commit. Keep JSON/CSS/SCSS formatting and TypeScript checks unchanged.
Only block movement when a clicked object actually handles activation or has a resolved title to show. Passive Static/Quad hits without TA titles no longer swallow mouse movement commands.
Resolve mouse-walk targeting for actors on non-1.0 parallax layers and keep click movement stable when 3d-parallax updates actor parallax during motion.

Mouse clicks now drive actors through a visual-space target that is re-projected each frame using the current parallax, while script-driven walkTo/moveTo remain world-space and backward compatible.
Introduce the first parser-mediator pipeline with explicit context, action, and result JSON stages for LOOK, TAKE, and INVENTORY commands.

Separate console commands from gameplay parsing, switch console tooling to #RUN/#HALT/#HELP/#CLS, and add #PEEK-ON/#PEEK-OFF for parser execution tracing.

Filter parser context to text-relevant entities, update test scene/text assets used for validation, and extend GDD with the current parser architecture, executor contract, console commands, and near-term roadmap.
Hide TA controls for Walkbox objects and hard-block Walkbox text asset operations in the text asset manager.

Preserve scene text assets on Save As by carrying the previous scene TA to the new scene id when needed, while still creating a default TA when no prior asset exists.
Shift the parser from a message-producing executor pipeline toward an orchestrator flow built around semantic game API calls and structured outcomes.

Add game.look, game.take, game.showInventory, and game.goTo with shared outcome contracts, introduce pending clarification state in the parser, and update parser service text plus GDD to match the new architecture.
Introduce scene registry plus adaptive cache eviction for loaded scenes.\nChoose cache budget from device memory class and log the detected profile on startup.\nShow editor cache stats as MEM x | y in the bottom bar.\nUpdate scene save/save-as flow and game.goTo() to work with the new registry/cache model.
Rework scene caching around texture-first memory weighting so scene eviction better tracks real image cost.\nAdd scene-aware image cache metadata with active/warm/cold states and cold-first LRU eviction.\nExpose updated scene memory profiler data and document the profiler workflow in GDD technical implementation notes.
Use player.moveTo() instead of player.walkTo() when game.goTo targets an in-scene object, so unreachable targets behave like mouse clicks and the actor walks as close as possible instead of failing immediately.
Centralize entity resolution for look, take, and goTo so parser-facing commands share the same matching rules across exact title/id matches and partial title matches.

Add clarification prompts for ambiguous matches, preserve pending clarification flows in the parser, and make disabled entities invisible to parser/runtime object lookup as required by the GDD.
Ensure runtime and parser-adjacent messages use TA titles instead of technical object IDs. Escalate stage-1 cases that would need to name untitled objects in success or clarification flows, and fall back to generic engine text when naming is not possible. Also prevent locked-item and distance messages from exposing raw IDs.
Introduce parser stage 2 with NLP.js-based intent recognition for look/take/go-to/inventory, plus parser debug support for stage2 and console toggles for parser staging. Add #STAGE1-ON and #STAGE1-OFF, extend #PEEK output with NLP diagnostics, and wire async parser flow through the UI layer.

Refactor parser architecture so language interpretation stays inside Parser instead of leaking into Game and SceneManager. Replace string-target Game methods with resolved-target APIs (lookScene, lookEntity, examineEntity, takeEntity, goToScene, goToEntity), move scene/entity textual resolution and ambiguity handling into Parser, remove Scene title-based entity lookup, and remove the old SceneManager textual scene-target helper.

Add inventory-aware parser target resolution for non-movement actions and introduce a separate EXAMINE action with stage1 aliases EXAMINE/X/CHECK/INSPECT and NLP intent support. EXAMINE reads the TA field details, escalates when details are missing, and is allowed for inventory items, active subscene objects, or nearby objects using the same distance threshold as item pickup.

Improve target normalization and matching across cascades, including shared target cleanup, clarification prompts, partial matching, disabled-object exclusion, and player-facing message safety. Update parser/system TA strings, component distance helpers, and supporting test scene/text assets used to validate the new parser behavior end-to-end.
Add Parser.md describing the Scanline parser as mediator, orchestrator, and Game Master for Blue Signal. Document the separation between Player Input and Parser Context, the role of Context Builder and future Scope Builder, the sequential cascade model (Stage 1.1 regex, Stage 1.2 NLP, future Stage 2 LLM), and the central role of Parser Core.

Include Mermaid diagrams for the high-level parser flow, Stage 1 flow, Core flow, clarification loop, and future stage-2 plan execution. Document why Game/runtime must stay language-agnostic, how resolved targets are passed into Game API, and how Core can escalate both before and after API calls.

Also capture the first draft of the constrained parser DSL for future LLM planning, plus parser language-asset principles and the roadmap toward richer scope, relations, and world understanding.
Move stage1 lexicon and stage2 NLP training data out of code and into dedicated parser text assets so the parser language layer can evolve independently of parser logic.

Add parser lexicon/training loading to TextAssetManager, switch stage1 and stage2 to consume the same language pack, and introduce parserLanguage helpers for asset-driven command matching and target normalization.

Add console-side gameplay preprocessing so single-letter shorthands are expanded before gameplay parsing: I -> INVENTORY, X -> EXAMINE..., L -> LOOK.... Keep these aliases out of the parser lexicon itself.

Add #STAGE2-ON and #STAGE2-OFF to control the NLP cascade independently from stage1. Update parser flow so stage2 handoff is skipped when disabled.

Also update Parser.md to document the current language-asset layout and how stage1 and stage2 consume it.
Update Parser.md to reflect the agreed parser contract more precisely: Game API is a shared gameplay API used by parser, UI, scripts, and game logic; Stage 1.1 and Stage 1.2 both follow the same intent -> target -> envelope flow; the parser DSL is described as a unified protocol for all cascades rather than a special Stage 2 format; object TA now includes optional synonyms as parser-owned text knowledge; and parser debugging docs now include Stage 2 toggles.
Introduce ParserWorldModelBuilder to produce parser context and scope together, replace ad-hoc resolution with scope-driven target lookup, and add parser-owned synonym support via object text assets.

Unify stage1 regex and stage1 NLP outputs under a shared ParserCascadeEnvelope so both cascades speak the same Core-facing protocol. Also extend TextAssetManager with list-field support and include synonyms in the default object TA template.

Update tasks.md to reflect the completed scope/world-model work and the start of Step 3.
Add a scene-owned spatial hierarchy for entities and subscenes, with editor authoring fields for parent/relation metadata and nested hierarchy rendering in the scene tree.

Integrate spatial data into ParserWorldModelBuilder so relation queries like LOOK UNDER / IN / BEHIND execute against runtime world structure instead of fallback-only parser logic.

Tighten parser context for future LLM use by removing noisy empty fields, normalizing spatial nodes, preventing technical ids from leaking to players, and moving scene-transition resolution out of parser scope into Game.
Apply the same spatial-tree ordering and indentation logic used for entities to triggerboxes and walkboxes in the editor hierarchy panel, so nested scene objects render consistently regardless of object type.
z-hunter and others added 29 commits March 21, 2026 03:59
@KudenikovNS KudenikovNS merged commit af52be3 into main Mar 25, 2026
2 checks passed
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