diff --git a/docs/vt-guidelines.md b/docs/vt-guidelines.md index 0973623..ede1d9d 100644 --- a/docs/vt-guidelines.md +++ b/docs/vt-guidelines.md @@ -1,6 +1,6 @@ # VT Guidelines -Last updated: 2026-03-09 +Last updated: 2026-03-15 ## Purpose @@ -14,7 +14,7 @@ Define one stable standard for VT authoring in this repo: - The VT Docker flow runs Chromium in a software WebGL fallback path on this repo's current container/runtime setup. - Full-size `1920x1080` Pixi capture on that path is expensive, so VT syncs a local ignored `vt/static/RouteGraphics.js` bundle before VT runs. -- The sync script downloads `route-graphics@0.1.0/dist/RouteGraphics.js` from jsDelivr by default. +- The sync script downloads `route-graphics@0.1.2/dist/RouteGraphics.js` from jsDelivr by default. - Override the source with `VT_ROUTE_GRAPHICS_URL`, or just the package version with `VT_ROUTE_GRAPHICS_VERSION`. - That VT-only bundle is patched during sync to initialize Pixi with `resolution: 0.5` and `preserveDrawingBuffer: true`. - Full-frame VT references are exported from that native half-resolution render surface. diff --git a/package.json b/package.json index 9e8cca4..26f9bdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "route-engine-js", - "version": "0.2.0", + "version": "0.2.1", "description": "A lightweight Visual Novel engine built in JavaScript for creating interactive narrative games with branching storylines", "repository": { "type": "git", @@ -41,7 +41,7 @@ "coverage": "bun run vitest run --coverage", "vt:sync-route-graphics": "bun scripts/sync-vt-route-graphics.js", "vt:generate": "bun scripts/sync-vt-route-graphics.js && bun run esbuild.js && rtgl vt generate", - "vt:docker": "bun scripts/sync-vt-route-graphics.js && bun run esbuild.js && docker run --rm ${VT_DOCKER_ARGS:-} --user $(id -u):$(id -g) -e RTGL_VT_DEBUG=true -v \"$PWD:/app\" -w /app han4wluc/rtgl:playwright-v1.57.0-rtgl-v1.0.0-rc12 rtgl vt screenshot --wait-event vt:ready --concurrency ${VT_DOCKER_CONCURRENCY:-2} --timeout ${VT_DOCKER_TIMEOUT:-60000}", + "vt:docker": "bun scripts/sync-vt-route-graphics.js && bun run esbuild.js && docker run --rm ${VT_DOCKER_ARGS:-} --user $(id -u):$(id -g) -e RTGL_VT_DEBUG=true -v \"$PWD:/app\" -w /app docker.io/han4wluc/rtgl:playwright-v1.57.0-rtgl-v1.0.10 rtgl vt screenshot --wait-event vt:ready --concurrency ${VT_DOCKER_CONCURRENCY:-2} --timeout ${VT_DOCKER_TIMEOUT:-60000}", "vt:report": "bun run vt:docker && rtgl vt report", "vt:accept": "rtgl vt accept", "serve": "bun run esbuild.js && bunx serve -p 3004 .rettangoli/vt/_site" diff --git a/scripts/sync-vt-route-graphics.js b/scripts/sync-vt-route-graphics.js index 7195442..da21298 100644 --- a/scripts/sync-vt-route-graphics.js +++ b/scripts/sync-vt-route-graphics.js @@ -6,7 +6,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const repoRoot = path.resolve(__dirname, ".."); const targetPath = path.resolve(repoRoot, "vt/static/RouteGraphics.js"); -const defaultVersion = process.env.VT_ROUTE_GRAPHICS_VERSION || "0.1.0"; +const defaultVersion = process.env.VT_ROUTE_GRAPHICS_VERSION || "0.1.2"; const sourceUrl = process.env.VT_ROUTE_GRAPHICS_URL || `https://cdn.jsdelivr.net/npm/route-graphics@${defaultVersion}/dist/RouteGraphics.js`; @@ -35,7 +35,7 @@ if (!initPattern.test(source)) { const patched = source.replace( initPattern, (_, initPrefix) => - `await r.init({${initPrefix}preference:"webgl",resolution:.5,preserveDrawingBuffer:!0})`, + `await r.init({${initPrefix}preference:"webgl",resolution:globalThis.RTGL_VT_DEBUG ? .5 : 1,preserveDrawingBuffer:!!globalThis.RTGL_VT_DEBUG,clearBeforeRender:!0})`, ); fs.mkdirSync(path.dirname(targetPath), { recursive: true }); diff --git a/vt/static/main.js b/vt/static/main.js index c617166..391e1d8 100644 --- a/vt/static/main.js +++ b/vt/static/main.js @@ -137,6 +137,7 @@ const init = async () => { const assetBufferMap = assetBufferManager.getBufferMap(); const routeGraphics = createRouteGraphics(); + const autoCompleteRenderedLines = !!window?.RTGL_VT_DEBUG; window.takeVtScreenshotBase64 = async (label) => { if (label) { @@ -243,9 +244,11 @@ const init = async () => { if (!shouldHandleRenderComplete(payload)) { return; } - engine.handleActions({ - markLineCompleted: {} - }); + if (autoCompleteRenderedLines) { + engine.handleActions({ + markLineCompleted: {} + }); + } return; } if (payload.actions) {