You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an exported Release file on Godot, if a TileMap node has a large number of tiles present in the scene, and a Camera2D node is present, upon calling get_tree().reload_current_scene(), the game has a chance of crashing without any errors, which can scale by the number of tiles present in the scene.
The game will not crash at all if get_tree().reload_current_scene() is called in debug mode.
This bug is not present in Godot 3.
Edit/Update:
The same outcome can be achieved if the Camera2D node is added after the scene is reloaded.
A workaround fix for this is having the Camera2D node exist outside the current scene.
The conditions for the bug:
Running the game as a Release (not in debug)
A Camera2D node is present
A TileMap node is filled with a large number of tiles placed
get_tree().reload_current_scene() is called
Expected outcome:
get_tree().reload_current_scene() is called
Game works as intended with no crashes
Current behavior:
get_tree().reload_current_scene() is called
There will always be a non-zero chance of the game crashing once called
Otherwise, the game will continue normally until get_tree().reload_current_scene() is called again
There are no errors and nothing is reported upon crashing in both the editor and on the released game with the verbose console option enabled.
Steps to reproduce
Create a Node2D scene
Create a TileMap in the scene
Assign the TileMap with a large number of tiles
Add a Camera2D node
Add a function anywhere that can call get_tree().reload_current_scene()
Save the scene, assign the current scene as the Main Scene
Export the project as Release
Run the released program and call get_tree().reload_current_scene()
Minimal reproduction project
The provided project has a script that automatically runs get_tree().reload_current_scene() every 0.2 seconds, with the provided scene given to easily replicate the crash once exported.
Godot version
v4.0.1.stable.official [cacf499]
System information
Windows 10 64-bit
Issue description
In an exported Release file on Godot, if a
TileMap
node has a large number of tiles present in the scene, and aCamera2D
node is present, upon callingget_tree().reload_current_scene()
, the game has a chance of crashing without any errors, which can scale by the number of tiles present in the scene.The game will not crash at all if
get_tree().reload_current_scene()
is called in debug mode.This bug is not present in Godot 3.
Edit/Update:
The same outcome can be achieved if the
Camera2D
node is added after the scene is reloaded.A workaround fix for this is having the
Camera2D
node exist outside the current scene.The conditions for the bug:
Camera2D
node is presentTileMap
node is filled with a large number of tiles placedget_tree().reload_current_scene()
is calledExpected outcome:
get_tree().reload_current_scene()
is calledCurrent behavior:
get_tree().reload_current_scene()
is calledget_tree().reload_current_scene()
is called againThere are no errors and nothing is reported upon crashing in both the editor and on the released game with the verbose console option enabled.
Steps to reproduce
get_tree().reload_current_scene()
get_tree().reload_current_scene()
Minimal reproduction project
The provided project has a script that automatically runs
get_tree().reload_current_scene()
every 0.2 seconds, with the provided scene given to easily replicate the crash once exported.Godot4TilemapTest.zip
The text was updated successfully, but these errors were encountered: