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
  • Messaggi: 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.
Avatar utente
Mario

Mario
  • Messaggi: 3274

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
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
brunogsa
  • Messaggi: 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.
Avatar utente
Mario

Mario
  • Messaggi: 3274

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
  • Messaggi: 10


Torna a Runtimes