nick62
Junior vMember
Posts: 33
|
Post by nick62 on Mar 6, 2019 23:43:46 GMT
Hallo everybody!
Does FSM AI have a feature to randomize attack animations?
Also I need to randomize: idle, death and walk animations.
|
|
|
Post by Invector on Mar 7, 2019 19:12:12 GMT
There is an example in the animator controller > layer FullBody > weak attack substate called SwordRandomAttack
Basically you just need the vRandomAttackBehaviour and set the number of clips you have inside.
|
|
nick62
Junior vMember
Posts: 33
|
Post by nick62 on Mar 7, 2019 22:43:00 GMT
Thank you! But what about, for example idle animation, wich is controlled by blend tree?
How can I randomize idle animations?
|
|
|
Post by Invector on Mar 7, 2019 23:44:23 GMT
Just add your idle clips to the Random Idle blend tree, and in the player inspector add a value to the random time
|
|
nick62
Junior vMember
Posts: 33
|
Post by nick62 on Mar 8, 2019 14:13:48 GMT
Thank you, Invector Administrator, for the fast answer! I need more details about how to set random attack animations. I create sub-state machine “Unarmed Random” and set condition for it AttackID ==0. And add script "vRandomAttackBehaviour" Also I set condition for old sub-state machine “Unarmed”: AttackID ==99. Here is details of a new sub-state machine “Unarmed Random” with different RandomAttack conditions: And here is a result on video:
You can see that the attack animations at the beginning can make some very fast switching between them in a random order.
For example at 00:43-00:45 and 00:47-00:50 animation "A" make a early transition to animation "C".
What is the reason of such behavior?
Here is a log:
[Class] [Method name] [Frame] [Log]
[vNoiseObject] [TriggerNoise] [702] TriggerNoise - SHOT [vMeleeAttackControl] [OnStateEnter] [866] Enter [vMeleeAttackControl] [OnStateEnter] [872] Enter [vMeleeAttackControl] [OnStateUpdate] [874] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateExit] [877] Exit [vMeleeAttackControl] [OnStateExit] [877] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [880] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateUpdate] [893] Z_skinny_rags_pants_LODs attack disable damage in 0.64 [vMeleeAttackControl] [OnStateEnter] [897] Enter [vMeleeAttackControl] [OnStateExit] [903] Exit [vMeleeAttackControl] [OnStateExit] [903] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [904] Enter [vMeleeAttackControl] [OnStateUpdate] [906] Z_skinny_rags_pants_LODs attack enable damage in 0.33 [vMeleeAttackControl] [OnStateExit] [907] Exit [vMeleeAttackControl] [OnStateExit] [907] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [910] Z_skinny_rags_pants_LODs attack enable damage in 0.27 [vMeleeAttackControl] [OnStateEnter] [919] Enter [vMeleeAttackControl] [OnStateUpdate] [922] Z_skinny_rags_pants_LODs attack disable damage in 0.64 [vMeleeAttackControl] [OnStateExit] [924] Exit [vMeleeAttackControl] [OnStateExit] [924] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [926] Z_skinny_rags_pants_LODs attack enable damage in 0.26 [vMeleeAttackControl] [OnStateUpdate] [939] Z_skinny_rags_pants_LODs attack disable damage in 0.72 [vMeleeAttackControl] [OnStateExit] [948] Exit [vMeleeAttackControl] [OnStateExit] [948] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [949] Enter [vMeleeAttackControl] [OnStateUpdate] [956] Z_skinny_rags_pants_LODs attack enable damage in 0.26 [vMeleeAttackControl] [OnStateUpdate] [969] Z_skinny_rags_pants_LODs attack disable damage in 0.71 [vMeleeAttackControl] [OnStateExit] [978] Exit [vMeleeAttackControl] [OnStateExit] [978] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [979] Enter [vMeleeAttackControl] [OnStateUpdate] [988] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateUpdate] [999] Z_skinny_rags_pants_LODs attack disable damage in 0.6 [vMeleeAttackControl] [OnStateExit] [1012] Exit [vMeleeAttackControl] [OnStateExit] [1012] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1021] Enter [vMeleeAttackControl] [OnStateUpdate] [1027] Z_skinny_rags_pants_LODs attack enable damage in 0.25 [vMeleeAttackControl] [OnStateUpdate] [1041] Z_skinny_rags_pants_LODs attack disable damage in 0.72 [vMeleeAttackControl] [OnStateExit] [1049] Exit [vMeleeAttackControl] [OnStateExit] [1049] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1069] Enter [vMeleeAttackControl] [OnStateEnter] [1075] Enter [vMeleeAttackControl] [OnStateUpdate] [1076] Z_skinny_rags_pants_LODs attack enable damage in 0.27 [vMeleeAttackControl] [OnStateExit] [1081] Exit [vMeleeAttackControl] [OnStateExit] [1081] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1082] Z_skinny_rags_pants_LODs attack enable damage in 0.25 [vMeleeAttackControl] [OnStateUpdate] [1095] Z_skinny_rags_pants_LODs attack disable damage in 0.7 [vMeleeAttackControl] [OnStateExit] [1102] Exit [vMeleeAttackControl] [OnStateExit] [1102] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1114] Enter [vMeleeAttackControl] [OnStateEnter] [1119] Enter [vMeleeAttackControl] [OnStateUpdate] [1121] Z_skinny_rags_pants_LODs attack enable damage in 0.25 [vMeleeAttackControl] [OnStateExit] [1124] Exit [vMeleeAttackControl] [OnStateExit] [1124] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1127] Z_skinny_rags_pants_LODs attack enable damage in 0.27 [vMeleeAttackControl] [OnStateUpdate] [1137] Z_skinny_rags_pants_LODs attack disable damage in 0.63 [vMeleeAttackControl] [OnStateExit] [1155] Exit [vMeleeAttackControl] [OnStateExit] [1155] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1160] Enter [vMeleeAttackControl] [OnStateEnter] [1166] Enter [vMeleeAttackControl] [OnStateExit] [1171] Exit [vMeleeAttackControl] [OnStateExit] [1171] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1198] Z_skinny_rags_pants_LODs attack enable damage in 0.36 [vMeleeAttackControl] [OnStateUpdate] [1222] Z_skinny_rags_pants_LODs attack disable damage in 0.61 [vMeleeAttackControl] [OnStateExit] [1255] Exit [vMeleeAttackControl] [OnStateExit] [1255] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1269] Enter [vMeleeAttackControl] [OnStateEnter] [1275] Enter [vMeleeAttackControl] [OnStateUpdate] [1278] Z_skinny_rags_pants_LODs attack enable damage in 0.29 [vMeleeAttackControl] [OnStateExit] [1281] Exit [vMeleeAttackControl] [OnStateExit] [1281] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1284] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateEnter] [1294] Enter [vMeleeAttackControl] [OnStateUpdate] [1296] Z_skinny_rags_pants_LODs attack disable damage in 0.64 [vMeleeAttackControl] [OnStateExit] [1300] Exit [vMeleeAttackControl] [OnStateExit] [1300] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1301] Enter [vMeleeAttackControl] [OnStateUpdate] [1303] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateExit] [1305] Exit [vMeleeAttackControl] [OnStateExit] [1305] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1307] Z_skinny_rags_pants_LODs attack enable damage in 0.29 [vMeleeAttackControl] [OnStateUpdate] [1321] Z_skinny_rags_pants_LODs attack disable damage in 0.71 [vMeleeAttackControl] [OnStateExit] [1332] Exit [vMeleeAttackControl] [OnStateExit] [1332] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1343] Enter [vMeleeAttackControl] [OnStateEnter] [1348] Enter [vMeleeAttackControl] [OnStateUpdate] [1350] Z_skinny_rags_pants_LODs attack enable damage in 0.26 [vMeleeAttackControl] [OnStateExit] [1353] Exit [vMeleeAttackControl] [OnStateExit] [1353] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1380] Z_skinny_rags_pants_LODs attack enable damage in 0.37 [vMeleeAttackControl] [OnStateEnter] [1396] Enter [vMeleeAttackControl] [OnStateExit] [1403] Exit [vMeleeAttackControl] [OnStateExit] [1403] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1406] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateUpdate] [1419] Z_skinny_rags_pants_LODs attack disable damage in 0.71 [vMeleeAttackControl] [OnStateExit] [1427] Exit [vMeleeAttackControl] [OnStateExit] [1427] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1437] Enter [vMeleeAttackControl] [OnStateEnter] [1444] Enter [vMeleeAttackControl] [OnStateUpdate] [1446] Z_skinny_rags_pants_LODs attack enable damage in 0.28 [vMeleeAttackControl] [OnStateExit] [1449] Exit [vMeleeAttackControl] [OnStateExit] [1449] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1474] Z_skinny_rags_pants_LODs attack enable damage in 0.35 [vMeleeAttackControl] [OnStateEnter] [1482] Enter [vMeleeAttackControl] [OnStateExit] [1488] Exit [vMeleeAttackControl] [OnStateExit] [1488] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1490] Z_skinny_rags_pants_LODs attack enable damage in 0.26 [vMeleeAttackControl] [OnStateUpdate] [1502] Z_skinny_rags_pants_LODs attack disable damage in 0.71 [vMeleeAttackControl] [OnStateExit] [1510] Exit [vMeleeAttackControl] [OnStateExit] [1510] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1511] Enter [vMeleeAttackControl] [OnStateUpdate] [1544] Z_skinny_rags_pants_LODs attack enable damage in 0.35 [vMeleeAttackControl] [OnStateUpdate] [1566] Z_skinny_rags_pants_LODs attack disable damage in 0.61 [vMeleeAttackControl] [OnStateExit] [1589] Exit [vMeleeAttackControl] [OnStateExit] [1589] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1607] Enter [vMeleeAttackControl] [OnStateUpdate] [1611] Z_skinny_rags_pants_LODs attack enable damage in 0.25 [vMeleeAttackControl] [OnStateUpdate] [1626] Z_skinny_rags_pants_LODs attack disable damage in 0.76 [vMeleeAttackControl] [OnStateExit] [1631] Exit [vMeleeAttackControl] [OnStateExit] [1631] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1649] Enter [vMeleeAttackControl] [OnStateEnter] [1655] Enter [vMeleeAttackControl] [OnStateUpdate] [1657] Z_skinny_rags_pants_LODs attack enable damage in 0.31 [vMeleeAttackControl] [OnStateExit] [1660] Exit [vMeleeAttackControl] [OnStateExit] [1660] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1682] Enter [vMeleeAttackControl] [OnStateExit] [1688] Exit [vMeleeAttackControl] [OnStateExit] [1688] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1689] Enter [vMeleeAttackControl] [OnStateUpdate] [1691] Z_skinny_rags_pants_LODs attack enable damage in 0.31 [vMeleeAttackControl] [OnStateExit] [1694] Exit [vMeleeAttackControl] [OnStateExit] [1694] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1697] Z_skinny_rags_pants_LODs attack enable damage in 0.3 [vMeleeAttackControl] [OnStateUpdate] [1710] Z_skinny_rags_pants_LODs attack disable damage in 0.74 [vMeleeAttackControl] [OnStateEnter] [1713] Enter [vMeleeAttackControl] [OnStateExit] [1719] Exit [vMeleeAttackControl] [OnStateExit] [1719] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1720] Enter [vMeleeAttackControl] [OnStateUpdate] [1722] Z_skinny_rags_pants_LODs attack enable damage in 0.29 [vMeleeAttackControl] [OnStateExit] [1725] Exit [vMeleeAttackControl] [OnStateExit] [1725] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1751] Enter [vMeleeAttackControl] [OnStateExit] [1758] Exit [vMeleeAttackControl] [OnStateExit] [1758] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1760] Z_skinny_rags_pants_LODs attack enable damage in 0.27 [vMeleeAttackControl] [OnStateUpdate] [1773] Z_skinny_rags_pants_LODs attack disable damage in 0.7 [vMeleeAttackControl] [OnStateEnter] [1778] Enter [vMeleeAttackControl] [OnStateExit] [1784] Exit [vMeleeAttackControl] [OnStateExit] [1784] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1785] Enter [vMeleeAttackControl] [OnStateExit] [1791] Exit [vMeleeAttackControl] [OnStateExit] [1791] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateEnter] [1801] Enter [vMeleeAttackControl] [OnStateExit] [1806] Exit [vMeleeAttackControl] [OnStateExit] [1806] Z_skinny_rags_pants_LODs attack stateExit [vMeleeAttackControl] [OnStateUpdate] [1808] Z_skinny_rags_pants_LODs attack enable damage in 0.25 [vMeleeAttackControl] [OnStateUpdate] [1820] Z_skinny_rags_pants_LODs attack disable damage in 0.7 [vMeleeAttackControl] [OnStateExit] [1827] Exit [vMeleeAttackControl] [OnStateExit] [1827] Z_skinny_rags_pants_LODs attack stateExit [vNoiseObject] [TriggerNoise] [1852] TriggerNoise - SHOT
|
|
|
Post by Invector on Mar 8, 2019 14:33:27 GMT
"I create sub-state machine “Unarmed Random” and set condition for it AttackID ==0."
the ID 0 is the default which goes to the 'Unarmed' state, you can remove the transitions from A to B to C inside and set transitions from AnyState to those states with the condition of the RandomAttacks
|
|
|
Post by Invector on Mar 8, 2019 14:35:51 GMT
I see the video now, I think you have the option "Can Transition To Self" checked, that's why it's transition from one another while it still playing
|
|
nick62
Junior vMember
Posts: 33
|
Post by nick62 on Mar 8, 2019 14:51:28 GMT
sorry, my post is a very long and I edit it several time to fill with all info (screenshot, video and logs) to prevent message loss. Now my message is ready
|
|
nick62
Junior vMember
Posts: 33
|
Post by nick62 on Mar 8, 2019 15:24:11 GMT
It`s better with uncheked option "Can Transition To Self". But fast jumps from one animation to another remained. And every this transitin make a sound of attack, so player can here several sounds without any interruptions.
It seems to me that, AI FSM send severals commands "make an attack" to controller in small time period, so these jumps occurs.
Do you have an article/demo scene/video with info how to randomize controller with AI FSM ?
I also tried to change this option:
But no result.
ps. how to make spoilers in message in this forum?
|
|
|
Post by Invector on Mar 8, 2019 19:00:40 GMT
You need to set the Max Attack Count to 1 since it's not a combo anymore, but 1 attack at the time
|
|
nick62
Junior vMember
Posts: 33
|
Post by nick62 on Mar 8, 2019 20:02:08 GMT
Thank you! Now it`s ok with random attack.
Can you help to randomize death animations. I make similar settings and I have similar problem with animations jumping at the begining. You can see at in my previous video at time 01:08.
How Can I limit Max Death Count to 1 ?
Here are settings:
|
|
|
Post by Invector on Mar 11, 2019 15:31:39 GMT
You need to set the transition to the submachine state Dead instead of inside the submachine directly to the states. Otherwise, it will always go directly to the state Dead 1 because it never enters the submachine which contains the random script.
|
|
nick62
Junior vMember
Posts: 33
|
Post by nick62 on Aug 29, 2019 22:28:41 GMT
good day. Sorry for the trouble. we had a long break, but now we have resumed work. could you show an example or more detailed explanation how to do random death animations?
I have tried to create substate-machine, but I have no got success to get random death animations.
|
|
|
Post by Invector on Aug 30, 2019 13:12:42 GMT
You need to make an AnyState transition to the Dead SubMachineState with the condition "IsDead" true, add the RandomAttack (you can use the random attack, no need to create another one) behavior and inside add the condition RandomAttack from entry to your states.
|
|
|
Post by ammarofficial11 on Aug 31, 2019 18:46:25 GMT
Just add your idle clips to the Random Idle blend tree, and in the player inspector add a value to the random time hi guys, Ive been following this thread, my problem is, I want to add random idle animation to FSM AI, but I cant find random time in its AI controller. So how do I solve this?
|
|