mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-06 08:46:06 -10:00
* A playable's 3D is drawn by Bevy's own PBR programs (PA11) tools/bevy-glsl composes Bevy's mesh, pbr and prepass shaders with Bevy's ShaderCache for a WebGL2 device and translates them with naga; sdk/playable/bevy/build.sh writes them, with each uniform block's field offsets, into host/bevy/programs.ts, and apps/playable's test fails when Bevy's shaders or the translator change without a rebuild. host/bevy.ts replaces three.js's renderer and the tone pass: it reads raea's three.js scene graph and fills Bevy's blocks as Bevy's render world does (reverse Z, one light cluster, one directional shadow cascade, point and spot lights, distance fog), draws into half float with 4x MSAA, and maps through TonyMcMapface's table. A Plane3d now reaches three.js as its one face, not as a box with no depth whose top face three points down. Against `raea render --frame`: brick-rush portrait frame 90 6.1 -> 4.3 / 255, landscape frame 300 9.8 -> 7.7; a light test scene 0.7 to 1.3 with fog, point and spot lights and an orthographic camera. The page is about 100 KB smaller and its first frame is as fast as before in WebKit. * bevy-glsl gets its layer; one fewer helper and line for the gates tools/layers.toml places bevy-glsl under tools. The translator's one-use int() helper is folded into its call (a duplicate of uint()), so programs.from moves while programs.ts stays byte for byte. scene.ts asks geometry.ts's planeOf for a Plane3d's face in one line, back to 500. --------- Co-authored-by: shinyobjectz <[email protected]>
340 lines
30 KiB
Gherkin
340 lines
30 KiB
Gherkin
@spec
|
||
Feature: raea games as playable ads, exported for every ad network from the TSX that renders the video ad
|
||
Shane, 2026-10-29: "lets build a playables feature and explore how we can optimize or help raea agents build for
|
||
playables specifically as well as explore the export options included with it". A playable ad is a 15-60 second
|
||
mini-game served in place of a video ad, inside other apps' WebViews; it ends on a card that opens the store. Bevy
|
||
stays the engine for games (docs/web-export.md is raea's own web build); a playable is an export of a game, drawn by
|
||
a light web renderer on the same scene contract, because Bevy's renderer doesn't fit an ad (PA0b). The code is
|
||
sdk/playable (raea/playable for authors, the browser host, the export tools); the example is
|
||
examples/playables/brick-rush.tsx.
|
||
|
||
Background:
|
||
Given the networks that take advertiser playables in 2026, read from each network's own spec on 10-29
|
||
| network | package | cap | install call | also |
|
||
| AppLovin | one HTML, all inlined (base64/122) | 5 MB | mraid.open(url) | MRAID 2.0; timer starts at the first touch |
|
||
| Unity Ads | one index.html, inlined, minified | 5 MB | mraid.open(url) | MRAID 3.0 injected by the webview; start on ready + viewable, pause when not; both orientations |
|
||
| Google | ZIP, index.html, at most 512 files | 5 MB | ExitApi.exit() | exitapi.js and <meta name="ad.orientation"> in the head; billed per engagement |
|
||
| Meta | one HTML with data URIs, or ZIP | 5 MB | FbPlayableAd.onCTAClick() | no mraid.js; ZIP at most 100 files (blogs that say 2 MB are out of date) |
|
||
| Moloco | one HTML with data URIs, no ZIP | 5 MB | FbPlayableAd.onCTAClick() | mraid.js banned |
|
||
| Mintegral | ZIP: a folder and a page of one name | 5 MB | window.install() | gameReady() when loaded, gameStart from the network, gameEnd() when over |
|
||
| TikTok | ZIP, index.html + config.json | 5 MB zipped | window.openAppStore() | their playable-sdk.js before the game's script; {"playable_orientation": 0/1/2}; no mraid.js |
|
||
| Liftoff | one HTML, or ZIP with one folder | 5 MB | Liftoff.open() | relative paths only |
|
||
And every network refuses a network request, a redirect without a tap, and sound before the first touch
|
||
And ironSource's own network closed on 2026-04-30 (its traffic is Unity LevelPlay's)
|
||
|
||
Rule: Settled questions
|
||
|
||
Scenario: PA0a. What a raea playable is
|
||
Given a game written as any raea game is: React TSX, its state a pure fold of input (useGameState), its 3D the
|
||
SDK's components (which render data-3d elements, the contract the native engine reads)
|
||
Then the same file renders with `raea render` as the video ad (no one touches it, so it plays itself) and exports
|
||
with `raea playable` as a playable for each network
|
||
And it imports raea/playable for the store: <EndCard show={over}> when the game is over, <InstallButton> anywhere,
|
||
or install() from a tap; outside an export install() does nothing
|
||
And it registers a portrait and a landscape composition when it can (the host plays the one nearest the screen;
|
||
a single one is letterboxed, and Unity, AppLovin, Moloco and Mintegral want both)
|
||
|
||
Scenario: PA0b. Bevy's renderer stays out of ads; a light web renderer draws them (measured 10-29)
|
||
Given brick-rush's scene (24 cuboids, paddle, ball, a shadowed directional light) in plain Bevy 0.20 for
|
||
wasm32 (opt-level z, fat LTO, wasm-opt -Oz), next to the three.js export of the same game
|
||
| build | wasm | one HTML (base64) | zipped |
|
||
| Bevy, default features | 23.3 MB | 31.3 MB | 7.4 MB |
|
||
| Bevy, the features raea-render turns on | 21.5 MB | 28.7 MB | 6.9 MB |
|
||
| Bevy, only what the scene needs (WebGL2) | 12.3 MB | 16.5 MB | 3.7 MB |
|
||
| Bevy, only what the scene needs (WebGPU) | 10.8 MB | 14.6 MB | 3.1 MB |
|
||
| Bevy logic only (App, ECS, Transform; no renderer) | 0.55 MB | 0.74 MB | 0.2 MB |
|
||
| sdk/playable: React + three.js + the game | - | 0.79 MB | 0.22 MB |
|
||
And stored gzipped inside the page (DecompressionStream, in every WebView since 2023) the stripped WebGL2 build
|
||
is 4.99 MB as base64: under 5 MB with nothing left for raea's own crates, the game or its assets (brotli: 3.4 MB,
|
||
but older WebViews can't decompress brotli)
|
||
And first frame served from localhost: Bevy 1.9 s, three.js 0.66 s; at 4x CPU throttle 3.2 s and 1.5 s
|
||
Then the renderer (wgpu, naga, bevy_pbr) is about 95% of Bevy on the web: logic alone is small
|
||
And the industry does the same: Unity Playworks (ex-Luna) never ships Unity's WebGL build; it converts the game's
|
||
C# to JavaScript and runs it on its own ~650 KB playable engine; PlayCanvas's engine is ~1.2 MB
|
||
And so a playable is drawn by a light WebGL2 renderer on raea's scene contract, its look held to the native
|
||
engine's by a parity check (PA9), its shading moving toward Bevy's own (PA10, PA11); Bevy's logic may come along
|
||
as wasm (PA12); Bevy wasm stays the path for raea's uncapped web export (docs/web-export.md)
|
||
And WebGPU is on by default in iOS 26's WKWebView and reported in Android WebView, but a playable targets WebGL2
|
||
for reach
|
||
|
||
Rule: Built 10-29
|
||
|
||
@done
|
||
Scenario: PA1. The browser host
|
||
Then sdk/playable/src/host/main.tsx mounts the registered composition nearest the screen's shape on a stage
|
||
scaled uniformly into the screen, steps a Clock 1/fps at a time off requestAnimationFrame with the person's
|
||
input recorded per frame as live entries (input.ts: keys, the primary pointer, every finger, in composition
|
||
px), and draws the page's data-3d parts with three.js under the page (scene.ts), the page's background behind
|
||
the 3D becoming its clear colour
|
||
And it starts when the network says the ad is viewable, pauses while it isn't, stops stepping when the game's
|
||
EndCard shows, and at the composition's last frame shows its own EndCard
|
||
And the status: brick-rush plays in headless mobile Chrome in portrait and landscape; a drag moves the paddle; three
|
||
misses show "So close!"; a tap on the card fires end then install (tools/check.ts, PLAY_SECONDS=25)
|
||
|
||
@done
|
||
Scenario: PA2. Each network's start, pause, store and end calls
|
||
Then sdk/playable/src/network.ts is built with the network's name (__RAEA_NETWORK__) and the store links, and maps
|
||
whenReady, install and end onto the table in the Background (MRAID's ready/viewableChange; Mintegral's
|
||
gameReady, gameStart, gameEnd; the store call per network; preview does nothing)
|
||
|
||
@done
|
||
Scenario: PA3. raea/playable for authors
|
||
Then install(), end(), <EndCard> (the whole card opens the store; end() when it first shows) and <InstallButton>,
|
||
plain page elements, so a native render draws them as the playable does
|
||
|
||
@done
|
||
Scenario: PA4. The lint: what a playable can't have, refused before it is bundled
|
||
Then `raea playable` (apps/playable lint.rs, with sdk/playable/src/export/walk.ts run by `raea run`) renders each
|
||
composition at 12 frames through its length and refuses a 3D kind the host doesn't draw (PLAYABLE_KINDS in
|
||
host/kinds.ts), staticFile, URLs, fetch/XHR/WebSocket, modules that need
|
||
the native engine, and <Video>/<Audio> until PA6; it notes a missing raea/playable import and a single
|
||
orientation
|
||
|
||
@done
|
||
Scenario: PA5. One export, every network's package
|
||
Then `raea playable GAME.tsx -o DIR [--networks ...] [--ios URL] [--android URL] [--title T] [--cta T]
|
||
[--orientation O]` lints, bundles one minified script (PA13) and writes each network's page or ZIP, its settings
|
||
in a preamble before the script, checked against its cap
|
||
And the status: brick-rush exports for all nine targets (eight networks and preview) at 916 KB per HTML and 292 KB
|
||
per ZIP (786 and 218 before PA10's tone-mapping table)
|
||
|
||
@done
|
||
Scenario: PA7. A playable played as a phone shows it
|
||
Then sdk/playable/tools/check.ts PAGE.html OUT [WxH] opens it at a phone's size with touch (WebKit since PA7b),
|
||
drags across it, saves screenshots, reads the console and the ad events back, and fails on an exception or a
|
||
network request; CPU_THROTTLE=4 for a slow phone, PLAY_SECONDS to play to the end and tap the card
|
||
|
||
Rule: Made viable again 11-28
|
||
The 11-06 public-first squash took raea/playable and @raea/playable out of the public sdk/tsconfig.base.json (as it
|
||
did raea/body and raea/gen), so every export failed at the lint with "Cannot find module 'raea/playable'"
|
||
|
||
@done
|
||
Scenario: PA4b. The tools resolve the SDK's names themselves
|
||
Then sdk/playable/tools/alias.ts resolves raea, raea/<module> and @raea/<package> from sdk/tsconfig.base.json's
|
||
paths as engine/bundle's script.rs does, plus raea/playable and @raea/playable/*, as a Bun plugin for the bundle
|
||
And the lint's walk (tools/walk.ts) runs bundled after the game instead of imported by Bun's runtime, whose own
|
||
tsconfig paths ("raea/*") catch raea/playable before any plugin
|
||
And a game's own components in a project with no SDK tsconfig bundle as they render (mobile-ads' gates did not)
|
||
And the status 11-28: brick-rush exports for all nine targets (1,431 KB per HTML, 471 KB per ZIP); mobile-ads'
|
||
tiles (1,393 KB) and gates (1,395 KB) export for AppLovin, Google and preview
|
||
|
||
@done
|
||
Scenario: PA7b. The check plays in WebKit
|
||
Given iOS ad WebViews are WebKit, and raea doesn't test in Chrome (Shane 11-15)
|
||
Then tools/check.ts plays the page in Playwright's WebKit (playwright-core 1.64.1, the app's version) at a phone's
|
||
size with real pointer input held over frames, fails on an exception, a network request, an empty page, or an
|
||
end-card tap with no install event; parity.ts draws its still in WebKit too, and tools/chrome.ts is gone
|
||
And a network's own page tags (Google's exitapi.js, TikTok's playable-sdk.js) are stopped but not failed: the ad
|
||
view serves them
|
||
And the status 11-28: brick-rush, tiles and gates play to their end cards, events ["end","install"], no requests
|
||
|
||
Rule: Next
|
||
|
||
@done
|
||
Scenario: PA6. Sound in a playable
|
||
Given networks keep sound off until the first touch and most players never turn it on
|
||
Then raea/tone's instruments and the export's generated foley (TokenSynth, SAO) play through Web Audio from data
|
||
URLs after input.onFirstTouch, inside the size budget
|
||
# Status 12-03: built. The lint no longer refuses <Audio>; its walk renders raea/tone's output beside each
|
||
# composition (as the native entry does) and lists every generated sound the game describes (raea/asset keeps
|
||
# them by src). The export makes each one with the asset store a render uses (apps/playable sound.rs), AAC at
|
||
# 64 kb/s mono, and carries it as a data URL; it bundles host/sound.ts only for a game with sound and Tone.js
|
||
# (host/tone.ts, the project's `raea add [email protected]`) only for a raea/tone graph, which it builds from Tone's
|
||
# own classes and replays event by event. Sound starts in the first gesture, pauses while hidden and fades at
|
||
# the end card; a frame stepped past on a slow phone still renders its page, so an <Sfx> on it sounds.
|
||
# brick-rush now has a square-wave blip on the paddle and each brick and a generated crack (5 KB) under each
|
||
# brick: 1,844 KB a page. Checked in WebKit: nothing sounds before the first touch; after it the context runs,
|
||
# six raea/tone events started six oscillators and three cracks played, with no errors. tools/check.ts
|
||
# reports sound and fails a page whose sound doesn't decode or never plays.
|
||
|
||
@done
|
||
Scenario: PA8. Fonts inlined
|
||
Given brick-rush's page asks for Inter, which a phone doesn't have (it fell back to a serif in the first check)
|
||
Then the export inlines the subset of each font the page uses, as the native render draws it
|
||
# Status 12-03: built (apps/playable fonts.rs). The native page draws with core/fonts' faces (Fontsource latin
|
||
# subsets, Inter 400/700/900), each family it names aliased (Helvetica, Arial, SF Pro as Inter, Times as EB
|
||
# Garamond) and each weight drawn by the nearest face. The export inlines, for the page's default (Inter) and
|
||
# every family the game's script names that raea aliases, those same faces under that name, each face's weight
|
||
# a range (Inter 1-550, 551-800, 801-1000) so the browser picks the face core/fonts `face` picks; a test holds
|
||
# the two picks equal at every weight. Inter adds about 95 KB a page. Checked: brick-rush's weight-900 "Drag to
|
||
# play" draws the same face and weight in WebKit as in `raea render --frame` (it drew Inter SemiBold, then a
|
||
# serif, before); parity at frame 90 went from 8.4 to 6.1/255.
|
||
|
||
@done @needs:PA1
|
||
Scenario: PA9. The playable is held to the native render
|
||
Then a parity check renders the same composition frame with `raea render` and in the playable host (headless
|
||
Chrome, scripted input none, so both play themselves), and compares the 3D's colours where both drew a part
|
||
And it fails when they drift past a bar, so the light renderer can't quietly lose the look
|
||
And the status: sdk/playable/tools/parity.ts GAME.tsx COMPOSITION FRAME OUT [BAR] renders the frame with `raea render
|
||
--frame`, opens a preview build at the composition's size with #still=FRAME&comp=ID (the host draws that one frame
|
||
and stops), and compares the pixels the native frame drew over its background: coverage, mean colours, brightness
|
||
and mean difference (0-255), exiting 1 over BAR (default 16); native.png, playable.png and diff.png are kept
|
||
|
||
@done @needs:PA9
|
||
Scenario: PA10. The lighting conversion
|
||
Given the SDK's 3D layer hands lights to the renderer in its own units (r3f intensities converted from Bevy's lux,
|
||
lumens and cd/m²) and Bevy draws with its camera exposure and TonyMcMapface tone mapping
|
||
Then the host converts them so PA9's colours match
|
||
And the status: host/scene.ts turns the SDK's intensities back into Bevy's units (lux 8000, lumens 9e5 over 4π,
|
||
ambient 400 × π) times Bevy's camera exposure (1 / (1.2 · 2^9.7)); host/tonemap.ts draws the 3D into a half-float
|
||
target and maps it through TonyMcMapface, Bevy's own 48³ table (tools/tony.ts reads bevy_core_pipeline's ktx2)
|
||
resampled to 32³ sRGB bytes (98 KB; the 48³ table scored 5.3 for 311 KB more), sampled as tonemapping.wesl does;
|
||
where nothing was drawn it stays transparent over the page's own background
|
||
And the numbers on brick-rush (mean difference / 255, brightness): portrait frame 90 went from 50.2 and 0.688x
|
||
(three.js's units, no exposure) to 5.4 and 0.992x; landscape frame 300 is 9.1 and 0.971x. three.js's built-in
|
||
curves on the converted units scored Reinhard 14.5, Neutral 21.2, AgX 23.3, none 30.4, ACES 37.9; what is left is
|
||
the shading itself (the bricks' side faces a touch darker), PA11's job
|
||
|
||
@done @needs:PA9
|
||
Scenario: PA11. Bevy's own shading in the light renderer
|
||
Then Bevy's PBR shaders, composed for the pipelines a playable uses, are translated to GLSL ES 3.00 with naga at
|
||
export time, and the light renderer draws with them instead of three.js's own materials
|
||
And the 10-29 trial: Bevy 0.20's shaders are WESL, composed by bevy_shader with wesl 0.6 (defs as feature flags,
|
||
Int/UInt defs in a virtual `constants` package, `bevy_pbr/bevy_core_pipeline` folded to `bevy_core_pipeline`). A
|
||
standalone program doing the same over the registry sources, then naga 30 (validate, GLSL ES 3.00 for WebGL),
|
||
with WebGL2's defs (WEBGL2, NO_ARRAY_TEXTURES_SUPPORT, NO_CUBE_ARRAY_TEXTURES_SUPPORT, SIXTEEN_BYTE_ALIGNMENT,
|
||
AVAILABLE_STORAGE_BUFFER_BINDINGS=0, MAX_CASCADES_PER_LIGHT=1, PER_OBJECT_BUFFER_BATCH_SIZE=93 for the 176-byte
|
||
Mesh in 16 KB) and the mesh pipeline's for a plain forward StandardMaterial mesh with TonyMcMapface in the shader:
|
||
| shader | GLSL ES 3.00 | gzip | in Chrome's WebGL2 |
|
||
| bevy_pbr::render::pbr frag | 1,703 lines, 88 KB | 16 KB | compiles (29 ms) |
|
||
| bevy_pbr::render::mesh vert | 175 lines, 6.8 KB | 1.7 KB| compiles; the pair links (551 ms) |
|
||
| bevy_pbr::prepass (shadows) | 150 lines, 5.5 KB, vertex | | translated, not linked yet |
|
||
And what that leaves: nothing has been drawn with them. The program binds 7 textures (4 material maps, the point
|
||
and directional shadow maps, the Tony LUT) and 11 uniform blocks the host would fill as Bevy's render world does:
|
||
View (784 B), Lights (2,176 B), the cluster offsets, index lists and clustered lights (16 KB each, so the host
|
||
clusters lights on the CPU as Bevy does on WebGL2), the StandardMaterial (192 B), the Mesh batch and Globals.
|
||
That packing, and the shadow passes, are PA11's real work; the shaders themselves come over unchanged
|
||
# Status 12-03: built. tools/bevy-glsl composes the three programs with Bevy's own ShaderCache (raea's vendored
|
||
# bevy_pbr, bevy_render and bevy_core_pipeline 0.20.0, WebGL2's defs, 10 directional lights, Gaussian shadow
|
||
# filtering, MSAA, distance fog, the projection's kind read from the view) and naga 30 translates them;
|
||
# sdk/playable/bevy/build.sh writes them into host/bevy/programs.ts (105 KB, 21 KB gzipped) with each block's field offsets and which of Bevy's bindings each
|
||
# block and sampler is, and apps/playable's test fails when Bevy's shaders or the translator change and it isn't
|
||
# rebuilt. host/bevy.ts replaces three.js's renderer (three.ts and tonemap.ts are gone): it reads raea's three.js
|
||
# scene graph (scene.ts) for the parts, geometry and transforms, and fills Bevy's blocks as Bevy's render world
|
||
# does (bevy/fill.ts: prepare_view_uniforms, prepare_lights, MeshUniform::new, StandardMaterial's uniform; the
|
||
# lights back in Bevy's units through units.ts): reverse Z, one 1x1x1 light cluster packed as Bevy packs it for
|
||
# WebGL2, one directional shadow cascade (as Bevy on WebGL2 has) fitted to what the camera sees of the scene,
|
||
# point and spot lights, distance fog (Bevy's GpuFog from the scene's Fog: linear from near to far, or
|
||
# exponential for a density, as the native engine makes it), a forward pass into half float with 4x MSAA, then
|
||
# TonyMcMapface through Bevy's table. A Plane3d is drawn as its one face (Bevy's PlaneMeshBuilder), not as the
|
||
# flat Box three.js was given, whose top face three points down. Not drawn yet, each warned once in the
|
||
# console: an environment's light, a camera's own <Fog> (Bevy's DistanceFog component), normal maps, transmission, vertex colours, point and
|
||
# spot shadows, rect lights, a shadow catcher, a paint look
|
||
# Measured on brick-rush against `raea render --frame` (mean difference over the drawn pixels / 255, both pages
|
||
# against the same native frames; landscape frame 300 rendered with --despite type-over-part): portrait frame 90
|
||
# three.js 6.1 -> Bevy 4.3 (PA10 recorded 5.4), landscape frame 300 9.8 -> 7.7, what is left in landscape mostly
|
||
# the page's pulsing hint text. star-catch portrait frame 150: 17.0 -> 15.6 over the frame, 6.7 -> 5.0 over the
|
||
# 3D above the hint text. A scene of a floor, six boxes, a ball, a sun with shadows, a point light and a spot
|
||
# light (frame 10): perspective portrait 1.3, orthographic landscape 0.8, with linear fog 0.7, with exponential
|
||
# fog 0.7. The page: brick-rush 1,889 -> 1,794 KB (three's renderer out, the programs in).
|
||
# First frame in a fresh WebKit (served from localhost, to the GPU finishing it, 25 interleaved runs): three.js
|
||
# median 131 ms, mean 129.8; Bevy median 131 ms, mean 131.8. The GL work is about 5 ms on both pages; the rest
|
||
# is script and the page. Chrome's 4x CPU throttle isn't used (raea doesn't test in Chrome); with every WebKit
|
||
# process clamped to the efficiency cores at background priority (taskpolicy -b), 142 and 145 ms over 11 runs.
|
||
# brick-rush and star-catch play to their end cards and store taps in WebKit (tools/check.ts) in portrait and
|
||
# landscape, with instant and 150 ms taps
|
||
|
||
@done
|
||
Scenario: PA12. Bevy systems in a playable
|
||
Given Bevy's logic alone is 0.2 MB gzipped as wasm (PA0b)
|
||
Then a game whose rules are Rust (raea/ecs's world, behind the ecs.* native calls) runs them in wasm in the
|
||
playable, its world drawn by the light renderer
|
||
And the status (12-03): runtime/ecs builds as a cdylib for wasm32 (src/wasm.rs; sdk/playable/ecs/build.sh,
|
||
253 KB, 105 KB gzipped, no imports) into sdk/playable/src/host/ecs.wasm, with the hash of its sources beside it
|
||
(apps/playable's test fails when runtime/ecs changes and it isn't rebuilt). The lint's walk sees a World made;
|
||
the export carries the wasm and its entry loads host/ecs.ts before the game, so raea/ecs's calls (native.ts
|
||
ecsCall) reach Bevy's world in the page as they reach it in the engine. World.copy() is a game's next state, and
|
||
a store nothing holds frees its world. examples/playables/star-catch.tsx (spawn, aim and catch systems on a
|
||
World) exports at 1,824 KB, plays to its end card in WebKit in both orientations with instant and held taps
|
||
(7,724 calls answered), and its frame 150 holds the same stars, basket and score as `raea render --frame`
|
||
(shading 17.0/255 over the 3D pixels, 0.19% of the frame past 8%: PA11's). conformance/ecs-wasm.test.ts runs
|
||
one world's life on the wasm and on the TypeScript tables and finds them equal
|
||
|
||
@done
|
||
Scenario: PA13. `raea playable`
|
||
Then the export is a raea CLI verb (apps/playable) on raea's own bundler, in process: engine/bundle gained
|
||
`minify` (Rolldown's minifier), `inline` (inline.rs: pictures, sounds, fonts and .glb as data URLs, a .bin as a
|
||
Uint8Array) and package-folder aliases (`--alias three/=DIR`, three.js from the project's node_modules, else
|
||
raea's own)
|
||
And the lint's walk runs as `raea run` in a process of its own; tools/playable.sh, bundle.ts, lint.ts, walk.ts,
|
||
alias.ts and chrome.ts are gone, and Bun is needed only for check.ts, parity.ts and tony.ts
|
||
And the status 11-28: brick-rush writes all nine targets in 7 s (1,384 KB per HTML, 464 KB per ZIP), mobile-ads'
|
||
tiles (1,345 KB) and gates (1,347 KB) export, and all play in WebKit, the Google and TikTok packages included;
|
||
a game with staticFile is refused with the reason first
|
||
And fonts travel as pictures do: an imported .ttf, .otf, .woff or .woff2 is its path in a native render and a data
|
||
URL in a playable, named in an @font-face; <EndCard> takes font, color and button for a brand's own card
|
||
|
||
Scenario: PA14. Agents writing playables
|
||
Then the raea skill says how a playable is shaped (hook, a hand until the first touch, a fail moment, the end card
|
||
within 30-60 s, both orientations), what the lint refuses, and how to check one (tools/check.ts)
|
||
And the guide is sdk/guides/craft/motion/playable.md (`raea guide playable`, copied into the skill's motion/), and
|
||
SKILL.md routes "a playable ad" to it
|
||
|
||
@done
|
||
Scenario: PA15. A 2D playable carries no three.js
|
||
Given 11-28's tiles bundle: three.js 924 KB of 1,393 KB, react-dom 178 KB, for a game that draws no 3D
|
||
Then the export builds the host without the three.js scene when the lint finds no 3D kind (about 470 KB a page)
|
||
# Status 12-03: built. The host asks for its 3D through one interface (host/draw3d.ts); a drawer (three.ts then,
|
||
# Bevy's programs in bevy.ts since PA11) draws it, and the export's entry passes it to start() only when the lint
|
||
# found a 3D kind, so a 2D game's bundle never imports three.js. Measured (preview page, before -> after, the after with PA8's ~95 KB of Inter):
|
||
# tiles 1,345 -> 378 KB, gates 1,347 -> 380 KB, three 2D brand playables 2,752 -> 1,782, 3,409 -> 2,440 and
|
||
# 2,693 -> 1,724 KB; brick-rush (3D, keeps three.js) 1,384 -> 1,478 KB. Each of the six played to its end card
|
||
# and its store tap in WebKit (tools/check.ts), with instant taps (TAP_MS=0) and 150 ms taps.
|
||
|
||
Scenario: PA16. Playables in the review (raea cloud and the desktop)
|
||
Given the review's own player (raea-platform board-simple review.js PLAYER_DRAWS) is the one view of a shown file
|
||
in raea cloud and in desktop v3, and a playable is one HTML page that loads nothing
|
||
Then a "playable" kind is drawn by that player: the preview page in a sandboxed iframe (allow-scripts only) inside
|
||
a phone frame, portrait and landscape, restarted from the stage's own button
|
||
And the host's ad events (ready, viewable, end, install) show beside it, so a reviewer sees the store tap fire
|
||
And each network's package, its size against the cap, is a download under it, and pins and notes work as on a video
|
||
And `raea show GAME.tsx --playable` exports the preview and shows it as that kind (`raea show PAGE.html` for a page
|
||
already exported); host/show.ts refuses .html today
|
||
# Status 11-28: built. Cloud: raea-platform #99 (merged into #97's oux-audit-1128) and #101: the playable kind
|
||
# (a delivered .html), its 9:16 card, the phone either way up with Restart, the events (ready, viewable,
|
||
# hidden, first touch, end card, store opened), and the network packages folded under it as downloads, red
|
||
# past 5 MB. Shane 11-28: the page plays on a domain of its own: play.raea.io, live 11-28 (#105, #106:
|
||
# PLAY_HOST, harness/play.ts: sandbox allow-scripts, 'wasm-unsafe-eval', network off, no-transform, framed by
|
||
# app.raea.cloud, api.raea.cloud and the desktop's local port). Checked live: the ACANA export uploaded, played
|
||
# from play.raea.io in a sandboxed frame in WebKit, ready and touch posted, the bytes as exported.
|
||
# Desktop: raea-feed #124: `raea show PAGE.html` posts a play item with a page, /host/playable serves it under
|
||
# the same policy, Playable.tsx draws it with pins. `raea show GAME.tsx --playable` exports the preview first
|
||
# (engine/cli show.ts, native.ts). Checked: the real ACANA export served under the policy runs clean in WebKit.
|
||
|
||
Scenario: PA17. Video ad and playable side by side
|
||
Then one shown game is both: its `raea render` (the video ad, played by its own hand) and its playable, one
|
||
project in the review, so a creative test brief gets both formats from one file
|
||
|
||
Scenario: PA18. brick-rush plays live in the native engine
|
||
Given bench/live-3d/corpus.sh skips brick-rush: under RAEA_LIVE3D_CHECK it panics on frame 1, because the fast
|
||
rows (runtime/scene/src/live.rs) carry the sun's rotation and the full rows don't
|
||
Then the fast and full rows agree on a light's transform, and brick-rush plays live and leaves the corpus's skips
|
||
# Status 12-03: the cause: the fast path (runtime/scene fast.rs `put`) rounded every column but a placement's
|
||
# to 6 decimals, a light's rotation quaternion too, while the full rows (parts.rs) write it exact; a sun that
|
||
# never moved differed on the first fast frame. A rotation and a colour column now go through exact on both.
|
||
# runtime/scene/tests/live_light.rs panicked before the change and passes after; corpus.sh no longer skips
|
||
# brick-rush.
|
||
|
||
@done
|
||
Scenario: PA19. A brief that asks for a playable
|
||
Given a brief's goal was a cut, a shot, a kit, a scene or rules, so a brief asking for a playable planned a cut
|
||
Then core/brief has a playable goal (playable.rs: the game's TSX, its name, networks, orientation, seconds, and the
|
||
video ad too when asked) whose deliverables are what `raea playable` writes into out/playable/: each network's
|
||
page or ZIP, the preview and the export's manifest (NAME.playable.json)
|
||
And raea goal's playable pack reads that manifest at publish and done: every page under the 5 MB cap, the
|
||
compositions in the orientations asked for (both unless the brief names one), every network written, and the
|
||
game unchanged since its export
|
||
# Status 12-03: built (core/brief playable.rs, sdk/goal packs/playable.ts, `raea playable --name`, the manifest).
|
||
# The generated declarations split in two to stay under 500 lines a file: brief.gen.ts re-exports
|
||
# brief-goal.gen.ts. raea cloud's Ideate and brief form write `playable({ playable: {...} })` (raea-platform).
|
||
|
||
@done
|
||
Scenario: PA20. A tap shorter than a frame still reaches the game
|
||
Given the host handed the game only what was held when a step read the input, so a tap that went down and up
|
||
between two steps never arrived (instant taps left the attract demo running)
|
||
Then a press, a finger and a key count as held for the step after they went down, and the next step sees them
|
||
let go
|
||
# Status 12-03: #310 (host/input.ts). tools/check.ts plays with TAP_MS (0 is an instant tap, 150 by default);
|
||
# every playable above was checked both ways.
|
||
|