Author Topic: Mini-game Fixes  (Read 43520 times)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Mini-game Fixes
« on: 2012-02-04 20:40:58 »
STATUS:

3-D Battler odds: FIXED (Reunion via script fix).

info: Programmer had limited knowledge of probability and made the odds of winning 3709-1.  Mini-game also has a bug after final round probably because no tester could actually get to this stage during testing haha.  New odds of defeating all 4 opponents is now around 300-1.
Code: [Select]
Solution: Script changes in flevel.
Easy clock minigame: FIXED (Reunion via script fix).

info. Japanese versions of the game default to a more difficult clock minigame found at Temple of the Ancients.  Originally, when you fail at this 3 times, it reverts to the version the west know as normal.  This fix restores the original game and programming which was deliberately disabled for the Euro/US releases.
Code: [Select]
Solution: Script change in flevel.
Rollercoaster framerate issue: FIXED (added to Aali's driver)

info:  Rollercoaster was running at 30fps and not 60fps.
Code: [Select]
Solution: Cap fps to 60 with Aali's driver.
Rollercoaster aimer issue: FIXED (added to Aali's next driver)

info:  Aimer was not moving at correct speed.
Code: [Select]
Solution:
http://dl.dropbox.com/u/36889302/FF7/CoasterAimerFix.exe
Change following exe values:
001ed679 = 05
001ed69a = 05
001ed6bd = 05
001ed6e0 = 05

Rollercoaster propeller super points issue: FIXED (Reunion.  Documentation on this thread)

info: Propeller on the Zeppelin gave upwards of 25000 points. Now gives 0 like later releases.
Code: [Select]
Solution: Change following values in  xbin.bin from coaster.lgp-
10b84c=00
10b8ac=00

Snowboard framerate issue: FIXED (added to Aali's driver)

info: Snowboard was running at 30fps and not 60fps.
Code: [Select]
Solution: Cap fps to 60 with Aali's driver.
Snowboard easier PC time attack: FIXED (Reunion).

info: PC time attack had been changed from NTSC versions by making the times easier.
Code: [Select]
Solution: Change following values in ff7.exe-
00524E70=20
00524E71=CB
00524E72=00
00524E73=00
00524E74=F0
00524E75=D2
00524E76=00
00524E77=00
00524E78=C0
00524E79=DA
00524E7A=00
00524E7B=00
00524E7C=60
00524E7D=EA
00524E7E=00
00524E7F=00
00524E80=E8
00524E81=FD
00524E82=00
00524E83=00
00524E84=E0
00524E85=28
00524E86=01
00524E87=00
00524E88=90
00524E89=5F
00524E8A=01
00524E8B=00
00524E8C=FF
00524E8D=FF
00524E8E=FF
00524E8F=FF
00524E90=D0
00524E91=01
00524E92=01
00524E93=00
00524E94=70
00524E95=11
00524E96=01
00524E97=00
00524E98=28
00524E99=1D
00524E9A=01
00524E9B=00
00524E9C=E0
00524E9D=28
00524E9E=01
00524E9F=00
00524EA0=80
00524EA1=38
00524EA2=01
00524EA3=00
00524EA4=A0
00524EA5=86
00524EA6=01
00524EA7=00
00524EA8=C0
00524EA9=D4
00524EAA=01
00524EAB=00
00524EAC=FF
00524EAD=FF
00524EAE=FF
00524EAF=FF
00524EB0=70
00524EB1=11
00524EB2=01
00524EB3=00
00524EB4=F8
00524EB5=24
00524EB6=01
00524EB7=00
00524EB8=80
00524EB9=38
00524EBA=01
00524EBB=00
00524EBC=08
00524EBD=4C
00524EBE=01
00524EBF=00
00524EC0=18
00524EC1=73
00524EC2=01
00524EC3=00
00524EC4=B0
00524EC5=AD
00524EC6=01
00524EC7=00
00524EC8=D0
00524EC9=FB
00524ECA=01
00524ECB=00
00524ECC=FF
00524ECD=FF
00524ECE=FF
00524ECF=FF

Submarine issue: FIXED (Reunion. Pending).
info: Submarine mini-game is more annoying than later FF7 revisions (including ff7 international).  Turning,ascend/descend are 400% slower. Speed is 25% slower.  Enemy submarine counts are different.  Wire frame model is turned on with F2 and is white not green.










==============================
Let's start with the rollercoaster game

The minigame for PC version is broken.  There are a few issues, possibly created by the porting team, or Aali's driver or both.

1.  The PC minigame aimer is not correct, very hard to control.

2.  The animation is choppy (due to below)

3.  The game freezes temporarily on certain special effects. (like big space ship exploding)

I am guessing Aali can deal with 3.  1 and 2 exist due to the following:

1.  The psx game runs at 60fps.  The game advances properly by 1 each of those 60.  NO duplicate frames.

2.  The aimer for PSX moves 10 pixels for each frame in a uniform way.   (640*480, means 64 individual cursor points for X and 48 for Y)

3.  The PC is running at 30fps and duplicating frames to make the coaster run at the same speed as the PSX.

4.  The frame progression is not uniform.  It progresses by 2, then duplicates by 2, (instead of expected move 1 drop 1).

These are the reasons the PSX coaster game is easier to control the aimer.  The PC version is practically broken.  It is unplayable compared.

After this is corrected, the game should run properly. although there may still need to be a tweak to the Aimer movement X and Y values.  The first step is either restoring the game to the full 60fps or making frame progression work in the proper manner.

PAL users may note that it still seems harder, this is because the original coaster game for PAL runs slower at 50fps instead of the proper 60fps NTSC.

« Last Edit: 2014-10-21 22:29:33 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Goldsaucer Coaster Minigame Broken
« Reply #1 on: 2012-02-04 21:49:49 »
The fix is simple.  The game needs limiting to 60fps by the driver (in meantime you can set refresh rate to 60 and use vsync but turn the minigame limiter OFF).  The minigame will still play at the correct speed.

But 4 values also need altering because the cursor also needs to be slowed down by 1/2 in all directions.  I will send these 4 values along with a patch tomorrow.

I will then  check all the other minigames.
« Last Edit: 2012-02-05 10:13:53 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Goldsaucer Coaster Minigame Broken
« Reply #2 on: 2012-02-05 09:57:51 »
To fix manually, the game must be running at 60fps like above, and the following bytes need altering:

memory:
005EE279 = 05
005EE29a = 05
005EE2BD = 05
005EE2E0 = 05

or

Exe:
001ed679 = 05
001ed69a = 05
001ed6bd = 05
001ed6e0 = 05

After these modifications, the minigame will play at a full frame rate, and the cursor will move the exact same as the playstation.

patch is here:
http://dl.dropbox.com/u/36889302/FF7/CoasterAimerFix.exe

Aali is adding this fix to his next driver revision.

I will look into the other minigames later.

« Last Edit: 2012-02-05 17:34:15 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Goldsaucer Coaster Minigame Broken [FIXED]
« Reply #3 on: 2012-02-06 04:49:05 »
I have now checked the snowboard minigame and that also needs to be limited to 60, in fact I bet they all should be.  Duplicating frames is not needed and actually breaks the games as they become far harder to control.

From what I can see snowboard works without any tweaks when 60fps but I will check more to be sure.
« Last Edit: 2012-02-06 14:49:15 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Minigames Broken [FIXED]
« Reply #4 on: 2012-02-06 18:31:30 »
Ok here is how it works:

Rollercoaster:  Correct frame rate is 60 but aimer was broken and aalis driver is limiting to 30.
Submarine:  Correct frame rate 30 (seems to be limited externally from Aalis driver)
Snowboard: Correct frame rate 60 (Aalis driver breaks game by limiting to 30).
Highway:  Correct frame rate 30 (Aalis driver corrects problem)
Fort Condor: Correct frame rate 30 (limited externally from Aalis driver?)
« Last Edit: 2012-02-07 17:56:00 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Minigames Broken [FIXED]
« Reply #5 on: 2012-02-07 17:47:33 »
The submarine game is from an earlier build, and so is near identical to Japanese original, and not international. It is much harder and annoying in its current form (slow turning, slow speed)  but I may be able to restore the international version and then have that as an option.

The G-Bike minigame seems to be similar aside from different coloured attack bike?  (I will ask Shademp to verify that again).

The Snowboard minigame is easier to acquire the speed runs.  The speed runs themselves are also slightly easier to achieve the highest rank "Freak".  I will correct this with a patch and allow the patch as an option to restore the International and NTSC difficulty.

Thanks to Shademp for the information. 

I have looked at the code and most of it is fairly straight forward.  The games are all ok now in terms of playability.  Aali just has to add the following changes to his driver:

1. Coaster limited to 60fps not 30fps and add my aimer fix
2. Snowboard limited to 60fps not 30 fps.

The broken odds in the 3D Battler game have been corrected and added to Luksy's touphscript.




Kemlin

  • *
  • Posts: 64
    • View Profile
Re: Minigames Broken [FIXED]
« Reply #6 on: 2012-02-07 19:38:48 »
Uh...wow.

Good game, man. I guess I'll wait for Aali's next release. And then...minigames. Ooooh yeah!

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Minigames Broken [FIXED]
« Reply #7 on: 2012-02-22 15:24:23 »
I tried to fix a few things:

Sub game turn speed, acceleration, speed etc... and although I found some values, I can't be sure the values originate from exe or external file.  I also can't work it all out myself.

Same for Speed Round propeller bug. 

I have no idea how to fix them properly and so maybe someone else with better assembly knowledge can look into it.

9870d4 is the address for speed data for sub. 

The one thing I have been able to do is return the snowboard minigame time attack to the international difficulty. (times required are in exe starting 00926470).

Someone with more understanding of assembly is needed here.  The 2 things that need to be fixed (or given as option) are international version sub game (values for speed are altered etc), and propeller fix for speed round (gives tons of points) which is not present in international or American PSX.



DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Minigames Broken [FIXED]
« Reply #8 on: 2012-02-23 01:17:52 »
OK I had to look into some assembly I did not understand and after a wild goose chase around tons of memory addresses I finally found the correct part which sets the scores (005EB476).  From there I could locate the points table and from that find where the original table is.

The coaster points table is found in xbin.bin inside coaster.lgp   If you open xbin.bin you can see at address 10c6ec bytes e8 03 (3e8 = 1000) for the big space ship.

The thing to do now is find the propeller data and make it 0.  That should correct the minigame to be just like the psx version.

edit.  Seems this propeller thing is more than just a score... something else up here.

edit2:  I think I have solved it...  THINK.

=============================================
edit 3: yeah fixed pending some testing.  The issue is this...

The propeller blade has 2 values (2 propellers), both worth 40 points.  The game takes both when the propeller decides to give you the full amount (same thing happens with the boat) and each frame you get 80 points.  317 frames and that is 317*80 = way too many points. Actually it comes to slightly less than that because the game takes 40 points on last frame.  If I am right total points you could gain from the propeller would be this >

I had to record the game and the points I got were:

Main counter total = 25240 (depending on which frame you take it to start).  Of course you can get more beforehand by zapping the propellers.  Seems both worth 40.  The total possible points probably comes out as around

25240+ (35*80) = 28040.  I am guessing near to that value.  Don't take my word on it, that assumes a few things about the nature of the scoring prior to the main accumulator.

In any case, well over 25000 is possible and that's an oversight which I am happy I can fix in M005. 

To fix this issue, the 2 propeller values need setting to 0 points at 10b84c and 10b8ac in coaster.lgp, file xbin.bin

The file includes all records for the enemies you encounter from around 107abc although first  enemy appears at 107e7c.  The game takes a series of 4 bytes from each record.


« Last Edit: 2012-02-23 07:31:49 by DLPB »

LeonhartGR

  • *
  • Posts: 2577
  • ~Whatever...~ Enjoy life!
    • View Profile
    • LeonhartGR Productions
Re: [WIP] Minigames Fix
« Reply #9 on: 2012-02-23 11:47:16 »
Aali's new release!!! YES!

dkma841

  • *
  • Posts: 1225
  • delete
    • View Profile
Re: [WIP] Minigames Fix
« Reply #10 on: 2012-02-23 18:31:10 »
Ah great job man hope i can get decent scores this time lol

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: [WIP] Minigames Fix
« Reply #11 on: 2012-02-24 01:40:34 »
I am afraid the submarine battle may need someone with knowledge of the psx programming AND the PC...

I have tried to understand how the game differs in the international PSX version and so far it amounts to this:

  • left/right (turning) and up/down speeds are 400% faster in PSX. 
  • PSX sub is faster by 33% (PC hex value 60, new should be 80)
  • PSX uses wire frame model of the area
  • PSX draw distance is greater
  • PC timer continues to countdown after the game has ended


Those are the main differences.  The first 2 are obviously very important to change back. 

I cannot fix this one, and after a bit of trying I give in.  This is for someone else to look into. 

you will find the temporary placement of speed value here 9870f9 in memory.  We need turning speed, up down speed and original speed table.


« Last Edit: 2012-02-24 05:48:44 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Minigame Fixes
« Reply #12 on: 2012-07-06 11:02:39 »
Updated first post.  I will be looking into the submarine minigame again.

LeonhartGR

  • *
  • Posts: 2577
  • ~Whatever...~ Enjoy life!
    • View Profile
    • LeonhartGR Productions
Re: Mini-game Fixes
« Reply #13 on: 2012-07-06 13:15:01 »
Thank you so much for this update!

EQ2Alyza

  • 7th Heaven Crew
  • Global moderator
  • *
  • Posts: 3200
  • Dilly-Dally Shilly-Shally
    • View Profile
    • EQ2Alyza - YouTube Channel
Re: Minigame Fixes
« Reply #14 on: 2012-07-06 17:17:07 »
Updated first post.  I will be looking into the submarine minigame again.

 :)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Mini-game Fixes
« Reply #15 on: 2012-07-11 15:47:58 »
I am getting closer... I am understanding how the Sub game works.  The speed has been fixed  to the international version.  Now I have to get the ascend/descend / turn speed and make sure other things are good too.  It is looking very good at the moment.
« Last Edit: 2012-07-11 15:52:55 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Mini-game Fixes
« Reply #16 on: 2012-07-11 21:12:11 »
Update... the table that psx uses it 1:1 with the PC... so I copied all the values across from PSX international.  It still isn't right because there must be more data that needs copying across, but clearly, it is a start and the speed and other parts are fixed. I will keep you posted.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Mini-game Fixes
« Reply #17 on: 2012-07-12 04:28:44 »
With Luksy's help the last piece of the jigsaw has been finished.  I can now make this game play like the psx game.   As for longer draw distance and wire frame..  no.  Aali probably could.  But at least when I am done this will PLAY like the original.
« Last Edit: 2012-07-12 05:11:30 by DLPB »

dkma841

  • *
  • Posts: 1225
  • delete
    • View Profile
Re: Mini-game Fixes
« Reply #18 on: 2012-07-12 17:00:21 »
With Luksy's help the last piece of the jigsaw has been finished.  I can now make this game play like the psx game.   As for longer draw distance and wire frame..  no.  Aali probably could.  But at least when I am done this will PLAY like the original.
:mrgreen:

Hellbringer616

  • *
  • Posts: 1913
    • View Profile
Re: Mini-game Fixes
« Reply #19 on: 2012-07-12 17:12:09 »
So now we just wait for .8b then?

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Mini-game Fixes
« Reply #20 on: 2012-07-12 17:41:53 »
Assuming Aali has fixed the ones I listed as aalis driver... I dunno if he has placed these fixes in.  He needs to.

The others I listed are placed optional in Menu Overhaul installer.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Submarine
« Reply #21 on: 2012-07-13 16:18:15 »
I have documented some of the main values involved in the minigame ahead of my change.  I am currently looking at the PSX version to get these values as close as I can.  It isn't going to be too hard from this point on.  Just trial and error and comparisons.

The following exe addresses have to be changed before game start.  It is no good changing the memory addresses at run time because they are taken from the exe when the submarine game begins:
Code: [Select]
Time Limit and beginning of main initial data table.
586ef8
3 Bytes [possibly 4, but anything greater than 59 min 59 sec requires further modding]

Sub Speed multiplier [set to 40 (4x) for PSX international]
586f40

Health [default is 40h (64)
When changing this the health bar graphic code below also needs altering]
586f34

The following are memory addresses:
Code: [Select]
Health bar graphic
07925BB memory

unknown table
009a85e4

Main Function
0079857b

acceleration bar forward speed
007985b5
acceleration bar backward speed
007985cc

unknown acceleration bar forward speed action
0079863a
unknown acceleration bar backward speed action
00798657

descend graphic speed
00798729
ascend graphic speed
00798743

Speed rotate 3d right
0079875d
Speed rotate 3d left
00798777

descend speed
0079882e
ascend speed
0079884f

descend graphic catch up speed
00798964
ascend graphic catch up speed
0079897e

Graphic catch up rotation speed right
00798a11
Graphic catch up rotation speed left
00798a2a

Graphic speed rotate right
0079875d
Graphic speed rotate left
00798777

Area speed rotate right
00798870
Area speed rotate left
00798891

00798921
Ascend/Descend delay (and other cmp values below).

007989cb
Rotation delay (and other cmp values below).

Unknown rotate right action
00798a89
Unknown rotate left action
00798aa3

Initial movement on descend
00798b3c
0798b64
Initial movement on ascend
00798b53
00798b73

Initial movement on rotate right
0798b89
0079892
00798bc4
Initial movement on rotate left
00798baa
00798bb3
00798bd3

unknown rotate right action
00798be2
unknown rotate left action
00798bf1

Other memory addresses
Code: [Select]

Temporary address for energy (change reflected in real time)
00987348

Mine damage
00799606

Missile strength (both enemy and ally)
0079D28f

« Last Edit: 2012-07-15 23:44:06 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Mini-game Fixes
« Reply #22 on: 2012-07-13 19:36:18 »
You can turn wireframe view on with F2.  Did anyone else know that?  Making the wireframe green like International will probably be a doddle.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Mini-game Fixes
« Reply #23 on: 2012-07-15 19:29:49 »
I am attempting a few things here... to make the game harder and to make this awful score calculator sane.  I will now document how the submarine game calculates your score:

Code: [Select]
Breakdown of Submarine Scorer

Starting 007932f9

mov eax,[ebp-0C] : Move Current points from non destroyed submarines to eax
add eax,[edx+10]: Add points from Non Destroyed Submarines. This will loop until
all submarines have been added to ebp-0c.  When this is done, the loop will
terminate and move on to

mov edx,[00E981CC]: Move value into edx.  This value is the total points of all
submarines active or destroyed. It is therefore the total points of all the
submarines combined.

sub edx,[ebp-0C]: Subtract the non destroyed submarines points from the total
 points of all submarines.  Therefore, the more submarines you destroy, the better
your score.  If you destroy no submarines, edx will now be 0.

mov [ebp-04],edx
mov eax,[ebp-04] : Move edx into eax.

add eax,[00987348]: add the value of the energy your submarine had left.
The  original value is 4000h, meaning if you survived the game with all your
energy intact 16384 points will be added. This also means that even if you
do nothing in  the minigame you will gain 16384 points.

mov [ebp-04],eax
mov ecx,[ebp-04]:  Move eax to ecx

add ecx,[00E74770]: Move value of the time you had left.
This value is seconds*60.  For example, if you finished the minigame
with 5 minutes remaining,  you would gain 18000 points (5*60*60). 

mov [ebp-04],ecx : Move ecx to ebp-04

mov edx,[00EC7AA0]: Move value into edx.  This value is a punishment value.
When locked on, for every missile missed, this value is incremented by 1.

imul edx,edx,64: Multiply the punishment value above by 100
(to make the number  significant).  This means for every missile missed
when locked on, you lose 100  points.

mov eax,[ebp-04]: Move the current points you have
before the action above into eax.

sub eax,edx: Subtract the punishment value from your total score. 

mov [ebp-04],eax:  Place score into ebp-04.  This is your final score.

To simplify the above for you:
Code: [Select]
Score= (total_submarine_points - Total_non-destroyed_Submarine_points)
+ Energy_Remaining [max 16384] + (Time_remaining_seconds*60) - (Number_of_Missiles_missed*100).

The whole thing is ridiculous really.  Rather than a simple score structure, they  have made this a convoluted mess.  Having the energy value as 4000h instead of  just 40h is a joke to begin with... and then factor in time having such a large value,  each sub having various points which are deducted at the end if you havent  destroyed them, coupled with this punishment value... and you have a mess.

Note.  Each submarine has its own points allocation from a table.  Therefore the game adds these all up to arrive at [00E981CC].  It does the same with any Non-destroyed submarines to arrive at the other value.  Because of this, each difficulty has a wide variance in maximum theoretical points (due to different submarines being used and different counts)... and it isn't a very logical difference either.

The missed missile counter is unfair and unworkable really.. if you have a sub that needs 4 missiles to destroy it, the first 3 may hit and you may fire another 3.  2 of these will be deemed to have missed.
« Last Edit: 2012-07-15 20:12:51 by DLPB »

Lazy Bastard

  • *
  • Posts: 290
  • I may be lazy, but I can...zzzZZZzzzZZZzzz...
    • View Profile
    • GameHacking.org
Re: Mini-game Fixes
« Reply #24 on: 2012-07-15 20:34:20 »
Nice work reversing the submarine game. Now to fix it :)