brunogsa

TrackEntry or each animation could have a custom index or custom value.
When using in Unreal I have to compare strings ("animation name") all the time and it has a poor performance.
brunogsa
  • Mesajlar: 10

Mario

String comparisons are unlikely to cause performance problems, even in blueprints. Can you describe your use case in more detail? Generally, you specify an animation name when setting or adding an animation once.
Kullanıcı avatarı
Mario

Mario
  • Mesajlar: 3027

brunogsa

String comparasion is poor performance even though one use std::strcmp because it tries to find the first ocurrence of '\0' character in string.
Unless you use string hash, but is not the case.
So... I uploaded a blueprint example. I try to "idle" the character if there is not any animation.
I do not know if there is a better way, like a state machine.

In the picture, if the animation name is "idle", it adds a new "idle" animation.
If the animation name is "run", I remove "running" from character state and add animation "idle"... and so on
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
brunogsa
  • Mesajlar: 10

Mario

I'm know how string comparisons work in both C++ and blueprints and I guarantee you, that they won't be a performance issue.

Your graph looks mostly good, except that you can enable looping in the "Set Animation" node and eliminate the comparison with "idle" in the beginning of the graph.
Kullanıcı avatarı
Mario

Mario
  • Mesajlar: 3027

brunogsa

@Mario Thank you for the tips.
This graph can became very complex. If it is common so it seems an opportunity to solve. :)
brunogsa
  • Mesajlar: 10


Dön Runtimes