Praytic / youtd2

Classic community-driven session-based Tower Defense game with RPG elements.
https://youtd2.com/
MIT License
87 stars 15 forks source link

Godot 4.1 editor crashes when opening project #114

Closed Kvel2D closed 1 year ago

Kvel2D commented 1 year ago

Reproducible only on my machine.

Not ready to report issue on Godot github because don't have MRP.

Steps to reproduce for me:

  1. Get game repo from current main branch.
  2. Open Godot 4.1 editor.
  3. Select youtd2 project.
  4. Editor switches to fullscreen and displays banner for 10 seconds, then crashes.

System info from Help->Copy System Info:

Godot v4.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - integrated AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 30.0.13014.8) - AMD Ryzen 5 4500U with Radeon Graphics (6 Threads)

Messages in console before crash:

EditorSettings: Load OK!
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:73)
Loaded system CA certificates
Creating VMA small objects pool for memory type index 3
EditorSettings: Save OK!
ERROR: Can't create buffer of size: 144, error -10.
   at: (drivers/vulkan/rendering_device_vulkan.cpp:1360)

According to this website, error -10 is VK_ERROR_TOO_MANY_OBJECTS - "Too many objects of the type have already been created.": https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkResult.html

Tried clearing godot folders in %appdata%.

Tried opening 10 different sample projects and the editor didn't crash for any of them. https://github.com/godotengine/godot-demo-projects

Kvel2D commented 1 year ago

Weird scenario that temporarily fixes the issue:

  1. Open project in 4.0 editor.
  2. Hide Map node in main scene.
  3. Open project in 4.1 editor.
  4. No crash happens.

Crash comes back if:

  1. Unhide Map node in 4.1 editor.
  2. Switch to 2D view in the top editor panel.
  3. Reopen editor.
  4. Crash happens.

Crash doesn't come back if:

  1. Hide Map node in 4.0 editor.
  2. Open 4.1 editor.
  3. No crash happens.
  4. Unhide Map node.
  5. Switch to Script view in the top editor panel.
  6. Reopen editor.
  7. No crash happens.

So it's possible to stop the crash from happening if you get the editor to the state where Map scene is not being rendered, either by hiding it or switching to Script view.

Kvel2D commented 1 year ago
Kvel2D commented 1 year ago

Noticed that root node of GameScene has type Node2D but then it contains UI CanvasLayer and HUD Control inside. That seemed weird. Checked godot example projects to see how it's done there and found that root node of main scenes is set to Node type.

Tried changing GameScene root node to Node and it appears to have fixed the crash.