@bitmagic/cli 0.1.64-dev.6 → 0.1.64-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/commands/forge.js +70 -11
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/levels.d.ts +1 -1
- package/dist/commands/levels.js +14 -3
- package/dist/commands/levels.js.map +1 -1
- package/dist/commands/trailer.js +18 -4
- package/dist/commands/trailer.js.map +1 -1
- package/dist/editor/hud-replay-page.js +317 -22
- package/dist/editor/hud-replay-page.js.map +1 -1
- package/dist/forge/apply-modifications.js +70 -2
- package/dist/forge/apply-modifications.js.map +1 -1
- package/dist/forge/progress.d.ts +10 -0
- package/dist/forge/progress.js +7 -6
- package/dist/forge/progress.js.map +1 -1
- package/dist/forge/run-pipeline.d.ts +8 -0
- package/dist/forge/run-pipeline.js +37 -2
- package/dist/forge/run-pipeline.js.map +1 -1
- package/dist/forge/stream.d.ts +7 -1
- package/dist/forge/stream.js +5 -2
- package/dist/forge/stream.js.map +1 -1
- package/dist/forge/two-d-gate.d.ts +72 -0
- package/dist/forge/two-d-gate.js +198 -0
- package/dist/forge/two-d-gate.js.map +1 -0
- package/dist/publish/bundle.d.ts +12 -0
- package/dist/publish/bundle.js +32 -0
- package/dist/publish/bundle.js.map +1 -1
- package/dist/render/qr-png.d.ts +6 -3
- package/dist/render/qr-png.js +8 -8
- package/dist/render/qr-png.js.map +1 -1
- package/dist/scaffold/project-files.js +71 -6
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/skill-files.js +1 -0
- package/dist/scaffold/skill-files.js.map +1 -1
- package/dist/trailer/hud-raster.d.ts +12 -12
- package/dist/trailer/hud-raster.js +85 -32
- package/dist/trailer/hud-raster.js.map +1 -1
- package/dist/trailer/hud-state.d.ts +75 -4
- package/dist/trailer/hud-state.js +132 -17
- package/dist/trailer/hud-state.js.map +1 -1
- package/dist/trailer/io.d.ts +2 -0
- package/dist/trailer/io.js +6 -1
- package/dist/trailer/io.js.map +1 -1
- package/dist/trailer/link.d.ts +1 -0
- package/dist/trailer/link.js +15 -0
- package/dist/trailer/link.js.map +1 -0
- package/dist/trailer/make.d.ts +2 -0
- package/dist/trailer/make.js +1 -0
- package/dist/trailer/make.js.map +1 -1
- package/dist/trailer/merge.js +32 -11
- package/dist/trailer/merge.js.map +1 -1
- package/dist/trailer/render.d.ts +2 -0
- package/dist/trailer/render.js +94 -48
- package/dist/trailer/render.js.map +1 -1
- package/dist/trailer/timeline-types.d.ts +19 -0
- package/dist/trailer/timeline-types.js +42 -2
- package/dist/trailer/timeline-types.js.map +1 -1
- package/dist/trailer/title-raster.js +2 -1
- package/dist/trailer/title-raster.js.map +1 -1
- package/dist/trailer/titles.js +6 -1
- package/dist/trailer/titles.js.map +1 -1
- package/dist/trailer/video-chain.d.ts +96 -8
- package/dist/trailer/video-chain.js +183 -0
- package/dist/trailer/video-chain.js.map +1 -1
- package/dist/verify/browser.js +4 -1
- package/dist/verify/browser.js.map +1 -1
- package/package.json +4 -4
package/dist/render/qr-png.js
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Two other hand-rolled PNG encoders exist in this repo — `world-forger-internal`'s vehicle atlas
|
|
17
17
|
* and `game-play-agent`'s solid-colour tile — and neither is reachable from here: the first is in a
|
|
18
|
-
* `private: true` package the CLI does not depend on, the second is server code.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* `private: true` package the CLI does not depend on, the second is server code. Within the CLI the
|
|
19
|
+
* chunk/CRC/signature primitives are exported from here and shared with the trailer's transparent
|
|
20
|
+
* frame filler (trailer/video-chain.ts); `ios/icon.ts` predates that and keeps its own.
|
|
21
21
|
*/
|
|
22
22
|
import { Buffer } from 'buffer';
|
|
23
23
|
import * as zlib from 'zlib';
|
|
@@ -28,7 +28,7 @@ const MODULE_PIXELS = 8;
|
|
|
28
28
|
* uses — that one is trading margin for terminal columns, and a file has no such constraint.
|
|
29
29
|
*/
|
|
30
30
|
const QUIET_MODULES = 4;
|
|
31
|
-
const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
|
31
|
+
export const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
|
32
32
|
/** The standard CRC-32 table (PNG spec annex D), built once. */
|
|
33
33
|
function buildCrcTable() {
|
|
34
34
|
const table = new Uint32Array(256);
|
|
@@ -50,7 +50,7 @@ function crc32(bytes) {
|
|
|
50
50
|
return (crc ^ 0xffffffff) >>> 0;
|
|
51
51
|
}
|
|
52
52
|
/** One PNG chunk: length, type, data, and the CRC over type+data (never over the length). */
|
|
53
|
-
function
|
|
53
|
+
export function pngChunk(type, data) {
|
|
54
54
|
const length = Buffer.alloc(4);
|
|
55
55
|
length.writeUInt32BE(data.length, 0);
|
|
56
56
|
const typeAndData = Buffer.concat([Buffer.from(type, 'ascii'), data]);
|
|
@@ -101,11 +101,11 @@ export function encodeQrPng(matrix, options = {}) {
|
|
|
101
101
|
ihdr[12] = 0; // interlace: none
|
|
102
102
|
return Buffer.concat([
|
|
103
103
|
PNG_SIGNATURE,
|
|
104
|
-
|
|
104
|
+
pngChunk('IHDR', ihdr),
|
|
105
105
|
// deflateSync, not fflate's — fflate's `deflateSync` emits RAW deflate with no zlib header,
|
|
106
106
|
// and an IDAT must carry the zlib wrapper. (fflate's `zlibSync` would also do.)
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
pngChunk('IDAT', zlib.deflateSync(raw)),
|
|
108
|
+
pngChunk('IEND', Buffer.alloc(0)),
|
|
109
109
|
]);
|
|
110
110
|
}
|
|
111
111
|
//# sourceMappingURL=qr-png.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-png.js","sourceRoot":"","sources":["../../src/render/qr-png.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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,CAAC,IAAI,SAAS,IAAI,MAAM,CAAC,MAAM;gBAAE,SAAS;YAC1D,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;gBAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QACjE,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC9B,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY;IACzB,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,4BAA4B;IACzC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,mDAAmD;IACjE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,sDAAsD;IACpE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,kBAAkB;IAEhC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa;QACb,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;QACtB,4FAA4F;QAC5F,gFAAgF;QAChF,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAClC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -481,11 +481,71 @@ const stubCreatorHandlerPlugin = () => ({
|
|
|
481
481
|
});
|
|
482
482
|
`;
|
|
483
483
|
}
|
|
484
|
+
/**
|
|
485
|
+
* The build-time Rapier flavor selector, emitted into BOTH vendored configs.
|
|
486
|
+
*
|
|
487
|
+
* A bundle ships exactly one physics engine, never both: each `-compat` package
|
|
488
|
+
* embeds its full WASM, so the unused one is dead megabytes. Which one is the
|
|
489
|
+
* ENGINE'S call — the config runs `src/work/game.json` through the engine's own
|
|
490
|
+
* rule, `engine/engine/physics/PhysicsModeRule.ts` (vendored with the engine;
|
|
491
|
+
* Vite bundles the config with esbuild, which resolves the TypeScript import),
|
|
492
|
+
* so the bundle can never disagree with the world the engine boots. `bitmagic
|
|
493
|
+
* build/publish/ios` resolve the same rule ahead of time into
|
|
494
|
+
* BUNDLE_RAPIER_FLAVOR, which wins when set; an invalid value, or a game.json
|
|
495
|
+
* the config cannot read, fails the build. The stub is safe because no
|
|
496
|
+
* module-scope value usage of either Rapier import exists in the engine.
|
|
497
|
+
*/
|
|
498
|
+
function renderRapierFlavorBlock() {
|
|
499
|
+
return `// Single-Rapier-flavor builds: this bundle ships exactly one physics engine (each -compat package
|
|
500
|
+
// embeds its full WASM — the unused one is dead megabytes). The flavor is the game's EFFECTIVE
|
|
501
|
+
// physics mode: src/work/game.json run through the engine's own rule, the same function the engine
|
|
502
|
+
// applies at boot, so the bundle can never disagree with the world the game runs. bitmagic
|
|
503
|
+
// build/publish/ios resolve it ahead of time into BUNDLE_RAPIER_FLAVOR, which wins when set. There
|
|
504
|
+
// is no dual-flavor build: a game.json this config cannot read fails the build. The stub is safe:
|
|
505
|
+
// the engine has no module-scope value usage of either Rapier import, and only ever init()s the
|
|
506
|
+
// flavor it boots.
|
|
507
|
+
const RAPIER_PACKAGES = { '2d': '@dimforge/rapier2d-compat', '3d': '@dimforge/rapier3d-compat' };
|
|
508
|
+
function resolveRapierFlavor() {
|
|
509
|
+
const fromEnv = process.env.BUNDLE_RAPIER_FLAVOR || '';
|
|
510
|
+
if (fromEnv) {
|
|
511
|
+
if (fromEnv !== '2d' && fromEnv !== '3d') {
|
|
512
|
+
throw new Error("BUNDLE_RAPIER_FLAVOR must be '2d' or '3d' when set (got '" + fromEnv + "')");
|
|
513
|
+
}
|
|
514
|
+
return fromEnv;
|
|
515
|
+
}
|
|
516
|
+
let game;
|
|
517
|
+
try {
|
|
518
|
+
game = JSON.parse(fs.readFileSync('src/work/game.json', 'utf8'));
|
|
519
|
+
} catch (err) {
|
|
520
|
+
throw new Error('Cannot decide which physics engine to bundle: src/work/game.json is unreadable (' + err.message + ').');
|
|
521
|
+
}
|
|
522
|
+
const mode = game.physicsMode === '2d' || game.physicsMode === '3d' || game.physicsMode === 'none' ? game.physicsMode : undefined;
|
|
523
|
+
return rapierFlavorForPhysicsMode(effectivePhysicsMode(typeof game.gameGenre === 'string' ? game.gameGenre : '', mode, game.physics2d === true));
|
|
524
|
+
}
|
|
525
|
+
const rapierFlavor = resolveRapierFlavor();
|
|
526
|
+
const droppedRapier = RAPIER_PACKAGES[rapierFlavor === '2d' ? '3d' : '2d'];
|
|
527
|
+
// 'pre' is load-bearing: without it Vite's own resolver wins and the "dropped" package is
|
|
528
|
+
// INLINED from node_modules — WASM and all, ~2 MB heavier — with no error and no greppable
|
|
529
|
+
// package-name string. Same trap the creator-handler stub above documents.
|
|
530
|
+
const stubRapierPlugin = () => ({
|
|
531
|
+
name: 'stub-rapier-flavor',
|
|
532
|
+
enforce: 'pre',
|
|
533
|
+
resolveId(id) {
|
|
534
|
+
return id === droppedRapier ? '\\0rapier-flavor-stub' : null;
|
|
535
|
+
},
|
|
536
|
+
load(id) {
|
|
537
|
+
return id === '\\0rapier-flavor-stub' ? 'export default null;' : null;
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
`;
|
|
541
|
+
}
|
|
484
542
|
/** Rollup's `external` predicate, indented to sit inside the generated `rollupOptions` block. */
|
|
485
543
|
const PUBLISH_CONFIG_EXTERNAL_BLOCK = ` // Anything the CDN table resolves stays OUT of the bundle. Every other id — the 'engine/',
|
|
486
544
|
// 'core/', 'work/' aliases above included — is bundled, which is what a single published
|
|
487
|
-
// HTML file with no same-origin siblings requires.
|
|
488
|
-
external
|
|
545
|
+
// HTML file with no same-origin siblings requires. The one exception: a dropped Rapier
|
|
546
|
+
// flavor must NOT go external (an external import would still fetch it at runtime) — it
|
|
547
|
+
// falls through to stubRapierPlugin and vanishes from the bundle entirely.
|
|
548
|
+
external: (id) => id !== droppedRapier && cdnUrl(id) !== undefined,`;
|
|
489
549
|
/**
|
|
490
550
|
* The counterpart note in the `--single-file` config, where there is no `external` at all.
|
|
491
551
|
*
|
|
@@ -526,8 +586,12 @@ const PUBLISH_CONFIG_PATHS_BLOCK = ` // Rewrite each externalized import
|
|
|
526
586
|
*/
|
|
527
587
|
function renderPublishConfig(mode) {
|
|
528
588
|
const cdn = mode === 'cdn';
|
|
529
|
-
return `import
|
|
589
|
+
return `import fs from 'fs';
|
|
590
|
+
import { defineConfig } from 'vite';
|
|
530
591
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
592
|
+
// The engine's physics-mode rule, straight from the vendored engine source (see the Rapier
|
|
593
|
+
// flavor block below for why the bundle must use the engine's own rule and nothing else).
|
|
594
|
+
import { effectivePhysicsMode, rapierFlavorForPhysicsMode } from './engine/engine/physics/PhysicsModeRule.ts';
|
|
531
595
|
|
|
532
596
|
// Aliases mirror vite.config.js's, deliberately NOT wrapped in path.resolve(): every target here
|
|
533
597
|
// already starts with '/', which Vite resolves as project-root-relative in both serve and build
|
|
@@ -539,7 +603,8 @@ import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
|
539
603
|
// since Rollup then just treats the unmatched id as an unresolved bare specifier and fails the
|
|
540
604
|
// build. Verified against a real \`vite build\` before trusting the plain-string form.
|
|
541
605
|
|
|
542
|
-
${cdn ? renderCdnModuleTable() : ''}${
|
|
606
|
+
${cdn ? renderCdnModuleTable() : ''}${renderRapierFlavorBlock()}
|
|
607
|
+
${renderCreatorHandlerStub()}
|
|
543
608
|
// Editing-only asset fields must not ship inside published game data: the
|
|
544
609
|
// source recording behind a video-to-motion clip is the creator's webcam
|
|
545
610
|
// footage. The list mirrors EDITING_ONLY_ASSET_FIELDS in @bitmagic/asset-core
|
|
@@ -604,7 +669,7 @@ ${cdn ? PUBLISH_CONFIG_PATHS_BLOCK : ''} // A licence obligation, not dec
|
|
|
604
669
|
},
|
|
605
670
|
},
|
|
606
671
|
},
|
|
607
|
-
plugins: [stubCreatorHandlerPlugin(), stripEditingOnlyWorldFieldsPlugin(), viteSingleFile()],
|
|
672
|
+
plugins: [stubCreatorHandlerPlugin(), stripEditingOnlyWorldFieldsPlugin(), stubRapierPlugin(), viteSingleFile()],
|
|
608
673
|
});
|
|
609
674
|
`;
|
|
610
675
|
}
|
|
@@ -1379,7 +1444,7 @@ tier 2.
|
|
|
1379
1444
|
| Multiple levels, level select, switching worlds at runtime | \`level-system.md\` |
|
|
1380
1445
|
| Skyboxes | \`skybox-system.md\` |
|
|
1381
1446
|
| Weather and snow | \`weather-snow.md\` |
|
|
1382
|
-
| 2D side-
|
|
1447
|
+
| 2D side-view games — the forged strip level, its \`worldForgerSideon\` contract, collect/respawn/goal wiring | \`sideon-forged-levels.md\` |
|
|
1383
1448
|
|
|
1384
1449
|
\`engine/agent-docs/samples/\` holds compile-checked reference implementations — a doc that cites
|
|
1385
1450
|
\`samples/raycast-ground-check\` means \`engine/agent-docs/samples/raycast-ground-check.ts\`, and it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAiB,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,YAAY,GAEb,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creator talks; you edit \`trailer/shots.json\`, run \`bitmagic trailer make\
|
|
|
256
256
|
| "add a title at the start" | a \`title\`-style cue at \`at: 0\` for ~2.5 s, and make the first shot calm enough to read over |
|
|
257
257
|
| "different music", "more epic / chill" | \`--music-prompt\` with the new direction (spends sparks), or \`--music <file>\`; shots keep their beat counts and re-snap |
|
|
258
258
|
| "no HUD" / "show the HUD" | drop or add \`--ui\` (per shot: \`"ui": false\`) |
|
|
259
|
+
| "the HUD stutters" / "smoother HUD" | raise \`--ui-keyframe-rate\` on \`make\` or \`render\` (default 30/s; 0 = every change) |
|
|
259
260
|
| "shorter / longer" | \`--seconds N\` only matters for a fresh auto cut (\`--reset-shots\`); otherwise add or remove shots |
|
|
260
261
|
| "start over" | \`bitmagic trailer make --reset-shots\` |
|
|
261
262
|
| "use the other recording" | \`--recording <dir>\`; shots.json from another recording is kept beside a fresh cut |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-files.js","sourceRoot":"","sources":["../../src/scaffold/skill-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;CAkBR,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAsB;IAC7E,2FAA2F;IAC3F,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;IAC7F,6FAA6F;IAC7F,0EAA0E;IAC1E,MAAM,WAAW,GACf,QAAQ,CAAC,MAAM,KAAK,CA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AI,CAAC;YAC5C,iFAAiF,CAAC;IAExF,OAAO;;sBAEa,SAAS,SAAS,iBAAiB,CAAC,SAAS,CAAC;;;EAGlE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BZ,CAAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuJR,CAAC;AACF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GR,CAAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkER,CAAC;AACF,CAAC"}
|
|
@@ -7,22 +7,22 @@ export interface RasterizeOptions {
|
|
|
7
7
|
harnessUrl: string;
|
|
8
8
|
/** Overlay PNGs are written here as ui_NNNN.png, one per keyframe. */
|
|
9
9
|
outDir: string;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* CSS-pixel viewport the HUD lays out against — the recorded window's
|
|
12
|
+
* aspect-corrected size when the manifest carries one, else the recording
|
|
13
|
+
* resolution (see computeRasterGeometry in hud-state.ts).
|
|
14
|
+
*/
|
|
11
15
|
width: number;
|
|
12
16
|
height: number;
|
|
17
|
+
/** PNG pixels per CSS pixel; >1 keeps overlays at/above the recording size. */
|
|
18
|
+
deviceScaleFactor: number;
|
|
13
19
|
}
|
|
14
20
|
export declare function uiPngPath(outDir: string, index: number): string;
|
|
15
21
|
/**
|
|
16
22
|
* Render one transparent PNG per keyframe, reusing a single browser + page.
|
|
17
|
-
* Returns paths in keyframe order
|
|
18
|
-
* (
|
|
23
|
+
* Returns paths in keyframe order — a slot is null when that one keyframe
|
|
24
|
+
* failed (the caller holds the previous overlay across its window) — or null
|
|
25
|
+
* overall when UI must be skipped entirely (no Chrome, harness unreachable, the
|
|
26
|
+
* page died mid-run, or every keyframe failed).
|
|
19
27
|
*/
|
|
20
|
-
export declare function rasterizeUiKeyframes(keyframes: readonly UiKeyframe[], options: RasterizeOptions): Promise<string
|
|
21
|
-
/**
|
|
22
|
-
* Width/height straight out of a PNG's IHDR chunk, so the filtergraph only
|
|
23
|
-
* pays for a scale filter when the overlay really is the wrong size.
|
|
24
|
-
*/
|
|
25
|
-
export declare function readPngSize(filePath: string): {
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
} | null;
|
|
28
|
+
export declare function rasterizeUiKeyframes(keyframes: readonly UiKeyframe[], options: RasterizeOptions): Promise<Array<string | null> | null>;
|
|
@@ -4,12 +4,20 @@
|
|
|
4
4
|
* The harness page (`/hud-replay.html` on the running `bitmagic dev` sidecar) owns a real GameHUD,
|
|
5
5
|
* so the overlay is the game's own UI rather than a reimplementation. Contract:
|
|
6
6
|
* window.__hudReplayReady === true when the page can accept states
|
|
7
|
-
* window.__hudReplay.render(state)
|
|
7
|
+
* window.__hudReplay.render(state, ms) synchronous; applies a replay state,
|
|
8
|
+
* `ms` seeding animation phase on the
|
|
9
|
+
* source clock (older harness: ignored)
|
|
8
10
|
* window.__hudReplay.setViewport(w, h) sizes the HUD root
|
|
11
|
+
* window.__hudReplay.settle() optional; resolves when fonts/images
|
|
12
|
+
* the state started loading are in (or
|
|
13
|
+
* a short deadline passed)
|
|
9
14
|
* plus a transparent page background, so `omitBackground` yields real alpha.
|
|
10
15
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
16
|
+
* Failure here degrades instead of failing the trailer: a keyframe that will
|
|
17
|
+
* not rasterize becomes a null slot (the caller holds the previous overlay over
|
|
18
|
+
* its window), and only an unusable page — navigation failed, the page died, or
|
|
19
|
+
* every single keyframe threw — degrades to "no overlays" (null). A UI-less
|
|
20
|
+
* video still beats no video. Chrome is the creator's installed browser
|
|
13
21
|
* (`channel: 'chrome'`), the same one `bitmagic verify` drives — nothing is downloaded.
|
|
14
22
|
*/
|
|
15
23
|
import * as fs from 'fs';
|
|
@@ -18,20 +26,29 @@ import { chromium } from 'playwright-core';
|
|
|
18
26
|
import { out, warn } from './io.js';
|
|
19
27
|
const NAV_TIMEOUT_MS = 20000;
|
|
20
28
|
const READY_TIMEOUT_MS = 20000;
|
|
29
|
+
/** Consecutive keyframe failures after which the run gives up on UI entirely. */
|
|
30
|
+
const MAX_CONSECUTIVE_FAILURES = 3;
|
|
21
31
|
export const CHROME_MISSING_HINT = 'Google Chrome could not be launched — install it from https://www.google.com/chrome/';
|
|
22
32
|
/**
|
|
23
33
|
* The state is embedded in the expression rather than passed as an argument:
|
|
24
34
|
* Playwright treats a string pageFunction as a plain expression and drops the
|
|
25
35
|
* arg, so an IIFE is the reliable form.
|
|
26
36
|
*/
|
|
27
|
-
function applyStateExpression(state, width, height) {
|
|
37
|
+
function applyStateExpression(state, width, height, frameTimeMs, clipIndex) {
|
|
28
38
|
return ('(() => {' +
|
|
29
39
|
' const replay = window.__hudReplay;' +
|
|
30
40
|
' if (!replay || typeof replay.render !== "function") throw new Error("window.__hudReplay.render is missing");' +
|
|
31
41
|
' if (typeof replay.setViewport === "function") replay.setViewport(' +
|
|
32
42
|
`${JSON.stringify(width)}, ${JSON.stringify(height)});` +
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
// The second and third arguments seed animation phase (source time, and
|
|
44
|
+
// the clip so the harness can tell a new clip's first keyframe from a
|
|
45
|
+
// mid-clip one); an older harness ignores them.
|
|
46
|
+
` replay.render(${JSON.stringify(state)}, ${JSON.stringify(frameTimeMs)}, ${JSON.stringify(clipIndex)});` +
|
|
47
|
+
// settle() is awaited here rather than in a second round trip: Playwright
|
|
48
|
+
// awaits a thenable returned from a string expression, so this is one
|
|
49
|
+
// protocol call per keyframe instead of two, with identical ordering. An
|
|
50
|
+
// older harness has no settle() and simply returns true.
|
|
51
|
+
' return typeof replay.settle === "function" ? replay.settle() : true;' +
|
|
35
52
|
'})()');
|
|
36
53
|
}
|
|
37
54
|
/** Headless system Chrome for offscreen rasterization; null (with a warning) when it cannot start. */
|
|
@@ -47,36 +64,90 @@ export async function launchRasterBrowser(purpose) {
|
|
|
47
64
|
export function uiPngPath(outDir, index) {
|
|
48
65
|
return path.join(outDir, `ui_${String(index).padStart(4, '0')}.png`);
|
|
49
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Cheap liveness probe. A crashed target or closed browser rejects every
|
|
69
|
+
* protocol call immediately, so this distinguishes "that one state was bad"
|
|
70
|
+
* from "there is no page any more".
|
|
71
|
+
*/
|
|
72
|
+
async function pageIsAlive(page) {
|
|
73
|
+
try {
|
|
74
|
+
await page.evaluate('1');
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
50
81
|
/**
|
|
51
82
|
* Render one transparent PNG per keyframe, reusing a single browser + page.
|
|
52
|
-
* Returns paths in keyframe order
|
|
53
|
-
* (
|
|
83
|
+
* Returns paths in keyframe order — a slot is null when that one keyframe
|
|
84
|
+
* failed (the caller holds the previous overlay across its window) — or null
|
|
85
|
+
* overall when UI must be skipped entirely (no Chrome, harness unreachable, the
|
|
86
|
+
* page died mid-run, or every keyframe failed).
|
|
54
87
|
*/
|
|
55
88
|
export async function rasterizeUiKeyframes(keyframes, options) {
|
|
56
89
|
if (keyframes.length === 0)
|
|
57
90
|
return [];
|
|
91
|
+
// Before the browser exists: a throwing mkdir must not leak a Chrome.
|
|
92
|
+
fs.mkdirSync(options.outDir, { recursive: true });
|
|
58
93
|
const browser = await launchRasterBrowser('ui');
|
|
59
94
|
if (browser === null) {
|
|
60
95
|
warn('ui: rendering without HUD overlays');
|
|
61
96
|
return null;
|
|
62
97
|
}
|
|
63
|
-
fs.mkdirSync(options.outDir, { recursive: true });
|
|
64
98
|
try {
|
|
65
99
|
const context = await browser.newContext({
|
|
66
100
|
viewport: { width: options.width, height: options.height },
|
|
67
|
-
deviceScaleFactor:
|
|
101
|
+
deviceScaleFactor: options.deviceScaleFactor
|
|
68
102
|
});
|
|
69
103
|
const page = await context.newPage();
|
|
70
104
|
await page.goto(options.harnessUrl, { waitUntil: 'domcontentloaded', timeout: NAV_TIMEOUT_MS });
|
|
71
105
|
await page.waitForFunction('window.__hudReplayReady === true', undefined, { timeout: READY_TIMEOUT_MS });
|
|
72
106
|
const paths = [];
|
|
107
|
+
let failed = 0;
|
|
108
|
+
let consecutiveFailures = 0;
|
|
73
109
|
for (let i = 0; i < keyframes.length; i++) {
|
|
74
110
|
const pngPath = uiPngPath(options.outDir, i);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
111
|
+
try {
|
|
112
|
+
await page.evaluate(applyStateExpression(keyframes[i].state, options.width, options.height, Math.round(keyframes[i].frameTimeMs), keyframes[i].clipIndex));
|
|
113
|
+
await page.screenshot({ path: pngPath, omitBackground: true, type: 'png' });
|
|
114
|
+
paths.push(pngPath);
|
|
115
|
+
consecutiveFailures = 0;
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
// One bad state must not throw away the overlays already on disk.
|
|
119
|
+
failed++;
|
|
120
|
+
consecutiveFailures++;
|
|
121
|
+
warn(`ui: keyframe ${i} failed to rasterize ` +
|
|
122
|
+
`(${err instanceof Error ? err.message : String(err)}) — holding the previous overlay`);
|
|
123
|
+
paths.push(null);
|
|
124
|
+
// A dead page fails every REMAINING keyframe too, and each null slot
|
|
125
|
+
// extends the last good overlay — which would freeze one stale HUD
|
|
126
|
+
// over the whole rest of the trailer. That is worse than no UI, so
|
|
127
|
+
// probe liveness and bail out whole rather than degrade per keyframe.
|
|
128
|
+
if (!(await pageIsAlive(page))) {
|
|
129
|
+
warn(`ui: the replay page died after ${paths.length - failed} overlay(s) — rendering without UI ` +
|
|
130
|
+
'rather than freezing the last one over the remaining clips');
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
// A page that answers evaluate('1') but fails every screenshot (a
|
|
134
|
+
// stalled compositor, an unwritable .ui) would otherwise pay the full
|
|
135
|
+
// screenshot timeout once per remaining keyframe and then freeze the
|
|
136
|
+
// last good overlay across them — hours of waiting for a worse video.
|
|
137
|
+
if (consecutiveFailures >= MAX_CONSECUTIVE_FAILURES) {
|
|
138
|
+
warn(`ui: ${consecutiveFailures} keyframes in a row failed to rasterize — rendering without UI ` +
|
|
139
|
+
'rather than holding one overlay over everything that follows');
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (failed === keyframes.length) {
|
|
145
|
+
warn(`ui: every keyframe failed to rasterize against ${options.harnessUrl} — rendering without UI`);
|
|
146
|
+
return null;
|
|
78
147
|
}
|
|
79
|
-
out(`ui: rasterized ${paths.length} overlay(s) at ${options.width}x${options.height}
|
|
148
|
+
out(`ui: rasterized ${paths.length - failed} overlay(s) at ${options.width}x${options.height}` +
|
|
149
|
+
`${options.deviceScaleFactor !== 1 ? `@${options.deviceScaleFactor.toFixed(2)}x` : ''} ` +
|
|
150
|
+
`from ${options.harnessUrl}${failed > 0 ? ` (${failed} failed, held over)` : ''}`);
|
|
80
151
|
return paths;
|
|
81
152
|
}
|
|
82
153
|
catch (err) {
|
|
@@ -93,22 +164,4 @@ export async function rasterizeUiKeyframes(keyframes, options) {
|
|
|
93
164
|
}
|
|
94
165
|
}
|
|
95
166
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Width/height straight out of a PNG's IHDR chunk, so the filtergraph only
|
|
98
|
-
* pays for a scale filter when the overlay really is the wrong size.
|
|
99
|
-
*/
|
|
100
|
-
export function readPngSize(filePath) {
|
|
101
|
-
const header = Buffer.alloc(24);
|
|
102
|
-
const fd = fs.openSync(filePath, 'r');
|
|
103
|
-
try {
|
|
104
|
-
if (fs.readSync(fd, header, 0, 24, 0) < 24)
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
finally {
|
|
108
|
-
fs.closeSync(fd);
|
|
109
|
-
}
|
|
110
|
-
if (header.readUInt32BE(0) !== 0x89504e47 || header.toString('ascii', 12, 16) !== 'IHDR')
|
|
111
|
-
return null;
|
|
112
|
-
return { width: header.readUInt32BE(16), height: header.readUInt32BE(20) };
|
|
113
|
-
}
|
|
114
167
|
//# sourceMappingURL=hud-raster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hud-raster.js","sourceRoot":"","sources":["../../src/trailer/hud-raster.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hud-raster.js","sourceRoot":"","sources":["../../src/trailer/hud-raster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAA2B,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,cAAc,GAAG,KAAK,CAAC;AAC7B,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,iFAAiF;AACjF,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,MAAM,CAAC,MAAM,mBAAmB,GAC9B,sFAAsF,CAAC;AAEzF;;;;GAIG;AACH,SAAS,oBAAoB,CAC3B,KAAc,EACd,KAAa,EACb,MAAc,EACd,WAAmB,EACnB,SAAiB;IAEjB,OAAO,CACL,UAAU;QACV,qCAAqC;QACrC,+GAA+G;QAC/G,o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AC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACxF,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -24,6 +24,8 @@ export interface HudHealthState {
|
|
|
24
24
|
current: number;
|
|
25
25
|
max: number;
|
|
26
26
|
visible: boolean;
|
|
27
|
+
/** Pixel width from showHealth({width}); absent = the engine default. */
|
|
28
|
+
width?: number;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* One HUD element. Keys beyond id/type/anchor/visible are per-kind and are
|
|
@@ -52,6 +54,8 @@ export interface HudElementState {
|
|
|
52
54
|
export interface HudToastState {
|
|
53
55
|
message: string;
|
|
54
56
|
variant?: string;
|
|
57
|
+
/** IGameHUD anchor; absent on recordings that predate anchor capture. */
|
|
58
|
+
anchor?: string;
|
|
55
59
|
}
|
|
56
60
|
export interface HudReplayState {
|
|
57
61
|
version: 1;
|
|
@@ -63,7 +67,48 @@ export interface HudReplayState {
|
|
|
63
67
|
/** Creation order (= stacking order within an anchor); removed ones dropped. */
|
|
64
68
|
elements: HudElementState[];
|
|
65
69
|
toasts: HudToastState[];
|
|
70
|
+
/**
|
|
71
|
+
* Game-authored head stylesheets, first-logged order, last write per id.
|
|
72
|
+
* The harness injects these before drawing — they are what turn
|
|
73
|
+
* custom-element class names into pixels.
|
|
74
|
+
*
|
|
75
|
+
* Shared between snapshots while unchanged, so treat it as frozen: never
|
|
76
|
+
* mutate the array or its entries in place.
|
|
77
|
+
*/
|
|
78
|
+
stylesheets: ReadonlyArray<HudStylesheetState>;
|
|
79
|
+
}
|
|
80
|
+
export interface HudStylesheetState {
|
|
81
|
+
id: string;
|
|
82
|
+
css: string;
|
|
83
|
+
}
|
|
84
|
+
export interface RasterGeometry {
|
|
85
|
+
/** CSS-pixel viewport for the harness browser context. */
|
|
86
|
+
viewportWidth: number;
|
|
87
|
+
viewportHeight: number;
|
|
88
|
+
deviceScaleFactor: number;
|
|
66
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Where to lay the HUD out for rasterization.
|
|
92
|
+
*
|
|
93
|
+
* During capture only the CANVAS is resized to the recording resolution — the
|
|
94
|
+
* DOM HUD keeps laying out against the player's window. Rastering at the
|
|
95
|
+
* recording size therefore renders every fixed-pixel HUD metric too small
|
|
96
|
+
* relative to the footage (and flips vw-clamps and media queries). With the
|
|
97
|
+
* recorded window known, raster at an ASPECT-CORRECTED viewport: the window's
|
|
98
|
+
* height (so element size relative to screen height matches what the player
|
|
99
|
+
* saw) at the recording's aspect (raw window dimensions would stretch glyphs
|
|
100
|
+
* non-uniformly under the final scale whenever the aspects differ). The
|
|
101
|
+
* deviceScaleFactor keeps the PNG at or above the recording resolution so
|
|
102
|
+
* ffmpeg only ever downscales.
|
|
103
|
+
*
|
|
104
|
+
* No recorded window → the recording resolution at 1x, bit-for-bit the old
|
|
105
|
+
* behavior.
|
|
106
|
+
*/
|
|
107
|
+
export declare function computeRasterGeometry(recordingWidth: number, recordingHeight: number, window?: {
|
|
108
|
+
innerWidth: number;
|
|
109
|
+
innerHeight: number;
|
|
110
|
+
devicePixelRatio: number;
|
|
111
|
+
}): RasterGeometry;
|
|
67
112
|
/** The engine records `frame` on a 60fps source clock. */
|
|
68
113
|
export declare const DEFAULT_HUD_FPS = 60;
|
|
69
114
|
/** IGameHUD.showToast's default duration. */
|
|
@@ -78,6 +123,12 @@ export declare function isBlankHudState(state: HudReplayState): boolean;
|
|
|
78
123
|
export interface UiKeyframe {
|
|
79
124
|
/** Source frame whose state this is. */
|
|
80
125
|
sourceFrame: number;
|
|
126
|
+
/**
|
|
127
|
+
* `sourceFrame` as milliseconds on the SOURCE clock. The harness seeds
|
|
128
|
+
* animation phase from it, so motion stays locked to the footage through a
|
|
129
|
+
* speed ramp — output time would run it fast or slow against the frames.
|
|
130
|
+
*/
|
|
131
|
+
frameTimeMs: number;
|
|
81
132
|
clipIndex: number;
|
|
82
133
|
/** Output-timeline seconds this overlay becomes visible. */
|
|
83
134
|
outputStartSec: number;
|
|
@@ -88,17 +139,37 @@ export interface UiKeyframe {
|
|
|
88
139
|
export interface CollectUiKeyframesOptions {
|
|
89
140
|
/** Source-clock fps. Default 60. */
|
|
90
141
|
fps?: number;
|
|
91
|
-
/** Ceiling on keyframes per second of OUTPUT time. Default
|
|
142
|
+
/** Ceiling on keyframes per second of OUTPUT time. Default 30. 0 disables. */
|
|
92
143
|
maxPerSecond?: number;
|
|
93
|
-
/** Hard ceiling per clip.
|
|
144
|
+
/** Hard ceiling per clip. Defaults to what the clip's duration allows at `maxPerSecond`. */
|
|
94
145
|
maxPerClip?: number;
|
|
95
146
|
/** Per-clip opt-out; defaults to every clip. */
|
|
96
147
|
clipEnabled?: (clipIndex: number) => boolean;
|
|
97
148
|
/** Where truncation notices go. Defaults to stderr. */
|
|
98
149
|
log?: (line: string) => void;
|
|
99
150
|
}
|
|
100
|
-
|
|
101
|
-
|
|
151
|
+
/**
|
|
152
|
+
* 30, not 15: measured on a real cut, the selected footage held 227 distinct
|
|
153
|
+
* HUD states across 15.3 s of output (14.8/s average, four of seven clips over
|
|
154
|
+
* 15/s), so a 15/s ceiling was discarding roughly 45% of the HUD motion the
|
|
155
|
+
* game actually rendered.
|
|
156
|
+
*
|
|
157
|
+
* ffmpeg used to be the reason for a low ceiling — one PNG input plus one
|
|
158
|
+
* serial overlay node per keyframe cost ~23 MB of RSS each and corrupted the
|
|
159
|
+
* render above ~400. The overlays now ride one densified image2 sequence whose
|
|
160
|
+
* cost is flat in keyframe count (measured 2.83 s / 0.94 GB at both 126 and
|
|
161
|
+
* 902 distinct rasters), so the remaining cost is ~25 ms of Playwright per
|
|
162
|
+
* keyframe plus its PNG on disk. 0 disables the limit entirely.
|
|
163
|
+
*/
|
|
164
|
+
export declare const DEFAULT_MAX_KEYFRAMES_PER_SECOND = 30;
|
|
165
|
+
/**
|
|
166
|
+
* Sole per-clip ceiling, a backstop for `--ui-keyframe-rate 0`: at any real
|
|
167
|
+
* rate the limiter below admits at most rate·duration+1 keyframes per clip on
|
|
168
|
+
* its own, so nothing else can bind. A fixed 240 used to freeze the overlay
|
|
169
|
+
* after 16 s of any clip busy enough to sustain the default rate — exactly the
|
|
170
|
+
* clip a trailer is cut from. 60 s of output at 60/s.
|
|
171
|
+
*/
|
|
172
|
+
export declare const MAX_KEYFRAMES_PER_CLIP_CEILING = 3600;
|
|
102
173
|
/**
|
|
103
174
|
* Walk every enabled clip's source range and emit a keyframe wherever the
|
|
104
175
|
* reduced HUD state changes.
|