Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When system scale changes and Godot 4 is running, it tries to adjust and usually crashes #98514

Open
ArseniyMirniy opened this issue Oct 25, 2024 · 4 comments

Comments

@ArseniyMirniy
Copy link

Tested versions

Godot 4.3 Stable

System information

Windows 10 and 11, Godot 4.3

Issue description

Godot 4 is always following system scale, and there are many issues with that. It ignores the defined scale in the editor settings (if they are changed in system, it changes them again), it breaks UI elements, and finally, it tries to adjust on runtime.

If Godot 4.3 editor is running, and the user tries to change the scale in Windows OS settings, the app starting to consume 100% of CPU for a certain amount of time and tries to rescale everything on runtime. Very often it does not succeed and crashes. Sometimes it changes the scale, and it works (in my test, 4/10 rescales worked, and 6 crashed).

Steps to reproduce

  1. Launch Godot 4.3
  2. Open Windows 10 OS settings
  3. Change scale and apply
  4. Godot either freezes for 10-15 seconds and changes scale or crashes.

Minimal reproduction project (MRP)

Does not require a project.

@matheusmdx
Copy link
Contributor

I did 30 scale changes and wasn't able to reproduce the issue, no crashes, the freeze time was like 3~5s (what i think is expected) and max cpu usage was 10%, maybe depends on the hardware?

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21921.1000) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

@ArseniyMirniy
Copy link
Author

ArseniyMirniy commented Oct 25, 2024

I did 30 scale changes and wasn't able to reproduce the issue, no crashes, the freeze time was like 3~5s (what i think is expected) and max cpu usage was 10%, maybe depends on the hardware?

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21921.1000) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

  1. Can you try to do it while using shader graph? (for example: https://github.com/ArseniyMirniy/Godot-4-Free-Color-Correction-and-Screen-Effects-Visual-Shader — this one, ScreenEffects_Ultimate)
  2. I'm on Ryzen 6800U with Radeon 680M. It's one of the fastest mobile CPUs, and the project isn't too heavy anyway.

@ArseniyMirniy
Copy link
Author

ArseniyMirniy commented Oct 25, 2024

I clearly reproduced it when tried again (this time it scaled well two times and crashed on the third one). Scaled well = in 10-15 seconds.

And I'm on Steam version, overlay disabled.

@matheusmdx
Copy link
Contributor

This seems to has been fixed in 4.4 dev 1 by pr #95849, you can test to see if works for you too.


I did some tests and seems the problem happens when the visual shader editor is visible (related to the GraphEdit nodes), the freeze is much more longer and if you try click on Godot the screen go white showing that window is totally unresponsive. When don't crash the engine throws some errors:

Spams:
Child is not a child of this node.

With some:

scene/main/node.cpp:442 - Parameter "p_child" is null.
core/object/message_queue.cpp:222 - Error calling deferred method: 'GraphEdit::Node::move_child': Cannot convert argument 1 from Object to Object.

And when crash show this backtrace:

[Inline Frame] GetCompleteObjectLocatorFromObject(void *) Line 102 (d:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\rtti.cpp:102)
[Inline Frame] FindCompleteObject(void *) Line 308 (d:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\rtti.cpp:308)
__RTDynamicCast(void * inptr, long VfDelta, void * srcVoid, void * targetVoid, int isReference) Line 223 (d:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\rtti.cpp:223)
[Inline Frame] Object::cast_to(Object * p_object) Line 805 (c:\Users\Matheus\Downloads\Godot Source\core\object\object.h:805)
[Inline Frame] VariantObjectClassChecker<Node *>::check(const Variant & p_variant) Line 231 (c:\Users\Matheus\Downloads\Godot Source\core\variant\binder_common.h:231)
[Inline Frame] VariantCasterAndValidate<Node *>::cast(const Variant * *) Line 256 (c:\Users\Matheus\Downloads\Godot Source\core\variant\binder_common.h:256)
[Inline Frame] call_with_variant_args_helper(Node *) Line 304 (c:\Users\Matheus\Downloads\Godot Source\core\variant\binder_common.h:304)
call_with_variant_args<Node,Node *,int>(Node * p_instance, void(Node::*)(Node *, int) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 418 (c:\Users\Matheus\Downloads\Godot Source\core\variant\binder_common.h:418)
Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 58 (c:\Users\Matheus\Downloads\Godot Source\core\variant\callable.cpp:58)
CallQueue::_call_function(const Callable & p_callable, const Variant * p_args, int p_argcount, bool p_show_error) Line 221 (c:\Users\Matheus\Downloads\Godot Source\core\object\message_queue.cpp:221)
CallQueue::flush() Line 284 (c:\Users\Matheus\Downloads\Godot Source\core\object\message_queue.cpp:284)
SceneTree::physics_process(double p_time) Line 494 (c:\Users\Matheus\Downloads\Godot Source\scene\main\scene_tree.cpp:494)
Main::iteration() Line 4070 (c:\Users\Matheus\Downloads\Godot Source\main\main.cpp:4070)
OS_Windows::run() Line 1666 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\os_windows.cpp:1666)
widechar_main(int argc, wchar_t * * argv) Line 181 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:181)
_main() Line 208 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:208)
main(int argc, char * * argv) Line 220 (c:\Users\Matheus\Downloads\Godot Source\platform\windows\godot_windows.cpp:220)
[Inline Frame] invoke_main() Line 102 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:102)
__scrt_common_main_seh() Line 288 (d:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
kernel32.dll!00007ffe5d807374() (Unknown Source:0)
ntdll.dll!00007ffe5e6dcc91() (Unknown Source:0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants