Open JetPoweredGaming opened 1 month ago
The relevant line throws the following warning for me:
File last modified by @TokageItLab 4 months ago, this particular line last year, also by same dev.
Can you get an MRP as opposed to a whole project? Thanks!
The part pointed out in the comment above is indeed suspect, but I am not certain that is the cause of the problem. The attached project is too large and cannot be debugged easily, so please resend a minimally configured project that can reproduce the problem.
However, if the crashes were as frequent as description, there should be many more of the same issue reported, but not so currently. So I expect that it is a problem in special cases, such as dynamic creation of BlendSpace points, old BlendSpace information in tscn/tres, or problems with loading/instantiate timings.
I've tested the provided project and there is something strange happening with the enemy animation tree that might be related to the crashes, its difficult to confirm.
This line animation_tree.set("parameters/Move/blend_position", Vector2((velocity.x/velocity.x), (velocity.z/velocity.z)))
called on _physics_process causes 2 errors for each enemy there is in the scene.
E 0:00:01:0003 blend_node: Condition "p_node.is_null()" is true. Returning: NodeTimeInfo() <C++ Source> scene/animation/animation_tree.cpp:181 @ blend_node()
My best guess is that it is something to do with a delayed initialization of animation_tree.
If you add await get_tree().create_timer(0.001).timeout
before calling it, the errors goes away.
I've also made a counter that removes the error
# On _physics_frame
if skip > 7:
animation_tree.set("parameters/Move/blend_position", Vector2((velocity.x/velocity.x), (velocity.z/velocity.z)))
skip += 1
Trying to update the animations in the first 6 physics frames causes the error. So its probably something to do with time, and not priority order of initialization.
I haven't had it crash on me since I've added the skip to avoid the errors, but as the crashes only happened a few times, I can't confirm if that fix was the reason or not.
---- Also, @JetPoweredGaming You should consider deleting your '.godot' folder to regenerate it. There is 250 imported music cached there which are not in the project that makes it 1GB+ in size. recreating the '.godot' folder will make its size go from 1.1GB to 93MB and can make the editor run better.
Also, in your opening_area scene, you have mistakenly made the music and ambient audio streams locals. This makes your opening scene 32MB and that is the reason it takes a couple of seconds to save/load the scene. Removing the local resourced audio files will make the opening scene size go to 0.6 MB and save/load instantly.
@GustJc Seems like adding the delay when initializing the animation_tree is working for now. I'm going to do some more testing to see if it fixed all issues. I'm super amateur at this stuff so the helpful tips are greatly appreciated. I was wondering why my project was so bulky when I deleted all the assets I wasn't using. Thank you all! I will add on later if I'm still having the crashes, but my best guess is that fixed it.
Tested versions
System information
Godot v4.4.dev3.mono - Windows 10.0.19045 - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 32.0.15.6094) - Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz (16 threads)
Issue description
When running or loading into 3D Scenes, the game crashes sometimes. if I run in a custom build with debug symbols I get this. Seems like it's possibly an issue with an animation tree? I have no idea how to diagnose or fix this issue.
Steps to reproduce
Run any 3D scene with NPC CharacterBody3D's in my project
Minimal reproduction project (MRP)
Link to my project here: https://drive.google.com/file/d/1XEsY0DzpiZ0vT8pcSUoZQ8mpA1NuxzFH/view?usp=sharing