Repository navigation
Effekseer pool, HDR overlay follow-ups, treasure-chest space check, action-sequence lift and waits (runtime 20261124.1) - #98
Merged
Psychronic-Games merged 6 commits intoNov 25, 2026
Conversation
…1124.1)
Every Effekseer context was created with init(gl), so it kept Effekseer's
default pool of 4000 instances. When the pool is full Effekseer skips each new
particle (ManagerImplemented::CreateInstance returns null): nothing is thinned
and nothing is reported. The layers that spawn first keep everything and later
ones lose particles, and everything playing in the context shares the pool: an
HDR effect and its companion, one effect on several targets, other animations.
A Sky Break strike HDR play peaks at 5552, so about 1550 particles of its paint
volutes and embers were never made.
Graphics.effekseerContextSettings ({ instanceMaxCount: 16000, squareMaxCount:
40000 }) now initializes the overlay context, its restore after a context loss,
the in-scene layer and the 3D effects pass. The editor's animation previews
(Animations page, pickers, preview layer, generator) use the same numbers from
src/utils/EffekseerContextSettings.js, so a preview drops particles where the
game does. The largest single play among 965 installed test animations peaks
at 11728. A pool reserves about 5 KB per instance at init: about 80 MB of
Effekseer's heap per context instead of 20 MB.
effekseer-context-settings.test.cjs checks that every createContext site
passes the settings, that runtime and editor agree, and that the Demo copies
match. The 304 test files that read the changed sources: the same failures as
main, except three-version's vendored rebuild, which resolves node_modules
through this worktree's link (three.js and its inputs unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… distortion The HDR overlay follow-ups built on PRs 78 and 79, brought onto 0.99.7 as one change (they were seven commits, 2026-10-29 to 11-08, on a line that upstream's later HDR work rewrote around): - bloom.prefilter: Unity post-processing's bloom prefilter; a caller that passes none gets the sidecar's. - bloom.intensityKeys: bloom intensity keyed on the effect's own clock. - gradeB + gradeKeys: a second grade blended in over the effect. - Synchronized ordinary companions drawn beside an HDR effect, before the light, with optional depth occlusion; the editor previews pair them too. - An HDR effect anchored on a 3D model plays its twin. - In-scene distortion copies the backdrop through an RGBA square instead of drawing a dark copy of the scene. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Treasure quick event gave its reward through Change Items, which clamps at the party's cap, so anything over it was lost and the chest still counted as opened. Conditional Branch > Reactor gains Can Receive [Item/Weapon/Armor] [entry] x [amount]: true when numItems + amount <= $gameParty.maxItems, asked when the event runs, so VisuStella's <Max: x> and Reactor's own limits apply; a missing entry is false. It saves as a codec-tagged Script condition (kind itemCapacityCondition), reopens in the dialog, reads as "Can Receive Item: Psychronic-Games#7 Potion x 5" in the event list, and stays a plain Script once edited. Quick Event > Treasure adds Check Inventory Space (on by default) and a Failure Message. Item, weapon and armor chests put the opening route, the reward, the message and Self Switch A inside that branch; Else shows the failure text, so a full party leaves the chest closed for another try. Gold chests, unticked chests and existing events are built as before. The Message field now reaches the event translated even when left untouched. Translations for 7 new phrases in all 17 locales (machine-assisted first pass). Guide: docs/INVENTORY-CAPACITY.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… action sequences Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Effekseer pool: the overlay context made at boot keeps Effekseer's default pool while screen animations play in the scene, where it only loads effects, and takes the large pool only when it draws them itself (Graphics._overlayEffekseerSettings, used at boot and after a lost context). The in-scene and 3D effects contexts, both made at first use, keep the large pool. A game that plays no effect costs what it did before. The context-settings test checks this rule. - Flat 2D lift: a new sequence-media test drives a lifted battler through MZ's own move (updateMove) and checks it ends at the move's target. The code already guarantees it (each pose sets the offset outright and cleanup restores the saved values), so the test is a guard; no change. - reactor_hdr_overlay.js used literal NUL characters as a key separator; they are now written as the \u0000 escape (same value), so the file is text again. - Removed the never-set effect.isError and sprite._effect.isError checks; the bitmap isError() checks stay. - Comments in reactor_hdr_overlay.js no longer cite revision numbers from another fork. - HDR-EFFECT-OVERLAY.md and EFFEKSEER-IN-SCENE.md start from the restyled pages (docs/WRITING-GUIDES.md) and add the PR's material: companion and companionOccludes, bloom.prefilter, bloom.intensityKeys, gradeB and gradeKeys, twins for 3D-anchored effects, the in-scene distortion edge note, the editor's preview pairing, and the install order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restore now sizes the new overlay context by Graphics._overlayEffekseerSettings, as at boot; the test's stand-in Graphics lacked it, so the restore threw inside its try and kept the old context. The stand-in gains the helper, and the test checks the restored context is initialized with what the helper gives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four independent changes, one commit each, so they can be reviewed or reverted one at a time. The runtime ones share one revision, 20261124.1.
No new user-visible strings except in part 3, which adds 7 phrases translated in all 17 locales as a machine-assisted first pass.
1. Effekseer contexts keep 16000 particles instead of 4000
Problem
Every Effekseer context is created with
init(gl)and no settings, so it keeps Effekseer's default pool of 4000 instances. When the pool is full, Effekseer skips each new particle (ManagerImplemented::CreateInstancereturns null). Nothing is thinned out and nothing is reported. The layers that spawn first keep all their particles and later layers lose theirs.Everything playing in a context shares that pool: an HDR effect and its companion, one effect on several targets, and any other animation on screen. A Sky Break strike played with HDR peaks at 5552 instances, so about 1550 of its paint volutes and embers were never created.
What changed
Graphics.effekseerContextSettings({ instanceMaxCount: 16000, squareMaxCount: 40000 }, inreactor_core.js) now initializes every context:reactor_sprites.js);reactor_3d_effects.js).src/utils/EffekseerContextSettings.js(loaded inindex.html). That covers the Animations page, the animation pickers, the preview layer and the Effekseer generator. A preview now drops particles exactly where the game does.No new user-visible strings.
Tests
effekseer-context-settings.test.cjs(new) checks three things: everycreateContextsite passes the settings, runtime and editor agree on the numbers, and the Demo copies match.effekseer-state-guardis updated for the new init call.sync-runtime.cjs --check: the Demo matchesruntime/.2. HDR overlay: keyed bloom and grade, companions, model twins, in-scene distortion
Problem
These are the HDR overlay follow-ups to #78 and #79. They were built from 2026-10-29 to 11-08 as seven commits on a line that upstream's later HDR work (
47790645and the in-scene work around it) rewrote around. Replaying them one by one onto 0.99.7 meant resolving the same functions again and again. Part 2 carries their net change as it already runs on top of 0.99.7, as one commit.It closes six gaps:
reactor_3d_effects.jsnever read the sidecar.alpha: false, and WebGL refusescopyTexSubImage2Dfrom an alpha-less framebuffer into Effekseer's RGBA backdrop. That returnsINVALID_OPERATIONafter every capture, so the backdrop stayed black. Example: Bravely Default II's Meltdown, at its end sphere.What changed
All new sidecar fields are optional. Older runtimes ignore them and play what they played before.
bloom.prefilter = { threshold, knee, clamp }.clampper channel, then scales it bymax(b - threshold, s) / max(b, 0.0001), wherebis the brightest channel ands = clamp(b - threshold + knee, 0, 2·knee)² / (4·knee + 0.0001). That is Unity's prefilter.bloom.thresholdwould, and replaces it when both are given. The setup shader switches on a uniform, so effects without the field draw exactly as before.bloom.intensityKeys = [[frame, intensity], ...], on the effect's own clock.Sprite_Animation._effectFrame, which advances each Effekseer step (0 while paused, scaled by the fight camera's slow motion) times speed / 100.bloom.intensitystays required, because older runtimes play it. Invalid keys fail closed.gradeB+gradeKeys = [[frame, weight], ...](weight 0..1, straight lines between keys) blends a second grade in over the effect on the same clock.companionandcompanionOccludes(default true) let a sidecar name one ordinarily graded effect for the parts left out of the HDR asset.-hdreffect without a valid sidecar is refused, as it is everywhere else.SceneLayer.captureBackgroundcopies the scene into an RGBA8 scratch renderbuffer the size of the effect's square viewport.docs/HDR-EFFECT-OVERLAY.mdanddocs/EFFEKSEER-IN-SCENE.mddocument the new fields.Files:
reactor_hdr_overlay.js,reactor_sprites.js,reactor_managers.js,reactor_3d_effects.js,reactor_fight_camera.jsandreactor_main.js(the revision), each mirrored intemplate/Demo/js.utils/HdrPreview.js,utils/AnimationPreviewLayer.js,database/AnimationPickerModal.js,database/DatabaseAnimationEditor.jsandevent/AnimationPicker.js.hdr-overlay,hdr-preview-render,hdr-preview-twin(new),effekseer-in-sceneandmodel-effects.No new user-visible strings.
Tests
hdr-overlay,hdr-preview-render,hdr-preview-twin(new),effekseer-in-scene(the canvas path: screen, edge strips and corners copied from the square and reused; a filter target copied directly) andmodel-effects.sync-runtime.cjs --check: the Demo matchesruntime/.upstream/mainand the fork'smain(0.99.7 merged in) belongs to parts 1, 2 or 3. Part 2 takes the HDR series' files frommain, where they already run on top of 0.99.7 with part 1. The branch as a whole equals the fork'smainplus part 4, apart from upstream's changelog index and the revision header.3. Treasure chests wait for room
Problem
A Treasure quick event gives its reward through Change Items, and Change Items clamps at the party's cap. If the party was already full, anything over the cap was lost, and the chest still counted as opened (Self Switch A set). So the player could lose a chest's item for good just by carrying too many.
What changed
numItems + amount <= $gameParty.maxItems(item), asked when the event runs. VisuStella's<Max: x>and Reactor's own limits therefore apply. A missing entry is false.itemCapacityCondition), so the data stays plain MZ.docs/INVENTORY-CAPACITY.md, linked fromdocs/README.md.EventManager.js,event/EventCommandList.js,event/commands/ConditionalBranchEditor.jsandI18nManager.js. Tests:item-capacity-chests.test.cjs(new) andquick-event-creation-20260812.test.cjs, whose expected Treasure output gains the branch.Tests
item-capacity-chests.test.cjs(new, 11 tests) covers:quick-event-creation-20260812expects the new Treasure shape. The i18n coverage and locale-key tests pass.4. Action sequences: flat 2D lift and Wait for Animation
Problem
Two faults in native action sequences on flat 2D battles (no battle room):
sprite.yeach frame.Sprite_Battler.updatePositionthen rebuiltyfrom home + offset, so the lift lasted only until the next position update. There were three further problems:_offsetYset by something else, such as a plugin or a motion, was overwritten.What changed
All changes are in
runtime/reactor_battle_presentation.js, mirrored intemplate/Demo/js.sprite.yandsprite._offsetY, recorded as_rrAppliedLift, and taken back off at the start of the next pose and at cleanup. SoupdatePositionkeeps it, and an outside_offsetYis preserved.liftHeight(effect, time). A new lift step starts from the height the previous one has reached at that frame, so chains are seamless._reactorRoomPosition.z.adapter.media, each taggedkind: 'animation'with its targets). The wait asks those tickets first, then the spriteset's animation sprites for its targets, then the queue, and only then the battler sprites.alivefilter, and it can be cancelled.$dataAnimationsentry gives a ticket that is already finished.P.isSequenceSpritePlayingtreats a destroyed sprite, a sprite no longer in the spriteset, an MV bitmap error or an Effekseer load error as finished. Effekseer load failures are watched throughSceneLayer.load/EffectManager.load.No new user-visible strings; editor files are untouched apart from the tests.
Tests
battle-presentation: "flat 2D float, fall, jump and leap keep vertical lift across Sprite_Battler.updatePosition, chain seamlessly and restore cleanly".sequence-media: "waitFor animation holds past mid-animation impact until sequence-owned animation completes" and "waitFor animation terminates cleanly on cancel, missing data, Effekseer/MV load errors, and target death".Sprite_Battler.prototype.updatePositionfromreactor_sprites.jsand the real presentation module in avmcontext.sync-runtime.cjs --check: the Demo matchesruntime/.Verification of the whole branch
npm teston this branch (Git Bash;node_moduleslinked in from a checkout with 0.99.7's lockfile installed): 10,134 tests, 47 failing. Compared by name with the same suite on the fork'smainwith upstream 0.99.7 merged in, there are no new failures from these changes:zipon the PATH, Git Bash's GNUtar, Linux-only AppImage tooling, and tests that assume POSIX paths.three-version"vendored browser output reproduces exactly" fails because of the linkednode_modules. It fails the same way on an unmodifiedupstream/maincheckout with the same link, and passes in a checkout with its ownnode_modules.mainplus part 4, apart from upstream's changelog index and the revision header (checked withgit diff).sync-runtime.cjs --check: the Demo matchesruntime/.Changelog entries (for
editor/changelog/)Effekseer animations keep up to 16000 particles at once instead of Effekseer's default 4000 (runtime 20261124.1), in the game and in the editor's animation previews. A full pool used to skip every new particle silently, so a big effect lost its later layers. An HDR effect and its companion, or one effect played on several targets, share the pool. Each context reserves about 80 MB of Effekseer's memory for it instead of about 20 MB.
Graphics.effekseerContextSettingsholds the numbers.HDR sidecars can give
bloom.prefilter(threshold,knee,clamp: Unity post-processing's bloom prefilter), animate bloom intensity withbloom.intensityKeys, and blend a second grade in withgradeBandgradeKeys. The keys are[[frame, value], ...]on the effect's own clock, slow motion included (runtime 20261124.1). Editor previews follow all three; older runtimes playbloom.intensityandgrade.HDR sidecars can pair an ordinary
companion, drawn before the HDR light with optional depth occlusion and sharing the HDR effect's seed, transforms and lifetime. A missing companion selects the graded twin.An HDR effect anchored on a 3D model plays its graded twin instead of the raw HDR file.
Distortion layers of screen animations drawn in the battle scene bend the scene again instead of drawing a dark copy of it.
Treasure chests wait for room. Conditional Branch › Reactor has Can Receive [Item/Weapon/Armor] [entry] × [amount]. It is true when the whole amount fits under the cap the game reports when the event runs (
$gameParty.maxItems, so VisuStella's<Max: x>and Reactor's limits apply); a missing entry is false. It saves as a tagged Script condition, reopens in the dialog, reads as "Can Receive Item: [Trivial] The elements don't fit on the screen #1 Potion × 5" in the list, and stays a plain Script once edited by hand.Quick Event › Treasure adds Check Inventory Space (on by default) and a Failure Message. An item, weapon or armor chest opens, gives its reward and sets Self Switch A only inside that branch. A full party gets the message, and the chest stays closed for another try. Gold chests and existing events are unchanged.
The Treasure dialog's Message field now reaches the event in the editor's language even when left untouched.
Guide: docs/INVENTORY-CAPACITY.md.
Native action sequences on 2D battles: Float, Fall, Jump and Leap keep their height while the battler's position updates, chain without a jump in height, and give back exactly what they took, an outside offset included (runtime 20261124.1).
Wait for Animation waits for the sequence's own animation to end, past a mid-animation impact. It ends at once when the sequence is cancelled, the animation entry is missing, its effect fails to load, or its targets die, instead of holding until the safety timeout.
Limits
docs/HDR-EFFECT-OVERLAY.mddescribes.Sprite_Battler.prototype.updatePositionfromreactor_sprites.jsand the real presentation module in avmcontext, with stub sprites, not PIXI.