News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: LoM/PSX - Looking for approaches on how to speed up attack animations.  (Read 2794 times)

MeshGearFox

  • Jr. Member
  • **
  • Posts: 30
    • View Profile
Still working on my Legend of Mana patch.

One of the things I want to do is speed up enemy attack/movement animations. I'm not sure what approach I should take for this.

I've found a few functions in the disassembly that control the overall speed of the game -- I'm not sure how these work. It looks like the framerate is being limited by them or decoupled from, uh, the number of processor cycles occurring per second.

I think what I want to do is find the segment of code that handles updating which frame is supposed to be drawn, and cause it to update the frame more frequently. Any suggestions on how I could go about finding this section of the code, though?

Also, what sort of structure would be typical for handling sprite sheets within the program? I have some experience with SDL and how you'd handle animation with that, but I don't know if that's what you'd expect to see in a PSX game.

Grimoire LD

  • Sr. Member
  • ****
  • Posts: 449
    • View Profile
Re: LoM/PSX - Looking for approaches on how to speed up attack animations.
« Reply #1 on: February 27, 2014, 02:22:34 am »
It is always heartening to see people look back to these under rated classics and try to improve them where they can. This is the first I've heard of your patch and from what you're posting here it does seem quite interesting. Where can I find more information on this patch?

MeshGearFox

  • Jr. Member
  • **
  • Posts: 30
    • View Profile
Re: LoM/PSX - Looking for approaches on how to speed up attack animations.
« Reply #2 on: February 27, 2014, 07:29:42 pm »
https://www.dropbox.com/s/mo5gkgfk7t2fzo8/LoMPatch.zip

Most recent stablish build. In this version, hitstun against enemies is disabled, enemy damage (but not HP) is scaled to player level, and you also get a game over screen as soon as the player dies, even if other pets/NPCs are still alive (this doesn'tmake the game harder, it just lets you start a fight over immediately instead of having to watch the NPCs and AI fight while waiting to respawn, which is boring).

The game has some well known AI problems, and I think a lot of them stem from the enemy animations taking too long to execute -- basically by the time any given enemy action animation is completed, the player can have moved to the other side of the screen, so the enemy AI has to spend all of its time re-adjusting instead of acting.

So, speed up enemy actions, let them move a little further when they move, and make the player only move about half as far as they do with each step are all eventual goals. Speeding up the enemy is the first thing I'm working on.

That being said, if anyone else has advice on how to speed up the enemy actions, I'm open for suggestions -- it's just that, from what I've seen, enemy action length is timed to the number of frames in their attack/move/idle animations, which is in turn based on the, er, internal clock/framelimiter thingy I was talking about in my original post.

Also, for the record, I've written games in C++ before -- but they were all turn-based affairs with minimalist animation, so I'm not that experienced with how properly real-time games function in this aspect.

Oh, one idea I had:

I can probably find the sprite sheet for one of the enemies I'm dealing with, see where it's loaded in memory during combat, and check for any reads from memory addresses in that range during combat as well. I think what I want to do is alter the code that handles the logic for moving onto the next frame, and NOT the rendering code.

MeshGearFox

  • Jr. Member
  • **
  • Posts: 30
    • View Profile
Started working on the movement code.

From what I can tell, the game calculates the new player position, repositions them, and then animates them moving to that point.

Wondering if this is how other enemy actions work -- if there's some set action/attack length value, and then the animation is timed to that.

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Sounds like you're making some interesting changes to the game. I personally never got too far in the game, mostly because the battle system felt sluggish half of the time. I'll have to give it a try once you're done, maybe it keeps me interested this time around. Good luck with it!

MeshGearFox

  • Jr. Member
  • **
  • Posts: 30
    • View Profile
I couldn't find a way to speed up enemy attack animations so I had to compensate by:

1. Reducing player movement speed.
2. Doubling enemy movement speed.

Ideally, while you're moving slower, the game should feel more 'active' since you'll need to be doing something constantly to not get surrounded.

https://www.dropbox.com/s/t3581dnpdg2c5ae/LoM%20Patch%20--%20Version%201.0.zip Is the latest stable version, if anyone's interested.

I've had some people point out that a lot of the plunge attacks are unbalanced and spammable now so I'm working on having the ST bar limit how many of those you can use -- basically, the plunge attacks costs ST now, and quick attacks gain ST.

I'm also trying to make the player an enemy hitboxes a little larger programmatically, so that enemies have an easier time hitting the player and vice versa -- I know the narrow collision's something that bothered people a lot.

As a side effect of reducing player movement speed, it's actually a little easier to hit enemies now anyway, since you don't overshoot them.