Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/vt-guidelines.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# VT Guidelines

Last updated: 2026-03-09
Last updated: 2026-03-15

## Purpose

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions scripts/sync-vt-route-graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down Expand Up @@ -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 });
Expand Down
9 changes: 6 additions & 3 deletions vt/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -243,9 +244,11 @@ const init = async () => {
if (!shouldHandleRenderComplete(payload)) {
return;
}
engine.handleActions({
markLineCompleted: {}
});
if (autoCompleteRenderedLines) {
engine.handleActions({
markLineCompleted: {}
});
}
return;
}
if (payload.actions) {
Expand Down
Loading