Giter Club home page Giter Club logo

Comments (6)

jitspoe avatar jitspoe commented on July 22, 2024 4

Since I've been delving into performance stuff, here's a shot of Tracy profiling of animations with my fairly simple low-poly enemies in KOOK:
image

So the average _process_animation takes around 40 microseconds. With 100 enemies, that's like 4ms, which isn't super great.

Here's the tracy file if anybody wants to poke around:
kook trace 20240621.zip

Most of the time is spent in AnimationMixer:_blend_process followed by _blend_calc_total_weight. About 20 microseconds and 9 microseconds there.

If manually stepping is the solution, it would be nice to have some sort of built in system to prioritize closer/in view objects so they update every frame and then have a max number of animations played per frame or something.

I do feel like some optimizations could be done, though, outside of that and multithreading.

Edit: Just realized there's a PR to do some optimizations here: #92838 Nice!

from godot.

Calinou avatar Calinou commented on July 22, 2024 3

With such an high number of active animation players on characters, you'd need SceneTree multithreading to achieve reasonable performance. However, this isn't finalized yet.

Your best bet for now is to disable animation playback for nodes that are far away, or set their process mode to Manual and step through their animation less often (e.g. once every 2 frames). This is a common approach in AAA games.

VisibilityNotifier3D in 3.x has a Max Distance property that can be used to disable animation playback in the distance automatically. It hasn't been ported to 4.x's VisibleOnScreenNotifier3D yet though.

from godot.

Zireael07 avatar Zireael07 commented on July 22, 2024

The manual process mode trick should be documented somewhere

from godot.

WOLFxxxxxx avatar WOLFxxxxxx commented on July 22, 2024

GLEcxYwW4AA8ufD (1)
GLEcGh1XkAA2-YX (1)

Animation does not support multi-core

from godot.

Calinou avatar Calinou commented on July 22, 2024

Animation does not support multi-core

This is expected for now, as SceneTree multithreading isn't finished yet. Work on this started in 4.1 but it's only applied to a few parts of the engine, so I don't think AnimationTree is able to work in a thread-safe manner currently.

Despite this, it's still possible to optimize AnimationTree significantly as evidenced by the PRs linked above.

from godot.

Saul2022 avatar Saul2022 commented on July 22, 2024

GLEcxYwW4AA8ufD (1) GLEcGh1XkAA2-YX (1)

For more performance minimize or close the editor windows as that is alos consuming fps , and also what calinou said and make the debug screen fullscreen , as they are not the same size as flax so it not quite fair as a comparison...

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.