0 votes

enter image description here

Yellow is scripts time in profiler
enter image description here

My script doesn't add much frame time. My fps drops significantry (from 230 to 14) when I spawn 8 bots. All bots have 40 bones, 17 physical bones, animation tree. When I add bots my script doesn't add much time, it's usually under 1 ms summary for all my scripts, so I think godot AnimationTree and physics are extremily slow? What do I do? If I rewrite my whole game as a module, would I even get any boost or godot is just not compatible with type of game I'm making?
I tried disabling process and physics process, remove collisions for physical bones, and when I disable everythign so my bots just float in air withotu brain and logic - there is no fps drop, however enabling any part of script adds significant (~1ms) delay to frame, and I don't think I can even optimize all that, there are just essential things like more blend in BlendTree2D for 2D movement animation, blend hand attack animation, manipulate ragdoll and stuff like that.

I have physical ragdoll based combat and GridMap https://www.youtube.com/watch?v=FZT0cyaixAk&feature=youtu.be

Godot version 3.2.2-stable
in Engine by (130 points)

1 Answer

+1 vote

To put your mind at rest, I've got dozens of animations in my game and the fps holds up fine. There is no intrinsic problem with Godot here.

My guess would be that you've probably got a for / while loop that's iterating like crazy every frame. Or maybe an animation that's starting and stopping. Without seeing your code I can't know.

You'll fix this with commenting. So you disabled _process, _physics_process etc and the frame rate jumped. Add them back one at a time and and see which one has the issue. Once you've done this comment one section of code at a time within this until the fps jumps up. Just a process of elimination and you'll find the culprit.

Don't worry about Godot, it's perfectly solid when it comes to animations.

by (1,877 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.