Add tool for spreading tasks across frames #12421
timothyqiu
started this conversation in
Engine Core
Replies: 1 comment 1 reply
-
I proposed a way to do it in there. It's not perfect, but doesn't require any central processing in SceneTree or another singleton. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Tasks like pathfinding and enemy AI are heavy but usually do not require high immediacy. When there are a large number of characters in the scene that need to perform such tasks, to reduce the overhead per frame, a common practice is to spread these tasks across a number of frames.
For example, out of 1000 enemies, 100 enemies are processed per frame, and the round is completed in 10 frames. Or a limit is set for the processing time of each frame, and as many tasks as possible are executed per frame.
Example usage:
Beta Was this translation helpful? Give feedback.
All reactions