Hello, im new here and im in sort of a pickle, cant decide and keep redoing same thing differently all over again. Ive had it.
I would like some pointers maybe from graybeards out here how you guys do this. What would be the best practice?
The problem, the struggle is not to get lost in spaghetti
For example like this:
As you can see there are too many connections between many animations and transitions.. after a break from developing, coming back to this mess just pains me to look at and think - what was this thing, what does it even do. Also when you need to debug something, remembering what kind of transition or blend conditional you have set up in UI is also a pain.
Solution i think is to use scripting. But hard coding stuff is also a pain, because what if you want to add small changes to some part of the animation process, then you have to recursively rewrite all the parts accordingly.
Now. Ive researched people making state machine where you add plain Nodes with scrip that to the transition from current anim state to new one and allows you to execute some movement logic in that state. Which seems good on paper but then you read that adding nodes to the tree is taxing on resources. Not sure if its the best idea to do that. I saw a post or video where someone did a test on empty project, added 1 000 000 empty nodes to the tree on _ready() and it dropped fps to sub 30.
What i want to achieve is something that is human readable (not long piece of code page, where you get lost in recursion etc.) -> seems like dividing the animation logic into pieces such as states -> state machine.
Also expandable, so for example i want to add new move combo or something like that -> again leaning into state machine.
Im just thinking here out loud.
So i guess my question is, Is it a good idea to use statemachine type thing for 3D animations that require blending between them for a character?
If i dont have animation tree, how to do a blending for example between idle -> walk -> run animations in code? I know how using animation tree, where you change the parameters of the blend nodes and such, but without idk. Do i need to add the animtree to node tree and add other blend nodes then change params and such via code? Or maybe there is easier solution?