R.D. wrote:Fixes and adjustments for enemy animations. I'll go through everything below.
(not animation related) Fixed an incorrect null assignment (from my earlier PR) that made a warning in Unity.
Fixed rat being flipped horizontally. For some reason there was specifically code to flip the rat. Instead, the same code was used to flip the giant bat and the imp, who both needed it. There is also existing code to flip the scorpion, but I haven't tested it yet to see if that is functioning properly.
Fixed enemies not playing the first frame of their attack animation. currentFrame was incremented immediately in AnimateEnemy() of DaggerfallMobileUnit, so the first frame didn't show.
Adjusted animation speeds. Slightly sped up enemy attacks, lowered enemy movement animation and added faster animation for flying enemies. The animations should be somewhat closer to classic, and I think they look better.
Added code for enemies to hit on a particular frame of their attack, rather than after finishing. I don't know how classic handles this, and I don't see myself figuring it out anytime soon. Instead I went through all the enemy animations (your Daggerfall Imaging 2 software is so helpful for this stuff) and set each enemy to hit on the frame that it looks like their attack should connect on.
Enemies can continue to move some (1/4 speed) while attacking. I'm not 100% sure about this because the animations for enemies do look like they should be standing still and not "sliding" along the floor, but the player can move while attacking and IMO it's too easy to defeat enemies in DF Unity currently because you can outmaneuver them. Since people are making quests now I think getting game difficulty problems under control is starting to take on some more importance. Enemies can also move while attacking in classic.
I experimented with them moving at 1/2 speed, but I felt like it would maybe be too difficult for new characters in privateer's hold, and I didn't like having the enemies constantly up in my face, so for now I settled on 1/4 speed as making it more difficult but still possible to dodge hits. I would like to alleviate the "walking backwards while swinging your weapon" playstyle somehow. Maybe we can improve the AI at some point to not rush the player so much.
Enemies have some randomness to the time between weapon swings, to make enemies a bit less predictable and robotic.
These are going to be excellent improvements. There are some things I don't report because I'm certain that someone already has plans to fix them, and this is clearly the case here Looking forward to dodging enemy attacks based on their swing frames!
I think it was easier to dodge them in classic because they sort of had a delayed reaction time; if you moved away they didn't move in on you immediately. Whether we have that in DFU or not doesn't matter to me.