0 votes

I'm making AI for my game using GDScript:


(I would be glad if somebody review my code because I'm novice in GDScript)

I found that it works too slow. Adding two NPCs to game slows it to 7 FPS. I guess, problem somewhere in scripts (it's expected, AI is hard thing and some parts should be rewritten to C++)

How to find which scripts and functions work too slow and use too much memory? Is it possible to do with built-in profiler?

in Engine by (274 points)

Have you tried the profiler in the debug tab? If so, why isn't it sufficient?

If it's not enough, then you'd probably need to build a debug build of Godot from the sources, and then run valgrind on it.

Profiler just shows that my physics process take 120% frame's time, but it doesn't show which functions called and how many and how much time took.

It shows your custom functions time too.

Custom function in Godot profiler

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.