Monday, October 7, 2013

Tweaking AI


Since this mod is mostly melee oriented, I wanted the combat to feel as seamless as possible. It'd be challenging but fair, and timing would be a crucial element. If you time the second slash or the kick just right, you might get out of a scrap hurt-free. But if you mess up a few times, it's to the grave with the player. That's the general attitude I had. I also want running away to always be an option for the player should they be too overwhelmed with enemies, and so I might add in another weapon that would aid in slowing enemies down so that the player would escape.

One troubling issue I had was that the enemies seemed to hit the player almost 80% of the time whenever they were called to their attack states. This made it really hard for the player to dodge any attacks without a dedicated dodge button (which would have to include a whole lot of hackery to make even functional), and the player had to rely on a random 50% pain chance to interrupt the enemy mid-attack just so they could get by without getting hit.

To put it bluntly, it sucked ass. I revamped it.

Originally when a monster attacks, I set it to be a few repeating states of the monster reverse-recoiling itself towards the player while also calling a_facetarget, which meant that the enemy, when attacking, was always directed to the player and only impeccable timing could save your skin. I made it so it calls the a_facetarget function only once, so now it gives the player much more room for error to dodge the attack. I also lessened the amount of space that they recoil and gave them a smaller melee zone radius thing, so you could, with good timing, take a few hits at en enemy and then retreat. One issue solved, then, though I'm sure with my anal retentiveness I'll visit this topic again.

No comments:

Post a Comment