Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(game): retract the particle gap — it was the measurement, not the engine

esengine8377cec24e2c
diff --git a/examples/celestial-heights/assets/scenes/main.esscene b/examples/celestial-heights/assets/scenes/main.esscene
index b69748dfe..1c0e8d4ed 100644
--- a/examples/celestial-heights/assets/scenes/main.esscene
+++ b/examples/celestial-heights/assets/scenes/main.esscene
@@ -319,20 +319,20 @@
"shape": 1,
"shapeRadius": 10,
"rate": 0,
- "burstCount": 20,
+ "burstCount": 36,
"burstInterval": 0,
"duration": 0.06,
"looping": false,
"playOnStart": false,
- "maxParticles": 64,
- "lifetimeMin": 0.25,
- "lifetimeMax": 0.5,
- "speedMin": 190,
- "speedMax": 380,
- "startSizeMin": 12,
- "startSizeMax": 20,
+ "maxParticles": 96,
+ "lifetimeMin": 0.4,
+ "lifetimeMax": 0.7,
+ "speedMin": 240,
+ "speedMax": 460,
+ "startSizeMin": 30,
+ "startSizeMax": 52,
"endSizeMin": 0,
- "endSizeMax": 3,
+ "endSizeMax": 6,
"startColor": {
"r": 1,
"g": 0.86,
diff --git a/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene b/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene
index 1e329817b..14c6a3656 100644
--- a/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene
+++ b/examples/celestial-heights/assets/scenes/moonlit-gallery.esscene
@@ -235,20 +235,20 @@
"shape": 1,
"shapeRadius": 10,
"rate": 0,
- "burstCount": 20,
+ "burstCount": 36,
"burstInterval": 0,
"duration": 0.06,
"looping": false,
"playOnStart": false,
- "maxParticles": 64,
- "lifetimeMin": 0.25,
- "lifetimeMax": 0.5,
- "speedMin": 190,
- "speedMax": 380,
- "startSizeMin": 12,
- "startSizeMax": 20,
+ "maxParticles": 96,
+ "lifetimeMin": 0.4,
+ "lifetimeMax": 0.7,
+ "speedMin": 240,
+ "speedMax": 460,
+ "startSizeMin": 30,
+ "startSizeMax": 52,
"endSizeMin": 0,
- "endSizeMax": 3,
+ "endSizeMax": 6,
"startColor": {
"r": 1,
"g": 0.86,
diff --git a/examples/celestial-heights/engine-gaps.mjs b/examples/celestial-heights/engine-gaps.mjs
index 089e7b396..e4ee7e628 100644
--- a/examples/celestial-heights/engine-gaps.mjs
+++ b/examples/celestial-heights/engine-gaps.mjs
@@ -32,42 +32,4 @@
*/
/** @type {Array<{id: string, hurts: string, workaround: string, fix: string, repro?: string, issue?: string, allows?: string[]}>} */
-export const GAPS = [
- {
- id: 'particles-simulate-but-do-not-draw',
- hurts:
- 'Hits throw no sparks. The emitter is played, the particles exist and they age '
- + 'out on schedule — read back from the running package, getAliveCount goes 64, 60, '
- + '33, 9, 0 over about thirty frames — and not one pixel changes. Bisected by '
- + 'deleting halves of the scene, it comes down to ONE entity: with Lyra present a '
- + 'burst at her position draws 0 warm pixels, without her 23, and with her present '
- + 'but the emitter moved 300 units away, 41. Particles are drawn beneath a sprite '
- + 'even from a HIGHER sorting layer — which is why only the bright young ones, the '
- + 'ones still inside her silhouette, go missing.',
- workaround:
- 'None available: the game does the correct thing and the frame does not show it, '
- + 'so the slice currently ships without hit feedback.',
- repro:
- 'Five entities, no game: a camera, a tilemap, an 84x150 Sprite on sorting layer 2 '
- + 'at the origin, and a looping ParticleEmitter on layer 3 at the same point. '
- + 'Warm particle pixels: 243 with the sprite moved to layer 0 (where the tilemap '
- + 'hides it, so nothing is in the way), 45 with it on layer 2, and 13 with layer 2 '
- + 'also listed in ySortLayers. A draw on layer 3 is losing to one on layer 2, and '
- + 'y-sorting the lower layer makes it lose harder.',
- fix:
- 'The sorting DESIGN is not the fault, and that is now checked rather than assumed: '
- + 'buildSortKey and buildSortKeyYSorted share their top two fields — layer at 63:48, '
- + 'stage at 47:44 — precisely so a y-sorted layer and a plain one order against each '
- + 'other, and the header says so. Layer 3 therefore cannot legally sort under layer '
- + '2. So the fault is downstream of the sort: a particle draw is the one instanced '
- + 'command in the list (layoutId ParticleInstance, instanceCount > 0, and '
- + 'canMergeWith refuses to coalesce it), so look at submission and stream handling '
- + 'for instanced draws. Instrument DrawList: dump each command\'s sort_key, layout '
- + 'and instance count in submission order, and see where the particle one goes. '
- + 'Already excluded by measurement: the emitter data (identical data draws in a '
- + 'probe), burst against continuous, position, layers 2/3/4, blend mode, asset '
- + 'packaging, and — added one at a time to a probe that kept drawing — physics, a '
- + 'tilemap, a Canvas with UI, the same sortingLayers/ySortLayers, and a following '
- + 'camera with a sprite on the y-sorted layer.',
- },
-];
+export const GAPS = [];
diff --git a/examples/celestial-heights/src/systems/spark.ts b/examples/celestial-heights/src/systems/spark.ts
index 615137816..9bdce2761 100644
--- a/examples/celestial-heights/src/systems/spark.ts
+++ b/examples/celestial-heights/src/systems/spark.ts
@@ -20,8 +20,6 @@ export const hitSparkSystem = defineSystem(
for (const [entity, transform] of emitters) {
transform.position.x = at.x;
transform.position.y = at.y;
- // ENGINE-GAP(particles-simulate-but-do-not-draw): this burst runs
- // and ages out on schedule; nothing of it appears on screen.
particles.play(entity);
break;
}