It was certainly a challenge to get the upper body and lower body independence to look believable. But it is mostly working now.
Here is a rather big gif file as demonstration:
Here is a rather big gif file as demonstration:
https://gfycat.com/GleamingScratchyLeopardseal for full gif. Warning: Large file.
Here is another view from different angle. Note that the actual hit system is not implemented yet.
Here is a more detailed explanation of the the combat system for those unfamiliar:
Controls:
- <DIR_KEYS> (WASD) -> movement
- <ATTACK_KEY> (mouse1) -> attack
- <GUARD_KEY> (mouse2) -> guard
Movement: <DIR_KEYS>
- 2 modes: walk and run
- when walking: unit is facing direction the unit is looking at (eg. camera), moves at slower speed than run
- when running: unit is facing the direction its moving towards, moves at faster speed than walk
Guard <GUARD_KEY>
- turns guard on
- running is disabled/ unit will only walk during guard
- direction of guard is based on the prev pressed direction key. So for example, <LEFT> + <GUARD> means to enter left-guard, or switch to left-guard from a different guard direction
- Guard persists even if <GUARD> key is let go
- Guard is canceled when player double taps a direction key (starting a run)
Attack <ATTACK_KEY_DOWN>
- prepares an attack, there is a minimal period of time (affected by weapon/stats/skill/perks/etc) before the actual attack swing is released
- if <ATTACK_KEY> is held down:
- the attack swing will only initiate when the <ATTACK_KEY> is let go
- charging longer than the required time will increase the amount of damage dealt, up to a limit
- if <ATTACK_KEY> is immediate released (eg. a click):
- the attack swing will immediate commence once the minimal required amount of time has passed
- direction of attack is inputed in a similar manner as guard
- an attack can be canceled with the <GUARD_KEY> before it is "released"
- Running Attacks is possible
- Blocks are only successful if the direction of block matches the direction of attack. So for example, a <UP_BLOCK> is ineffective against <RIGHT_ATTACK>.
- Successful blocks are not 100% guaranteed to interrupt/stop the opponent's swing, but will reduce the damage taken.
- Attacks have cleave by default, the swing is not stopped after hitting the first opponent but will continue on, possibility hitting multiple opponents with every swing
- No location differentiation (hitting head same as hitting leg)