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

Hellbringer616

  • No life
  • *
  • Posts: 1915
  • Karma: 12
    • View Profile
Re: Battles playing at 60fps
« Reply #75 on: 2014-07-17 17:17:42 »
I'm done with BOAA
BOAA - 2 Hands go inside the model starting from frame 7.
            3,6,9,10,13 the wheels twitch instead of roll for all of them

Is this acceptable? because they twitch throughout the entire animation. Otherwise they would be documented like animation 2. Also should i be looking for issues like animation 2? Or should that not matter?

« Last Edit: 2014-07-17 17:31:16 by Hellbringer616 »

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #76 on: 2014-07-17 17:58:52 »
I'm done with BOAA
BOAA - 2 Hands go inside the model starting from frame 7.
            3,6,9,10,13 the wheels twitch instead of roll for all of them

Is this acceptable? because they twitch throughout the entire animation. Otherwise they would be documented like animation 2. Also should i be looking for issues like animation 2? Or should that not matter?
Animation 2 seems fine.  Frame 12 is actually an original frame from the game.  As you go through more models, you'll learn what it is you're looking for.  Small clipping issues like that aren't a problem, it's the big clipping issues that need to be documented and fixed.

Don't worry about posting your findings here, just throw them up on this spreadsheet https://docs.google.com/spreadsheets/d/1C7jyrSu4Kmwvyp51eJJIcPGXEX-KZz5GufMEBpUT-EI/edit#gid=0 as you finish

Hellbringer616

  • No life
  • *
  • Posts: 1915
  • Karma: 12
    • View Profile
Re: Battles playing at 60fps
« Reply #77 on: 2014-07-17 20:54:10 »
Alright i posted my findings on the spreadsheet, if you want to proof check them and let me know what you find, if nothing out of the notations I've made than i think i know what to do and i'll start more models

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #78 on: 2014-07-17 23:08:20 »
I won't be checking behind anyone.  If y'all say the model is good, then it's good.  Only thing I'll be doing is going back and fixing all the errors that get reported.   From there will likely be a beta release of everything I, NFITC1, and DLPB have done.   Then we'll go from there.

Hellbringer616

  • No life
  • *
  • Posts: 1915
  • Karma: 12
    • View Profile
Re: Battles playing at 60fps
« Reply #79 on: 2014-07-17 23:14:37 »
Alright, well I'm fairly certain that the issues I've found weren't issues (such as the hell house having an animation upside down) so i'll continue to work on models. Can't wait til the beta is out!

DLPB

  • No life
  • *
  • Posts: 9240
  • Karma: 298
  • For I realized that God's a young man, too.
    • View Profile
Re: Battles playing at 60fps
« Reply #80 on: 2014-07-18 00:18:16 »
I thought I'd found something great to dupe the frames (my current way works 100% but its a hack job and i dont like that).

Unfortunately, turned out it wasn't anything.  I do know that it is possible to reduce the effect / anim speeds and thereby make it work at 60fps.. but I don't know how.


The search continues.

Hellbringer616

  • No life
  • *
  • Posts: 1915
  • Karma: 12
    • View Profile
Re: Battles playing at 60fps
« Reply #81 on: 2014-07-18 01:59:26 »
I thought I'd found something great to dupe the frames (my current way works 100% but its a hack job and i dont like that).

Unfortunately, turned out it wasn't anything.  I do know that it is possible to reduce the effect / anim speeds and thereby make it work at 60fps.. but I don't know how.


The search continues.

Thats duping the frames so the 2d elements work at the right speed? Or are you trying to make my silky smooth FF7 a dream? :P

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #82 on: 2014-07-18 14:35:55 »
The SFX call time needs to be quadrupled.

I was just testing the Aero Combatant fixes, and his main attack is a 3 hit move and the SFX gets called for each hit.  Usually bam .... bam .... bam.   But since they are being called for the same frame as the original it's, bambambam long before his animation finishes.

I'm not positive, but I think pushing them all to call 4x later should completely fix the sound problem.

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #83 on: 2014-07-18 15:30:13 »
I'm not positive, but I think pushing them all to call 4x later should completely fix the sound problem.

The answer to this one is in the animation scripts. Aero Combatant's anim script for Propeler is the fourth one in buab. In that script there is a segment
Code: [Select]
07 BE(01) BE(05) BE(0B) C2(0B) 08Which roughly translates to:
Play anim 7
Set sound delay 1 frame(s)
Set sound delay 5 frame(s)
Set sound delay 11 frame(s)
Set hold camera for 11 frame(s)
Play anim 8

Setting the delays and hold cameras for four times their current amount made the delay between sounds four times slower and the camera stayed on the target for four times longer. Set sound delay 1 should probably remain at that value. This snippet is at 0x10E in buab or 0x32DCC1 in battle.lgp

This can either be solved by changing EVERY BEh CALL IN EVERY ANIMATION FILE (indicated NOT preferable) or I can squeeze some asm action into the animation handlers like I did for the camera scripts and handle it there. This indicates that at least the values provided to BE and C2 would need to be quadrupled.

EDIT:
To make this change in the ASM, make the following changes starting at 0x021A1E:

From
Code: [Select]
89 0A
0F BF 45 08
69 C0 EC 1A 00 00
8A 88 B4 11 BE 00
80 C1 01
0F BF 55 08
69 D2 EC 1A 00 00
88 8A B4 11 BE 00

To
Code: [Select]
6B C9 04
89 0A
0F BF 45 08
69 C0 EC 1A 00 00
8A 88 B4 11 BE 00
80 C1 01
88 88 B4 11 BE 00
90 90 90 90 90 90 90

The C2 change is nearly identical, but starting at 0x0217CE

From
Code: [Select]
89 10
0F BF 4D 08
69 C9 EC 1A 00 00
8A 91 B4 11 BE 00
80 C2 01
0F BF 45 08
69 C0 EC 1A 00 00
88 90 B4 11 BE 00

To
Code: [Select]
6B D2 04
89 10
0F BF 4D 08
69 C9 EC 1A 00 00
8A 91 B4 11 BE 00
80 C2 01
88 91 B4 11 BE 00
90 90 90 90 90 90 90
« Last Edit: 2014-07-18 18:07:09 by NFITC1 »

DLPB

  • No life
  • *
  • Posts: 9240
  • Karma: 298
  • For I realized that God's a young man, too.
    • View Profile
Re: Battles playing at 60fps
« Reply #84 on: 2014-07-19 15:26:20 »
I've been looking at how the game pauses... since the pause var can literally stop everything on screen (apart from the menu).

Seeing what accesses the pause var can tell us which parts are being frozen and thus give us the correct locations of the animation advancement code.

Unfortunately.. it isn't that simple.  Magic is not just one counter.  A lot of magics use a different counter for their specific animations... and that's before we get on to Summons and everything else.

I suppose NFITC1 may be able to trace all this back to a function that controls them all? And then we may get some luck with it.  But if not, you guys will need to interpolate the magic too (are you doing this?  Can this even be done?).

5C042B, 5D4464,  5D46B2

These addresses control just a tiny portion of animations I found.  I forget which is which, but one is "Cure".

Certain model animation is advanced from  00424E5F

You have already found the counter for action times.

I've confused myself with all this to be honest.  Anyway, good luck with this project, it's way more involved than my pause hack job (which will work 100% but will never be as smooth as this one hopes to be).
« Last Edit: 2014-07-19 17:01:18 by DLPB »

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #85 on: 2014-07-19 16:18:02 »
Getting Joker and Death Dealer to have their cards rotate smoothly is going to be a very VERY hacked job.  The animation will look a little bit different (the cards won't turn on angles and whatnot)  but it's the only way I can get it to work.  Otherwise it just looks ridiculous.  EDIT: Unfortunately Joker and Death Dealer animations are not interchangeable.  Joker took about 3 hours to fix.  It will be a long LONG time until I fix Death Dealer.  If someone else would like to take up the task, let me know.

I've been looking at how the game pauses... since the pause var can literally stop everything on screen (apart from the menu, which uses the global pause var).

Seeing what accesses the pause var can tell us which parts are being frozen and thus give us the correct locations of the animation advancement code.

Unfortunately.. it isn't that simple.  Magic is not just one counter.  A lot of magics use a different counter for their specific animations... and that's before we get on to Summons and everything else.

I suppose NFITC1 may be able to trace all this back to a function that controls them all? And then we may get some luck with it.  But if not, you guys will need to interpolate the magic too (are you doing this?  Can this even be done?).

5C042B, 5D4464,  5D46B2

These addresses control just a tiny portion of animations I found.  I forget which is which, but one is "Cure".

Certain model animation is advanced from  00424E5F

You have already found the counter for action times.

I've confused myself with all this to be honest.  Anyway, good luck with this project, it's way more involved than my pause hack job (which will work 100% but will never be as smooth as this one hopes to be).
Nothing wrong with hacks.   To get things to work, and I assume the magic, like textures, will likely need to have frames duplicated since their animation files aren't in magic.lgp.

Summons, however, are easily interpolated.  So no problem there.
« Last Edit: 2014-07-19 17:20:38 by obesebear »

sl1982

  • Administrator
  • No life
  • *
  • Posts: 3677
  • Karma: 41
  • GUI Master :P
    • View Profile
Re: Battles playing at 60fps
« Reply #86 on: 2014-07-19 17:10:22 »
If anyone ever figures out the spell effects I had played around with some image morphing software that did a pretty good job of interpolating them. Assuming you can add more spell effect frames that is.

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #87 on: 2014-07-19 22:19:48 »
Currently we have about 130 of the battle models error free and ready for beta testing in game.

What I need now is for someone to make a quick demo showcasing 15fps w/ no mods vs. 60fps heavily modded with all of our best models and graphic interfaces and all of the other cool strawberries we have around here.   Your capture card will obviously need to be able to record smoothly at 60fps.

Anyone who is interested and capable please reply below and we'll get you set up with everything you'll need to use this mod.

sl1982

  • Administrator
  • No life
  • *
  • Posts: 3677
  • Karma: 41
  • GUI Master :P
    • View Profile
Re: Battles playing at 60fps
« Reply #88 on: 2014-07-19 22:21:29 »
Why would you use a capture card? Would fraps or something like that not work?

DLPB

  • No life
  • *
  • Posts: 9240
  • Karma: 298
  • For I realized that God's a young man, too.
    • View Profile
Re: Battles playing at 60fps
« Reply #89 on: 2014-07-19 22:21:58 »
There's been a problem with my mod.

Seems that there is a bug in the original game that causes certain things to not be paused properly...

when you pause game during knights of round for example...  the knights disappear.  Meaning using my method... they will disappear 3 in 4 frames.

Either a fix for this behaviour has to be found, or a new way will have to be devised of making this work.

Things just get better and better  ;D

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #90 on: 2014-07-19 22:32:19 »
Why would you use a capture card? Would fraps or something like that not work?
Last I remember (from years ago) there was always some kind of problem keeping a steady frame rate using FRAPS with FF7.  But that might not be a problem anymore.

DLPB

  • No life
  • *
  • Posts: 9240
  • Karma: 298
  • For I realized that God's a young man, too.
    • View Profile
Re: Battles playing at 60fps
« Reply #91 on: 2014-07-19 22:39:47 »
Last I remember (from years ago) there was always some kind of problem keeping a steady frame rate using FRAPS with FF7.  But that might not be a problem anymore.

It certainly is still a problem (and I'll be discussing this with NFITC1.  Dziugo was in the process of fixing the frame limiter code), but as I just explained to Covarr, there is a way around it.

Get Ochu (or any trainer that can change fps), or change fps any other way to, let's say, 120.
[to do this using Hextlaunch, the hext file should have a line reading: 7C0B00 = 00 00 00 00 00 00 5E 40 ]

So the game will run at 120 fps (you'll need to disable vsync in aalis driver).  It doesn't matter if it runs less than 120.., as long as it's a fair bit over 60.

Next, use fraps or Dxtory and set it to do the limiting.  Set it to 60.  The game will now record properly and at 60, because fraps/dxtory will do the limiting instead.  It's unknown what causes this issue at the current time.

The issue affects battle and field... and possibly menu.  But not world map.

@NFITC1  What could cause a 2-4fps drop when recording?  It has happened to me on 3 different computers.  As I said, it can't be due to slow computer because setting to a higher fps and letting the capture program do the limiting works fine.

I think what dziugo said is right... the frame limiter is broken.  I have no idea why this issue does not affect world map.
« Last Edit: 2014-07-20 15:58:53 by DLPB »

yarLson

  • Freak
  • *
  • Posts: 705
  • Karma: 30
  • King of the Spoilers
    • View Profile
Re: Battles playing at 60fps
« Reply #92 on: 2014-07-20 04:50:26 »
Currently we have about 130 of the battle models error free and ready for beta testing in game.

What I need now is for someone to make a quick demo showcasing 15fps w/ no mods vs. 60fps heavily modded with all of our best models and graphic interfaces and all of the other cool strawberries we have around here.   Your capture card will obviously need to be able to record smoothly at 60fps.

Anyone who is interested and capable please reply below and we'll get you set up with everything you'll need to use this mod.
dammit I have a great capture card but my hdmi port just broke :(

ff7rules

  • Insane poster
  • *
  • Posts: 423
  • Karma: 2
    • View Profile
Re: Battles playing at 60fps
« Reply #93 on: 2014-07-20 11:46:54 »
Currently we have about 130 of the battle models error free and ready for beta testing in game.

What I need now is for someone to make a quick demo showcasing 15fps w/ no mods vs. 60fps heavily modded with all of our best models and graphic interfaces and all of the other cool sh*t we have around here.   Your capture card will obviously need to be able to record smoothly at 60fps.

Anyone who is interested and capable please reply below and we'll get you set up with everything you'll need to use this mod.

Maybe I can help? I have an elgato HD Capture card and also have X spilt which displays frames you record at? I get 11 frames fully modded out not sure about fully unmodded though can easily find out for you

Hellbringer616

  • No life
  • *
  • Posts: 1915
  • Karma: 12
    • View Profile
Re: Battles playing at 60fps
« Reply #94 on: 2014-07-20 21:45:14 »
171 more animations to go. I'd say nice work so far everyone, than of course bug fixes and 2d effect fixes, Was camera and SFX sorted out yet?

DLPB

  • No life
  • *
  • Posts: 9240
  • Karma: 298
  • For I realized that God's a young man, too.
    • View Profile
Re: Battles playing at 60fps
« Reply #95 on: 2014-07-20 22:42:28 »
The value I provided that fixes menu should also fix the camera for use with this mod.

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #96 on: 2014-07-20 23:01:10 »
SFX does seem to be fixed. The camera is also working from what I can tell with the exception of the victory poses where it ends too early

NFITC1

  • No life
  • *
  • Posts: 2843
  • Karma: 71
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Battles playing at 60fps
« Reply #97 on: 2014-07-21 13:41:47 »
...What could cause a 2-4fps drop when recording?  It has happened to me on 3 different computers.  As I said, it can't be due to slow computer because setting to a higher fps and letting the capture program do the limiting works fine.

I think what dziugo said is right... the frame limiter is broken.  I have no idea why this issue does not affect world map.

The only thing I can figure is the frame limiter was designed with PSX in mind. Every time I've fraps'd ff7 it's always given me 12 fps in battle too. The PC port was never designed to work with other applications that want video memory. There's calls to enter critical sections all over the place (critical sections can only be accessed by one process at a time) so it's possible that the direct video capture software is leap-frogging those requests with ff7. That's a layman's guess so it could be WAY off. I'm not sure there's anything we can do about it.
Come to think about it, when I make traces it slows down the fps too. I'm not sure why that is either. I know that not all applications do that.

...I suppose NFITC1 may be able to trace all this back to a function that controls them all? And then we may get some luck with it.  But if not, you guys will need to interpolate the magic too (are you doing this?  Can this even be done?).

5C042B, 5D4464,  5D46B2

These addresses control just a tiny portion of animations I found.  I forget which is which, but one is "Cure".

No such luck. These are three separate functions.

0x5C042B: Can only be evoked by animation scripts. Only A4, A5, E6 and E0 call this. Haven't dug into conditions that must be met.

0x5D4464: Called by mostly item animations. XPotion, Potion (Also Cure), Ether, TurboEther, HiPotion, PhoenixDown, Regen, and Enemy Action Animation Loader 5E (Howling, Toxic Powder, and Curses)

0x5D46B2: Called FROM the method where 0x5D4464 is executed, but Elixer and Antidote can call it without calling the above.
« Last Edit: 2014-07-21 14:25:03 by NFITC1 »

DLPB

  • No life
  • *
  • Posts: 9240
  • Karma: 298
  • For I realized that God's a young man, too.
    • View Profile
Re: Battles playing at 60fps
« Reply #98 on: 2014-07-21 16:12:23 »
What on earth are different magics doing using different functions, especially for the main counter?  Surely this code should just be shared?

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3237
  • Karma: 112
    • View Profile
Re: Battles playing at 60fps
« Reply #99 on: 2014-07-21 20:32:11 »
60 left.  Then checking fixes needed for Kaldarasha and Hellbringer.    Then the summons and we'll be ready for a beta   ;D

Unfortunately still can't do anything with the limit breaks
 
« Last Edit: 2014-07-21 21:50:09 by obesebear »