Skip to content

Fix the in-game editor crashing on a custom object of a missing extension - #9417

Merged
4ian merged 4 commits into
masterfrom
claude/dreamy-mendel-iw5mn6
Nov 26, 2026
Merged

4ian merged 4 commits into
masterfrom
claude/dreamy-mendel-iw5mn6

Conversation

@4ian

@4ian 4ian commented Nov 26, 2026

Copy link
Copy Markdown
Owner

In the in-game editor, an object whose type is not found is replaced by a placeholder (UnknownRuntimeObject). This placeholder is a 3D object, and RuntimeObject3D reads objectData.content.width/height/depth. The data of a custom object has no content, so a custom object of a missing extension made the editor crash instead of showing the placeholder.

This happened when adding an Info dialog of the Dialogs extension in a project without the PanelSpriteButton extension (which GDevelopApp/GDevelop-extensions#2377 now declares as required):

Object type "PanelSpriteButton::PanelSpriteButton" was not found - using a placeholder object as a fallback.
TypeError: Cannot read properties of undefined (reading 'width')
    at new h (A_RuntimeObject3D.ts:85:28)
    at new oi (InGameEditor.tsx:9331:7)
    at l.createObject (RuntimeInstanceContainer.ts:726:15)
    ...
    at new InfoDialog (gdjs-evtsext__dialogs__infodialog.js:9:5)

The placeholder now gives RuntimeObject3D an empty content when the object data has none, in its constructor and in updateFromObjectData (hot-reload). The dimensions are optional, so it gets the default size (100).

Tests

  • Prettier check passes.
  • TypeScript: no error in the changed lines. In this environment, tsc reports errors for the whole three.js namespace (types/global-three), on master too, so the full check could not run cleanly here.
  • I did not run it in the editor.

Generated by Claude Code

…nstalling an asset

When an asset holds several variants of the same object type (like a dialog
with a green and a red button) and they were renamed because their names
already existed in the project, every child of this type got the first
renamed variant.
…sion

The placeholder of an unknown object type is a 3D object, which reads the
dimensions in the content of the object data. Custom objects have no
content, so a child of a missing extension (like the buttons of a dialog
when PanelSpriteButton is not installed) made the editor crash. The
placeholder now uses an empty content when there is none, and gets the
default size.
@github-actions

Copy link
Copy Markdown
Contributor

⏱️ Game engine benchmarks: ✅ no significant change on the 39 benchmarks

All the 39 benchmarks and how they are measured
Benchmark Base This version Change Range between rounds
≈ NavMesh: first build of a 4096x4096 terrain 40.7ms 40.1ms -1.5% -39.1% to +11.7%
≈ NavMesh: 10 boxes moving on a 4096x4096 terrain (1 second of frames) 23.5ms 23.4ms -0.4% -1.5% to +0.1%
≈ platformer objects jumping in loop(1000x) 137.9ms 137.7ms -0.2% -1.2% to +0.6%
≈ hitBoxesCollisionTest of 10 objects with 10 objects(10000x) 81.7ms 82.2ms +0.5% -6.9% to +4.3%
≈ hitBoxesCollisionTest of 30 objects with 30 objects(1112x) 24.4ms 24.3ms -0.4% -5.2% to +5.3%
≈ hitBoxesCollisionTest of 100 objects with 100 objects(100x) 8.349ms 8.236ms -1.3% -6.5% to +3.3%
≈ hitBoxesCollisionTest of 500 objects with 500 objects(4x) 1.927ms 1.973ms +2.3% -8.7% to +6.7%
≈ hitBoxesCollisionTest of 1000 objects with 1000 objects(1x) 1.018ms 1.012ms -0.5% -5.2% to +4.7%
≈ hitBoxesCollisionTest of 1 object with 1000 objects(1000x) 53.7ms 53.3ms -0.8% -3.0% to +4.0%
≈ hitBoxesCollisionTest of 10 objects with 1000 objects(100x) 11.2ms 11.1ms -0.9% -7.6% to +4.7%
≈ hitBoxesCollisionTest of 1000 objects with 1 object(1000x) 57.2ms 57.3ms +0.2% -6.4% to +6.9%
≈ hitBoxesCollisionTest of 500 objects with themselves(4x) 1.318ms 1.317ms -0.0% -0.9% to +9.9%
≈ setAngle and setLength(100000x) 11.4ms 11.4ms -0.1% -0.6% to +0.9%
≈ convertCoords(100000x) 21.3ms 21.3ms -0.1% -3.8% to +0.4%
≈ convertInverseCoords(100000x) 21.3ms 21.3ms +0.2% -3.6% to +0.6%
≈ collisionTest between two overlapping rectangles(120000x) 47.0ms 47.6ms +1.3% -2.7% to +17.3%
≈ collisionTest between two non overlapping rectangles(120000x) 11.1ms 11.1ms +0.1% -2.9% to +7.7%
≈ getAABB of a non rotated, default center(180000x) 20.0ms 20.6ms +2.6% -0.6% to +9.8%
≈ getAABB of a rotated, default center(180000x) 20.1ms 20.6ms +2.6% -0.6% to +9.8%
≈ getAABB of a non rotated, non default center(180000x) 21.2ms 21.2ms +0.1% -7.2% to +1.8%
≈ getAABB of a rotated, non default center(180000x) 63.5ms 62.7ms -1.3% -2.4% to +0.8%
≈ getAABB of a non rotated sprite, with custom hitboxes, origin and center(60000x) 20.1ms 20.1ms +0.1% -2.7% to +2.4%
≈ getAABB of a rotated sprite, with custom hitboxes, origin and center(60000x) 67.9ms 67.9ms -0.0% -1.3% to +1.0%
≈ get(400000x) 11.6ms 11.6ms -0.1% -1.9% to +0.2%
≈ Scene: Static sprites (10000) 5.265ms 5.026ms -4.5% -13.1% to +8.4%
≈ Scene: Moving and rotating sprites (5000) 6.543ms 6.725ms +2.8% -4.4% to +12.0%
≈ Scene: Collisions and separation (500 vs 500) 16.3ms 16.2ms -0.9% -7.3% to +10.7%
≈ Scene: Physics 2D (500 bodies) 3.464ms 3.659ms +5.6% -5.3% to +13.5%
≈ Scene: Physics 3D (500 bodies) 12.9ms 13.3ms +2.8% -4.2% to +9.1%
≈ Scene: Platformer characters (300) 1.052ms 1.056ms +0.4% -5.3% to +7.8%
≈ Scene: Text updates (1000) 57.5ms 57.9ms +0.6% -4.9% to +3.3%
≈ Scene: Objects creation and deletion (100 per frame) 1.984ms 2.120ms +6.9% -12.1% to +29.1%
≈ Scene: Custom objects moving and rotating (2000) 9.319ms 9.654ms +3.6% -11.8% to +10.6%
≈ Scene: Custom objects with moving children (1000) 4.228ms 4.176ms -1.2% -23.7% to +22.0%
≈ Scene: Custom objects reading the cursor (2000) 10.7ms 9.578ms -10.5% -30.8% to +55.1%
≈ Scene: 3D custom objects moving and rotating (500) 5.887ms 6.045ms +2.7% -7.5% to +8.5%
≈ Scene: 2D lights among static obstacles (8 lights, 200 obstacles) 0.589ms 0.599ms +1.7% -9.4% to +10.3%
≈ Scene: 2D moving lights among moving obstacles (8 lights, 200 obstacles) 3.529ms 3.570ms +1.2% -4.0% to +2.8%
≈ Scene: Heavy events (variables, loops, strings) 1.614ms 1.580ms -2.1% -6.8% to +4.8%

✅ The counters (draw calls, objects count and final state) of the 15 scene benchmarks run on both versions are unchanged.

Comparing 1fa91354 to its base 381cd512 (on a pull request, the version tested is the pull request merged into its base), run alternately 4 times on the same machine (AMD EPYC 7763 64-Core Processor, 4 cores, rendering without GPU). Times are the median duration of a batch of iterations (micro benchmarks) or of a frame (scene benchmarks). A change is reported only when larger than 5% and than the differences between the rounds of a same version, and measured by every pair of rounds.

@4ian
4ian merged commit ad0bbdf into master Nov 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants