Recently I have released the first Demo of A.R.M!
Thankfully, Some of the players said the game is fun. and also I can get some bug reports!
The bug is about this.
In the battle scene, the Player character stops its action and can't respond to input, and enemies attack also not working.
I was caught some similar bugs and I predict (not sure!) this bug also be a similar reason.
I'm a solo developer and sadly programming is not my confident point.
Nevertheless, for improving my programming skills, and for learning lacking things, I describe my thought about this bug.
! English is not my native language, so maybe some words can be strange. if you see some weird sentences or words, please tell me! I'll fix it with great thanks. XD !
First of all, I need to describe game architecture related to the bug.
A.R.M is made by unity and for character animation, I used Animation State Machine.
And additionally, I made my own behavior state machine for making the game character's actions.
The behavior state machine defines the character's action and effect. And it changes to other states by various factors(input, animation end, damaged, etc).
And whenever new state start, behavior state change animator's parameter to change animation fitted on it.
And if new animation is not loop, at the end of the timeline, it sends animation end event to the character.
In this flow, sometimes unexpected result comes out.
Animation state and behavior state is not matched.
After some time of test and debugging, Finally, I could check the moment that is not matching between behavior state and animation state.
In this picture, the current animation state is an attack-ready state. Normally, this state only will be changed by the player's input. (so this animation don't have animation end event)
But current behavior state is dodge state. Dodge state only ends with an animation end event. (so this state ignore all input from player)
There will be some predictable reasons why this happening. But matching animation state and behavior state every time perfectly is very hard work.
And I even plan to add new characters using totally new rule to changing state.
With this architecture, I will always have to suffer from unexpected (and hard to find) bugs.
Previously, I only know to change the animation by the state machine.
But recently I find there is another way to change animation.
With this function, I can remove all complex transitions and parameters in the animation state, and change animation only by behavior state.
I plan to change all state systems with this.
In fact, I'm not sure this new way can prevent this bug efficiently. There also has a possibility of spent the time useless.
(as I said first, I'm not a professional programmer!)
Nevertheless, I think changing to a new way will be much better than insist on the current way.
Soon, I'll come back with a bug fixed demo version!