Author Topic: [FF7PC-98/Steam] Smoother 60FPS Battles (v0.95)  (Read 302656 times)

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #25 on: 2014-07-13 23:31:12 »
I've been looking into increasing some of the animations in the same way I increased the cameras (which should work 100%). I haven't made much progress since I'm not certain of the structure of the animation loaders. I've definitely narrowed down where Ultima sets lots of its values and gets added to the animation queue.

I also couldn't find info on the limit break animations, but I know they were found and posted about somewhere...

What do you need to know?
« Last Edit: 2014-07-13 23:34:46 by NFITC1 »

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: Battles playing at 60fps
« Reply #26 on: 2014-07-13 23:52:56 »
I found the limit break animations in a random thread Borde created, so that should be taken care of. It's up on the first post now.

If you want to jump on IRC, DLPB is messing with the exe right now trying to do the same
« Last Edit: 2014-07-14 00:49:05 by obesebear »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #27 on: 2014-07-14 01:19:37 »
NFITC1...

Check Memory address

00424E5F

As you can see this is the main counter for each animation frame. It is adding 1 to each frame, advancing the animations.  Hence, making this value 2 doubles anim speed.

Surely there is a way from here or nearby to make it count 4x slower.  I am not sure what calls this function, or how it all ties in.  I only know that the key to animation is here, and this appears to be the main thing.



« Last Edit: 2014-07-14 01:21:28 by DLPB »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #28 on: 2014-07-14 02:59:55 »
NFITC1...

Check Memory address

00424E5F

As you can see this is the main counter for each animation frame. It is adding 1 to each frame, advancing the animations.  Hence, making this value 2 doubles anim speed.

Surely there is a way from here or nearby to make it count 4x slower.  I am not sure what calls this function, or how it all ties in.  I only know that the key to animation is here, and this appears to be the main thing.

I'm sure this would be relatively easy, but even if you slow the counter to make it increment once every four frames the effect will retain the 15 fps animation. That'll look odd for most animations. This should be fine for 2D effects, but 3D would stand out.

Still, it's worth a look and I'll check it out in the morning.

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: Battles playing at 60fps
« Reply #29 on: 2014-07-14 03:08:52 »
We could make the animations longer with Kimera. It's acually very simmple.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #30 on: 2014-07-14 08:24:54 »
I'm sure this would be relatively easy, but even if you slow the counter to make it increment once every four frames the effect will retain the 15 fps animation. That'll look odd for most animations. This should be fine for 2D effects, but 3D would stand out.

Still, it's worth a look and I'll check it out in the morning.

It is advancing the animations though.  Perhaps my choice of word frame is wrong...  Anyway, see what you can find in there.  Looks like potential to me.  But there will no doubt be issues..  :-D

We could make the animations longer with Kimera. It's acually very simmple.

That's what's being attempted by Obesebear, but it ain't simple... Kimera is broken, and there are tons and tons of animations to do...  :'(
« Last Edit: 2014-07-14 08:32:32 by DLPB »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #31 on: 2014-07-14 11:48:07 »
It is advancing the animations though.  Perhaps my choice of word frame is wrong...  Anyway, see what you can find in there.  Looks like potential to me.  But there will no doubt be issues..  :-D

I understand what you're saying completely, but I guess I'm not explaining well. If you tell any animation to advance a frame every four frames then it will still appear to be 15 fps. Otherwise if it advances once a frame it will play four times the speed.

EDIT:
...Check Memory address

00424E5F...
I have this marked as an actor-specific animation frame. This doesn't affect magic effects which is what I've been talking about. Sorry I didn't clarify earlier.
« Last Edit: 2014-07-14 14:00:28 by NFITC1 »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #32 on: 2014-07-14 15:26:54 »
Yeah, this seems to work for model animations only.  But it can't be that hard to locate the same thing for special effects?

See , from my point of view, having it duplicate frames is ok.. because my only gripe with the PC battles is that the slots are broken.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #33 on: 2014-07-14 17:42:32 »
The effects are definitely being handled by 0x5BF01F.
here's a pseudo-code of that method:

Code: [Select]
for( x = 0; x < 100; x ++)
{
   if( *HandlerQueue(x) && dword_9AD1AC)
   {
      call handler x
      If (AnimationData(x*32) == -1 )
      {
         remove handler from queue
   }
   else
   {
      if( *HandlerQueue(x) == 0x42782A )
      {
         call handler x
      }
   }
}
x = 0;

That's being called twice per frame and can call 100 handlers per invocation. Ultima requires as many as 79 and I've found where the sparkles (0x579A97) and the dome (0x57A082) handles are. It's not handling 2D effects though. I believe I can control the speeds of the sparkles and how long they stay on screen. I just don't know how to control when they rotate through their graphics.

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: Battles playing at 60fps
« Reply #34 on: 2014-07-14 18:22:40 »
That's what's being attempted by Obesebear, but it ain't simple... Kimera is broken, and there are tons and tons of animations to do...  :'(

Well yes, the downside is the amount of work. I haven't test the interpolate all animations button myself.

But you are right the game is able to interpolate frames by itself. This is used in the field mkt_s1 (the boutique of the wallmarket) for Cloud to play a animation slower as it really is. So if we can use this command to interpolate the battle animation then it would spare us a lot work.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #35 on: 2014-07-14 18:47:44 »
5D4596 seems to speed up Cure anim?  So must be close to there?

Actually no... that seems to just be speeding up the time allocated to it.  Not the actual anim speed.
« Last Edit: 2014-07-14 18:54:00 by DLPB »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #36 on: 2014-07-14 18:55:11 »
Well I certainly did increase the duration of Ultima's sparks. They stay on screen a lot longer and don't seem to be adversely affected by the increased duration. I just have to figure out how to delay the rest of it.

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: Battles playing at 60fps
« Reply #37 on: 2014-07-14 19:03:59 »
Finished all main characters and bombing mission enemies.  Playtesting now

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: Battles playing at 60fps
« Reply #38 on: 2014-07-14 19:12:54 »
Enemy AI scripts need to be slowed down

Camera cuts out too fast during victory animation

Some sfx are being triggered too early.  Say Barret's shooting animation is #10 and is 20 frames in length, and that animation #9 is a 3 frame animation of him getting ready to shoot, it looks like the sfx is being called during #9 instead of #10.  So it may be that those small animations like #9 needn't be interpolated.

What's happening is the sfx is being called on a certain frame of an animation string.  So while Barret's shot used to sync up perfectly if the sfx was triggered on frame 4/20, it's now out of sync because it needs to be triggered on 16/80.
« Last Edit: 2014-07-14 19:51:43 by obesebear »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #39 on: 2014-07-14 19:23:02 »
I've confirmed the location of the speeds of the ultima sparks, but there's still some random element to it and I'm only slowing down one group of them.

Enemy AI scripts need to be slowed down

Do you mean the timers?

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: Battles playing at 60fps
« Reply #40 on: 2014-07-14 19:29:31 »
Wait time for the next attack moves at 4x speed for everyone.  As is the yellow party indicator
« Last Edit: 2014-07-14 19:57:33 by obesebear »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #41 on: 2014-07-14 20:39:21 »
Wait time for the next attack moves at 4x speed for everyone.  As is the yellow party indicator

An oscillating value increases both CTimers and VTimers for everyone. Fortunately, it is multiplied by 40 every time it's requested. That's then added to their current wait time. Change this to 10 and things will slow back down. Fortunately, slow and haste are bit shifts and won't need to be adjusted at all.

0x43525A (0x03465A) 28 -> 0A
0x43528C (0x03465C) 28 -> 0A
0x43529B (0x03469B) 28 -> 0A
0x43554C (0x03494C) 28 -> 0A
0x43555D (0x03495D) 28 -> 0A
0x4355FD (0x0349FD) 28 -> 0A


Try that.
« Last Edit: 2014-07-15 21:54:00 by NFITC1 »

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: Battles playing at 60fps
« Reply #42 on: 2014-07-14 21:18:33 »
An oscillating value increases both CTimers and VTimers for everyone. Fortunately, it is multiplied by 40 every time it's requested. That's then added to their current wait time. Change this to 10 and things will slow back down. Fortunately, slow and haste are bit shifts and won't need to be adjusted at all.

Code: [Select]
0x43525A (0x03465A) 28 -> 0A
0x43528C (0x03465C) 28 -> 0A
0x43529B (0x03469B) 28 -> 0A
0x43554C (0x03494C) 28 -> 0A
0x43555D (0x03495D) 28 -> 0A
0x4355FD (0x0349FD) 28 -> 0A

Try that.
No luck.  No change from what I can tell.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #43 on: 2014-07-14 21:40:44 »
It should at least affect status durations. Maybe that's all it did...

Aww fudge. I misread what that value does. Give me a while.

EDIT:
This is working:
C-Timer
0x433A4B (0x032E4B) 22 -> 08
V-Timer
0x4385FB (0x0379FB) 00 -> 40
0x4385FC (0x0379FC) 01 -> 00
Turn Timer is directly linked with VTimer so it needs no adjusting
0x5CFBC2 (0x1CEFC2) 01 -> 04
0x5CFBE8 (0x1CEFE8) 32 -> 0E


That ought to actually reduce the CTimers, VTimers, and Turn Timers.
« Last Edit: 2014-07-15 21:55:02 by NFITC1 »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #44 on: 2014-07-14 23:05:18 »
0x5CFBC0 (0x1CEFC3) 01 -> 03


should be

0x5CFBC2 (0x1CEFC3) 01 -> 03

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #45 on: 2014-07-14 23:13:55 »
432254

This and this entire function seem to be the timing for everything really.. the bars and the AI turn timer...

Not sure if that helps you.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #46 on: 2014-07-14 23:30:35 »
0x5CFBC0 (0x1CEFC3) 01 -> 03


should be

0x5CFBC2 (0x1CEFC3) 01 -> 03

That's why I put before and after values. :) The value should actually be 04.

432254

This and this entire function seem to be the timing for everything really.. the bars and the AI turn timer...

Not sure if that helps you.

It does do all the setting, but the value manipulation is easier and doesn't require moving other code around.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #47 on: 2014-07-15 01:07:58 »
The enemy turns are still happening 4x faster tho...

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #48 on: 2014-07-15 02:11:35 »
'nother take-back. Undo the turn timer changes

change these back
0x5CFBC2 (0x1CEFC2) 04 -> 01
0x5CFBE8 (0x1CEFE8) 0E -> 32

Keep the rest.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Battles playing at 60fps
« Reply #49 on: 2014-07-15 15:29:04 »
Just a thought here...

at moment you are editing every part to make it work at 60fps .  Isn't there some sort of function that calls all these?  So instead of editing a ton of functions for everything, including blinking text speed, we can just edit the one function call?

This way means a load of hex changes are going to be needed.  Is it the only way?