Open ChimmyChim1 opened 7 months ago
Without more details of how to reproduce this issue, it is nearly impossible to fix this. If you find a way to reliably reproduce this error, it would be great to post it here.
I appreciate your comment! I understand that it is extremely difficult without extra information about the issue. I have spent several hours removing and adding to the code in hopes of finding what causes the issue. It is simply too random to diagnose. I made this report in hopes of getting more to see this and experiment with this issue as well, and hopefully have someone comment with more information about the issue.
Without more details of how to reproduce this issue, it is nearly impossible to fix this. If you find a way to reliably reproduce this error, it would be great to post it here.
Update. I was able to play the game without any errors when I ran the generation code on the main thread. However, when I switched back to a sub thread, It would crash the game randomly without telling me the issue. I looked into the log files in my AppData/Roaming/Godot/app_userdata/ProjectName/logs and found this error within the newest log file:
Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
Vulkan API 1.3.215 - Forward Mobile - Using Vulkan Device #0: Intel - Intel(R) UHD Graphics 620
USER ERROR: No TileSet atlas source with id -1.
at: get_source (scene/resources/tile_set.cpp:549)
I hope this update helped you or someone else diagnose the issue.
I'll see if I can attempt to make a project file that recreates this error.
Note: My code does use the tilemap.get_cell_atlas_coords(layer,position) function. Which may be causing an issue with using a sub thread.
Tested versions
Godot 4.2.1 - Stable.
System information
Windows 11, Godot 4.2.1-Stable. Vulkan, Mobile.
Issue description
I made a world generator using a tile map, but oddly it keeps crashing with this error: E 0:00:25:0323 get_source: No TileSet atlas source with id -1. <C++ Error> Condition "!sources.has(p_source_id)" is true. Returning: nullptr <C++ Source> scene/resources/tile_set.cpp:549 @ get_source()
This error happens at complete random times when I walk around. Note: I made it generate more tiles when the player walks and erase the tiles too far from the player for optimization on mobile.
This world generator works great until this error crashes the game.
I do not use any plugins or modified versions of Godot.
Steps to reproduce
Uncertain. The issue may be part of the erase_cell() function or set_cell().
Minimal reproduction project (MRP)
None.