Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: DLPB_ on 2012-02-04 20:40:58

Title: Mini-game Fixes
Post by: DLPB_ 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.

Title: Re: Goldsaucer Coaster Minigame Broken
Post by: DLPB_ 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.
Title: Re: Goldsaucer Coaster Minigame Broken
Post by: DLPB_ 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.

Title: Re: Goldsaucer Coaster Minigame Broken [FIXED]
Post by: DLPB_ 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.
Title: Re: Minigames Broken [FIXED]
Post by: DLPB_ 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?)
Title: Re: Minigames Broken [FIXED]
Post by: DLPB_ 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.



Title: Re: Minigames Broken [FIXED]
Post by: Kemlin 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!
Title: Re: Minigames Broken [FIXED]
Post by: DLPB_ 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.


Title: Re: Minigames Broken [FIXED]
Post by: DLPB_ 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.


Title: Re: [WIP] Minigames Fix
Post by: LeonhartGR on 2012-02-23 11:47:16
Aali's new release!!! YES!
Title: Re: [WIP] Minigames Fix
Post by: dkma841 on 2012-02-23 18:31:10
Ah great job man hope i can get decent scores this time lol
Title: Re: [WIP] Minigames Fix
Post by: DLPB_ 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:



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.


Title: Re: Minigame Fixes
Post by: DLPB_ on 2012-07-06 11:02:39
Updated first post.  I will be looking into the submarine minigame again.
Title: Re: Mini-game Fixes
Post by: LeonhartGR on 2012-07-06 13:15:01
Thank you so much for this update!
Title: Re: Minigame Fixes
Post by: EQ2Alyza on 2012-07-06 17:17:07
Updated first post.  I will be looking into the submarine minigame again.

 :)
Title: Re: Mini-game Fixes
Post by: DLPB_ 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.
Title: Re: Mini-game Fixes
Post by: DLPB_ 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.
Title: Re: Mini-game Fixes
Post by: DLPB_ 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.
Title: Re: Mini-game Fixes
Post by: dkma841 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:
Title: Re: Mini-game Fixes
Post by: Hellbringer616 on 2012-07-12 17:12:09
So now we just wait for .8b then?
Title: Re: Mini-game Fixes
Post by: DLPB_ 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.
Title: Submarine
Post by: DLPB_ 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

Title: Re: Mini-game Fixes
Post by: DLPB_ 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.
Title: Re: Mini-game Fixes
Post by: DLPB_ 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.
Title: Re: Mini-game Fixes
Post by: Lazy Bastard on 2012-07-15 20:34:20
Nice work reversing the submarine game. Now to fix it :)
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-15 20:40:23
The minigame is fixed as far as controls are concerned.  It now plays like it should. I can fix the scorer to be fairer and give it as an option.  The part that is hard is understanding which parts of the table do what in relation to enemy subs.  A lot of this data is a mystery to me, and I need to know because this needs changing.  It is not same as international version.  For example reactor battle has 7 subs in international and not 8.  There are likely a million differences in these tables.

Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-16 01:57:34
It turns out that although the tables exist (and are likely used in the psx version), they are more or less completely redundant on the PC game.   There are vast amounts of data in the exe completely unused and worthless because this minigame uses its own hardcoded settings.

I have located the main settings now, and can make any difficulty have 1-12 subs, as well as change the amount of energy they have and hit points required to beat them.

Making these records the same as international is unfortunately a far harder task since it would mean painstakingly looking at the PSX records and manually changing them in ff7.exes hardcoded area.  Basically I am not going to do that.

But what I am going to do is add in an option for a hard mode and better scorer, so this game will be more fun to play.  I have also sorted the internal programming to make the sub and area move like the PSX international.

My dealings with this minigame are pretty much done :)
Title: Re: Mini-game Fixes
Post by: Salk on 2012-07-16 04:59:15
Great job, DLPB!

Looking forward to the release of this new minigame fix!  ;)
Title: Re: Mini-game Fixes
Post by: DestroGalacticmon on 2012-07-16 21:09:33
I don't know if this relates to the matter at hand, but I've noticed that when starting the Submarine minigame, it loads Aseri2 and plays it for a few seconds. Then it just stops... If I remember correct, it played flawlessly on the PS1. What's the deal with that?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-16 21:12:13
What is aseri2 again?  A music?  I don't recall anything playing?
Title: Re: Mini-game Fixes
Post by: DestroGalacticmon on 2012-07-16 21:17:09
Aseri2 would be known as "Hurry Faster" in the OST. And I could bet a few bucks that it was playing during the submarine minigame... I could be wrong, though. I'll check the PS1 version now.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-16 21:20:59
It certainly wasn't from what I remember.  It never appeared during the minigame from gold saucer.  No sound is played at all, either psx or pc.
Title: Re: Mini-game Fixes
Post by: DestroGalacticmon on 2012-07-16 21:28:22
Huh, now this is weird. You know, I just re-played the Underwater Reactor Battle in the PS1 version, and the music was playing at first... then, it faded out.  :o So I guess there's nothing wrong with the PC music after all? My mistake...

Side note: Is it just me, or do the PS1 sound effects have better quality than the PC ones?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-16 21:29:50
It isn't you.  The PC from what I remember use ADPCM 8 bit (?) and are mono(?).  The PSX are generated at run time using the consoles sound chips.  They are stereo.

That's off-topic though.  :D
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-17 22:56:06
New scorer is in place.  I had a long think about this and the new difficulty settings I will be adding, and this is the only real fair way.

Code: [Select]
Score= (Enemy_subs_destroyed*1000) - (Energy_lost/4) - Missiles_missed
Example:

Code: [Select]
10 Submarines destroyed, lost 1 bar of health, and missed with 5 missiles.

(10*1000)-(2048/4)-5 = 9483

Maximum points with 10 subs is therefore 10*1000-0-0 = 10000 points.

Time is only a consideration now for getting the job done, and of course, I am reducing that from 10 minutes.  I would have kept the frames_left calculation but the game uses timegettime which is very unfair.  If you don't get a full frame rate, the timer still counts down the same putting glitches or slow computers into the equation.  Time is still a consideration but not for score.  Score is now based heavily on number of subs destroyed and health lost, with accuracy a much smaller consideration than before.  Nevertheless, this number will be a factor with elite players.   

My plan is to make the submarine game always have 10 submarines, (or at least levels 1-4) but the speed of the subs, their energy and so forth widely different between levels.  If all works out, the different levels will FEEL like different levels.  In any case the scorer is done.  The best thing about the new scorer is, you only get points for what you do.  If you do nothing, you will end on 0.  Not on 16384 like before.

Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-18 06:41:15
Ok so the final 2 stages are here:

1.  Program in each level to have different time limits and attributes:  half done.
2.  Set AI and health of subs:  next

Part 1, I've had to do a really bog standard job.  The game does pull values from a table (that is never used), but pulling the time values eluded me since the game was designed to skip the tables and be superseded by hard code later on.  Instead I have devised a way to branch out the code and find the level then directly change the time value.  As seen in the pretty picture.  It sucks, but it works.  From here I can add what I like to each level.  Of course I have to stop any other code writing to these addresses.

(http://dl.dropbox.com/u/36889302/FF7/new%20times.PNG)



Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-18 08:32:45
OK last update before release.  I have programmed in the ability for each level to have different mine strength, different enemy attack strength and different time limits.  I will try to add different enemy firing rates too.  Coupled with the new scorer and international code, this minigame is a whole lot more fun now!
Title: Re: Mini-game Fixes
Post by: Tenko Kuugen on 2012-07-18 08:40:18
How much of this is actually in a full bootleg install? ( and how safe it is in regards to breaking the whole install if I add any fixes afterwards since I made my own edits on kernel, .exe, scene and flevel after the bootleg )
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-18 08:51:53
The submarine minigame is unreleased.  All the other fixes listed here are either waiting to be implemented by aali or in MO installer (and bootleg?).  Full summary on first page.

The code change shouldn't break anything, and will be an option in the next MO.  It is going very well here.  I have decided that the last level will be a 1 shot kill.  If you get shot, you iz dead.

Title: Re: Mini-game Fixes
Post by: Tenko Kuugen on 2012-07-18 09:04:34
I believe MO.exe gets used during Bootleg ( at least theres an option to install several fixes and I have a MO.exe in my bootleg folder. )
to which files are the fixes actually written? I remember that some minigames had their own files ( like fort condor )
speaking of fort condor, do you know if anyone has ever bothered to properly document the file for it? because one could do interesting things with said minigame
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-18 09:06:10
No one has touched it program wise from what I can see...  not sure where the code is for that, very likely ff7.exe.  That's where the submarine game is :) 

Some of the fixes are done to flevel like the battler 3d odds.   
Title: Re: Mini-game Fixes
Post by: Tenko Kuugen on 2012-07-18 09:12:20
hm, well, I did all my personal edits after the bootleg install so I assume that includes most fixes
the minigamefolder has files for chocobo, coaster, condor, snowboard and submarine. are those all just graphic related?
also, suprising just how much crap is stored in the exe
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-18 15:49:18
When they ported to PC they placed a lot of the programming into ff7.exe.  Menu values and so forth... but they also shipped a ton of stuff from the minigames too.  The submarine game is entirely in ff7.exe with only the graphics remaining in the Minigame folder.

The submarine game is by far the worst coded thing in FF7.exe.  It has huge tables in the exe which although accessed and written, are then superseded by identical hardcoded data which is also placed into identical tables at run time.  It  makes absolutely no sense. A HUGE area of the exe has been wasted.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-20 02:19:13
OK I lied.  But I am excited.

Today the final values were found and I have reprogrammed the last of the data  This means each new minigame level has its own:

time limit
enemy submarine speed settings
enemy submarine health settings
enemy submarine fire rate
enemy submarine Missile speed
enemy submarine missile chasing timer
Enemy submarine missile strength
Ally submarine missile chasing timer
Mine strength

Level 1 is piss easy but...
Level 4 is deadly.  I have modelled it after Euro Extreme mode on MGS2.  You are allowed to be hit by 2 mines, but 1 enemy sub missile and you are a goner.  These missiles travel faster and longer.  It really is like a proper war game now!  Release sometimes in next 2 days I reckon.

Also note, the original submarine game had an issue.  The enemy subs were firing all 4 of their missiles in 1 go.  This has also been fixed.
Title: Re: Mini-game Fixes
Post by: DestroGalacticmon on 2012-07-20 14:03:20
Does the wireframe mode still have to be enabled manually, or is it enabled by default now?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-20 15:28:34
Manual, though I guess I can probably set it to be default.
Title: Re: Mini-game Fixes
Post by: DestroGalacticmon on 2012-07-20 17:39:44
Well, having the wireframe by default would sure be easier when playing with a controller, which has no F2 button. :D

Also, wireframe mode is better for the overall feel. Having only the blue geometry to navigate with felt like I'm trying do squats in a mailbox. Wireframe offers a lot more relief and breathing space.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-24 17:33:59
Now remember the extended mini-game programming I have done is OPTIONAL.  The new scorer and the International version movement are separate and can be used with the original AI and values.

This video is a test showing different missile programming.  I now have to use trial and error to get all the difficulties gelling properly and the AI working better (enemy ship speeds etc). A few niggles to sort out but even at this early stage it is more fun to play with  8)

http://www.youtube.com/watch?v=2uPoXn0SZDE&feature=youtu.be
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-24 23:12:22
The wireframe is now on by default and is in green.  A very nice green it is too.

The wireframe has 4 modes
which are set from 0077F731

00: No wireframe, smooth area.
20: No wireframe, Unsmooth area
40: Wireframe, smooth area
60: Wireframe, unsmooth area

Originally only 00 and 40 were used.  I have made 20 and 60 the used versions, with 60 as default.

00 and 40 do not smooth out the area, but personally, I think it looks far better as sharp.
Title: Re: Mini-game Fixes
Post by: LeonhartGR on 2012-07-25 00:06:34
Well done DLPB... you finally made it!
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-25 00:12:08
yup!  I am experimenting now with the colours.   The PSX uses a much darker green to me but my green looks better :)  I will give a few options with this mod probably when done.

I do believe I now have the holy grail for editing this game.  The international PSX version does have 1 or 2 other minor differences, like better missile colour... I can look into that if I get bored.
Title: Re: Mini-game Fixes
Post by: obesebear on 2012-07-25 01:50:14
That's awesome.  And now that this is done, why not tackle increasing draw distance in all areas...;)
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-25 01:55:47
I could probably do that, however, that's a game breaker because the limited draw distance for uncovering things is what gives an element of surprise.  Of course, wireframe view gives a full look at the map.

This is how the wireframe is looking (I have allowed option for the dark green look)

http://dl.dropbox.com/u/36889302/FF7/wire.PNG

I may edit the blue colour slightly too.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-25 03:20:14
http://www.youtube.com/watch?v=XTjkArPXiDg

mainconcept encoder and vegas seems to make this darker than it is.  Nvm.  (if anyone knows why, let me know).

Next time you hear from me will be a main release.  8)
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-26 04:53:08
I lied again.  I would have been making good progress with the minigame but Luksy reminded me how crap the original mine graphic colour is... so I hunted about like an idiot until I finally closed in on it... and with the help of adobe to pin point exact colours I managed to locate the colours for the column and mine.

The mine was a nightmare, but after ages searching I located a table.  The table starting 00987458 sets the colour for each of the diamonds 8 sides.  Now I can finally get to work finalising all this.

http://dl.dropbox.com/u/36889302/FF7/Minecolour.PNG

Must admit, when I gave up on this minigame before I never thought I'd manage all this. 
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-07-28 05:53:00
Quick update about the Submarine text.  It took me a while to suss what was going on here, I always thought the sub game used textures for the words, but it has its own font.

For anyone who wants to translate the text it may prove hard... each letter is hardcoded.  As long as you don't need to add letters it should be possible with trial and error changing the values for the font offset. 

See this:

http://dl.dropbox.com/u/36889302/FF7/Subtext.PNG

As you can see I have altered 2 letters of the word TARGET by changing the X offset value for letters T and A.  Trial and error is the only way you can make it look nice.  It takes experiment.  The programmer who made the game obviously had to create his own programming for text and thus we get this.  The TARGET word starts at memory 007976DE.  This sets the words at game start for each letter.

Above and below this are the rest of the words TIMELIMIT, SCORE etc.  Changing TIMELIMIT to GAME OVER would be no problem because they are the same number of characters... but making more letters would require considerable work.  For this reason, anyone who wants to mess about with this for foreign translations will need to work within the current framework (Assuming foreign games haven't already corrected this minigame).

Title: Re: Mini-game Fixes
Post by: _Ombra_ on 2012-08-28 14:42:25
DLPB, we had the text locations figured out a long ago. It was freaking hard to find how it worked but we never got around to translate it in our work. What we did tough is use the spanish version of the exe for the italian translation which had longer text. You might want to poke around that to see how they implemented it. Just my 2 cents :P
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-08-28 15:31:45
I don't need the text :P  It didn't take me that long to find it either luckily  8)
Title: Re: Mini-game Fixes
Post by: _Ombra_ on 2012-08-28 17:49:03
DLPB, i meant compare it to the english one to understand how to expand it... if there is an easy way...
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2012-08-28 17:51:00
There isn't...  If you want to expand it you have to add in programming and that takes a lot of messing.  But the English game is fine and doesn't need any text changes.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-18 01:40:17
http://www.youtube.com/watch?v=JEV1rise1V8

While I was looking into the Coaster game, ready for my own difficulty mod, I saw that every main 3d item is actually allowable as a collectable, including the Welcome message at the start of the game.  Each model that is a collectable but you don't collect in the normal game has points of 0 (so obviously you'd have to set that too).

I just went through a game and collected things like lava flows haha.

The main function for scoring points (and deciding what type of points system to use) starts 0x5ED5AC.  For example the boat propeller thing uses ID 3, so it jumps to 5ED765 and performs the action.   All you need to do is give your collectables an ID, an energy level and points.  The function is called every time a collectables energy has run out..

If you search for
Code: [Select]
E8 03 00 00 01 00 00 00 52 07 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00
00 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00

when playing coaster you will find the data for the main spaceship (and the table is identical in xbin.bin).  E803 is it's points (1000) and 8601 is its energy (390) [not seen above] and 05 is the points ID.  If you set this to 03 then the points will be calculated based on increasing points like the boat.  The boat is set to 1 point because it increases rapidly.  Originally the zeppelin propeller was set way too high and hence the "bug" where it gave you a lot of points.  I corrected this by setting its points to 0.

Remember that different ID's have different ways of calculating points.  ID3 does it by the duration of your beam on the object as said.  There are a LOT of items in the coaster game in total, so finding the item you want to include as a collectable is a tedious task of using a debugger on the code and locating each table, then  editing xbin.bin.

welcome sign:


00 00 00 00 01 00 00 00 4B 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00



Red is points allocated
Blue is ID,  I used 02. I do not know what the other 4 ID's are. I only know what 03 is at the moment.  (and 05 seems to be specific to the spaceship)

By simple edits to the main tables, you can control all aspects of the collectables including their positions.  I don't intend to document all that because all I want to do is a few minor tweaks.

Below the welcome sign is an identical section to above, this is the sides of the welcome message.
Title: Re: Mini-game Fixes
Post by: JBedford128 on 2013-02-18 16:41:17
I just decided to investigate. Forgive me if I'm saying something we already know.

Code: [Select]
            5b 00 00 00 C7 00 00 00 30 75 00 00
E8 03 00 00 01 00 00 00 52 07 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00
00 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00

I don't know how big each object block in the Coaster minigame is or where they start, but the "5b" in the example above changes what the object looks like-- the model it uses. So above is the block for the big UFO.

I edited the "Welcome" sign's model from its original "60" to "5b". And this changed the Welcome sign to the big UFO model.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-18 16:47:17
It's quite possible :)  There is X Y and Z information in there some place too, to move the objects about. I am guessing there is also "frame" information, telling it what frame to appear on.

The total data for each object is 96 bytes.

The UFO full is this:

05 00 00 00 5B 00 00 00 C7 00 00 00 30 75 00 00
E8 03 00 00 01 00 00 00 52 07 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00
00 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00
00 00 00 00 86 01 00 00 00 00 00 00 00 00 00 00
00 00 00 00 2D 02 00 00 DB 01 00 00 00 00 00 00

Welcome sign is:

05 00 00 00 60 00 00 00 CC 00 00 00 00 00 00 00
00 00 00 00 01 00 00 00 4B 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Boat is:

05 00 00 00 2C 00 00 00 0C 00 00 00 00 00 00 00
01 00 00 00 01 00 00 00 20 03 00 00 00 00 00 00
39 03 00 00 00 00 00 00 1E 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 03 00 00 00 64 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 EA 01 00 00 00 00 00 00

Try documenting some of the stuff for me.

What we know is:

Byte 5-6: image/model visual?
Byte 13-14: Related to movement speed
Byte 17-18: Points allocated
Byte 45: When set to 0A, model rotates. May be rotation speed.

Byte 57: ID  (00 enemy/model cannot be collected
                    01 normal
                    02 unknown
                    03 points continuously added on when energy is less than 0
                    04 unknown
                    05 Spaceship only, probably tells it to explode).

Byte 85-86: Energy


The data is there for its X Y Z, frame position, because if you copy the ship data to the welcome sign, you get no sign, but you do get 2 ships instead of 1 at the same time.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-18 20:54:36
Other note

At 005F0CB5 change to sar ecx,02  this will get the beam graphic thick again like it was in the playstation version.

(005F0CB7= 02 )
Title: Re: Mini-game Fixes
Post by: JBedford128 on 2013-02-18 23:42:12
Compiling a list of models (http://finalfantasy.wikia.com/wiki/User:JBed/FFVII/Coaster). I'll add some images another time. Also many of them don't seem to appear/can't be seen when changing the Welcome scene so a lot state "Nothing".
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-18 23:47:59
Cool so you are updating these based on the ID?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-19 00:04:13
Also that boat thing in the bottom left that sometimes gives out 200+ points and sometimes does not.. I think it's a bug.  There's something wrong with something in the code that makes that behaviour happen.  If you aim your cursor in bottom left for duration of minigame you will see it adds 6 or it adds 223.  Seems completely random.

It seems to pick and choose when to call 005ED528 (at 005EC22F) repeatedly (and it shouldnt do that if you are not firing at it). You can see that its energy value continues to decrease even when you are not aimed at it (assuming you are still firing).

Something happens there where the function which is called when you are firing at something, accidentally keeps being called.  If I or anyone else cannot do anything about that, I will just set that thing to 0 points so that it is effectively disabled( the same way I did for the Zeppelin propeller which has this exact same issue).


Things I am changing for Weapon (my difficulty mod)

Aimer speed will be fixed
Aimer graphic will be fatter like it was originally  (these are hopefully being added to aalis next driver by default)

Aimer power will be 4x greater, this is to balance out what i see as this game being too difficult on NTSC.  The chance of anyone getting a perfect score without cheating is very remote indeed at the moment.  PAL can be done...  NTSC, no chance.

Big UFO will be much harder to destroy (it's worth 1000 still so that's necessary)

Certain new objects have been added, and one or two removed.

object points have been amended

The boat rotor no longer gives points out due to internal bug that also exists in all Playstation versions.  I can make this model collectable in its own right, but because of the bug it can be collected even when you are not aiming at it.  So I have disabled it. The Zeppelin rotor is disabled for the same reason. It may be possible to change the tables of these 2 so that the bug does not manifest itself.  I will check.



Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-19 07:16:13
I've now finished the edit to coaster minigame.  I will go back to sorting submarine game now :)  May prove a harder task thanks to the way the tables are in that game.

I am also going to remake the script for the prizes for the minigames.  The coaster prizes are a complete joke.  Whoever's job it was was bone idle.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-19 23:26:01
http://finalfantasy.wikia.com/wiki/User:JBed/FFVII/Coaster

Quote
The offsets are from the entirety of coaster.lgp, not from just the individual .bin file

The main 96 byte data is 1:1 in xbin.bin.   There is only one other file in coaster.lgp and that is xbinadr.bin and that has nowhere near the data needed (although it could be setting addresses).

All main data comes from 1 file.   The big UFO is at 10C6DC (in xbin.bin) .

I have modified every single enemy in the game from this file, added some models and removed others and changed all points.  Everything needed to edit the game is in that file :)

Is that what you are referring to?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-20 07:28:19
I attempted to do this when I was around 18 and I didn't get far...  but now, armed with virtualdub and a hex editor, I can finally shed some light on the scoring of this minigame.

http://www.youtube.com/watch?v=FIGKdGtpcJk

Shademp is the best I have seen at the coaster game in PAL version (NTSC is nigh on impossible compared and you'd be there all year trying to get 8100+ at it).  My highest score at coaster pal is in the 8000 region (I'd have to check my PSX save for exact figure but it definitely isn't as good as Shademp's attempt above because I know what I missed.).  Even Shademp missed something in the ice cavern (as I am sure 99.9% of people will). The ice cavern has 31 collectable objects originally totalling 1590 points.  The chance of clearing it even in PAL is remote (it can be done in NTSC too, because I just did it after 20 odd tries).  I will be amending this area now as well, in light of the crazy placements this area has.

Because of the boat rotor bug it is difficult to get an exact figure on the maximum original total (not including the zeppelin propeller), although I believe the bug gives out 222 plus what you got beforehand) I may look into that tomorrow. My total stands at exactly 4310 (pending the ice cavern remake).

In my game the total number of collectables is currently 138 (I've removed 7 and added  5 so far)

Not including the rotor (which isnt collected), the total for the original game is 140 collectable objects

10 Ghosts
6 Plants
10 Blue planes (1 is at the end)
11 Gray planes (1 is at the end)
1 Rock
3 Fish
10 Stars
31 Ice cavern objects that are fucking ridiculous to distinguish (7 of them are ice spikes, 24 are icicles)
19 Small balloons
1 Large balloon
9 UFO
8 Pink Ship
7 Lava rocks
9 Helicopters
3 Fast UFO's with light beam
1 Mother Ship UFO
1 Light (you can receive the same light on either side at the end.  It shares code).


Shademp's extensive testing with the rotor appears to indicate that the maximum points it will give out is 285.  If this is so, the total score for the original game is  8184 + 1 + 70 = 8255.  I am 99% confident of that figure.

The total score for the original game without the rotor is definitely 7970

Yes, it's quite obvious I need mental evaluation.

Pal runs at 50 fps, NTSC/PC (correct speed) runs at 60fps
Quote from: dlpb
it's surprising how much that extra 10fps affects games... the coaster game is much harder in NTSC.  I can get 7900+ on PAL version once every 10 or so games... max 20.  But with NTSC that would likely be 50 tries.  It is little wonder people online generally talk like getting 7000 is so hard, and then people in PAL area are arguing it isn't too bad


Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-20 09:29:02
Comparison between International PSX and PC (PC is 1:1 of old Japanese) for main table xbin.bin (in playstation version this is xbin2.bin)

Code: [Select]
    RAW Offset   | Old Byte | New Byte
-----------------+----------+----------
     0010B84C         28         00
     0010B874         03         00
     0010B880         00         02
     0010B8AC         28         00
     0010B8D4         03         00
     0010B8E0         00         02

6 changes. 

0010B84C: Zeppelin Propeller1 points set to 0
0010B874 : Zeppelin Propeller1 ID set to 0 (effectively disabling it completely)
0010B8AC: Zeppelin Propeller2 points set to 0
0010B8D4 : Zeppelin Propeller2 ID set to 0 (effectively disabling it completely)

I expected those 4.  They are after all the reason the Zeppelin is not used in later revisions after original Japanese.

The next 2 I did not expect (they are still for each of the 2 propellers on the Zeppelin):

Code: [Select]
0010B880          00         02
0010B8E0         00         02

For some reason...  the energy for the propellers is 2 and not 0.  I can't see any reason for this other than the fixer might have thought this was needed.

Basically, the ONLY change from original Japanese to later revisions is the disabling of both zeppelin propellers... this was done because ALL objects that use ID 3 (like the boat rotor) have an internal bug.  The Rotor adds 1 point for the duration you are aimed at it AND keeps adding it when the bug occurs...  but the zeppelin had 2 propellers each worth 40 points... and when the bug happens... that's an ENORMOUS amount of points that get added (80x the boat rotor, and probably in the vicinity of 17000 points, I calculated it as 17760 maximum possible).

rather than fix the bug itself, they have done what I have .... disabled the object.  I went one further and disabled the rotor as well. The rotor is every bit as buggy as the zeppelin... the difference is the small amount of points it adds (well... 222 is still too many) was something they could ignore.



Title: Re: Mini-game Fixes
Post by: Cyberman on 2013-02-20 21:53:09
For some reason...  the energy for the propellers is 2 and not 0.  I can't see any reason for this other than the fixer might have thought this was needed.
Or it could be an artifact sometimes when "fixing" something you do changes empirically instead of using a 'reasoned method' ahem (LOL).


Basically, the ONLY change from original Japanese to later revisions is the disabling of both zeppelin propellers... this was done because ALL objects that use ID 3 (like the boat rotor) have an internal bug.  The Rotor adds 1 point for the duration you are aimed at it AND keeps adding it when the bug occurs...  but the zeppelin had 2 propellers each worth 40 points... and when the bug happens... that's an ENORMOUS amount of points that get added (80x the boat rotor, and probably in the vicinity of 17000 points, I calculated it as 17760 maximum possible).
Interesting sounds like their are 2 potential sources for it. If it occurs in 2 seperate objects then it becomes suspicious. Are these objects in seperate games or seperate parts of the game ... (if you follow my reasoning).

rather than fix the bug itself, they have done what I have .... disabled the object.  I went one further and disabled the rotor as well. The rotor is every bit as buggy as the zeppelin... the difference is the small amount of points it adds (well... 222 is still too many) was something they could ignore.

Depends the bug may be in the actual script engine or in the script code. The person was likely told "do it now". Also their are other problems that aren't "apparent". If the person was the script writter and the script engine was now "done" (no bug fixes in the engine are now allowed) then the only way to fix it may have been to disable the offending objects.

Cyb
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-20 21:58:22
The propeller is 2 specific objects, i..e there are literally 2 propellers :)  each worth 40 points originally. The above addresses disable both (although just changing the points they are worth to 0 would have sufficed). 

originally, if you hit both propellers perfectly you got 2*40 points for the duration your aimer was on it (though not every frame), but once the bug kicks in you then get 2*40*60 (a second) for the duration the bug happens.  I think what stops the counter continuing is the next enemy loading into memory, effectively terminating the propellers. Same with the rotor... by that time tho... the damage has been done.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-21 02:04:52
Ok so final word on the new coaster game before release.  These are the changes:



The number of collectables is now 124, down from 140.

The total points available is 4050, down from 8255.


It is possible to get a maximum score when you are excellent at the game... as opposed to before where you'd need to lose your life and also have monumental luck.  If you do get full points you will receive a Master Summon.   It is not going to be that easy to do though, so don't think you will be able to doddle your way to it.  I may have to amend this prize to occur only when you are later in the game, although there's something fun about giving people the chance that early on, especially given how difficult it still is to finish this with max points.  All other prizes will also be amended.  There will be NO 1:35 soldiers haha.

Title: Re: Mini-game Fixes
Post by: Mako on 2013-02-23 16:20:10
I think a Master Summon is a bit game breaking. You could offer a Mystle, or a triple slot weapon... Or if possible a newly created weapon/armor/accessory.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-24 02:08:43
Master Summon is not game breaking because to get the max points is out of the reach of over 99%.  It also costs a fortune in GP.  If people are good enough to beat the game with max points, fair play to them.  Even then, the Knights of the Round summon would not save them against most enemies because it costs a lot of AP and it can only be used once, not to mention it is weaker at start.  I could always make it so it is only available later in the game too.

My difficulty mod will balance it out.

I still haven't made top score.  I can get within 30 of it, and I am a very good player at it :)
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-25 04:53:36
The other minigames in Gold Saucer needed change too

1.  The script is often programmed not to add on the GP if it will go over 10000, rather than set to 10000 when you go over.  Some places do, others don't.  Lazy and ridiculous...  The code can be far simpler. (You will still get 10000 with both systems, but it really is a bit silly when you can place if gp>10000 then gp=10000 at the bottom)

2. I am doing the following at the Gold Saucer Wonder Square:

a. Wrestler and Sumo Wrestler are harder.  Sumo is reasonably difficult, but Wrestler is more like Metal Gear Solid 2 Euro Extreme Mode. Probably worse. 

b. Wonder Catcher odds changed slightly.

c. Submarine game updated

d. 3d-Battler odds of winning whole thing made roughly 400-1 down from 3709-1 (the original programmer made a critical mistake with understanding how probability works).  Bug also fixed.  Bug exists because during test stage, no tester managed to beat this game.

e.  A lot of prizes amended. More prizes have been added to G-Bike.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-27 09:44:32
I need some people here to do some tests for me.  Need you to try and get the highest score you can at G-Bike.  My best is 17400.

That way I will know what prizes to use. I am confident of these already but would be good to know for sure.
Title: Re: Mini-game Fixes
Post by: mystery_editor on 2013-02-27 12:19:57
Is there any scoring difference in G-Bike between the PSX and PC versions?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-27 20:14:48
No.  If there were, I would have fixed it.  8-)
Title: Re: Mini-game Fixes
Post by: Ansem on 2013-02-27 20:24:12
Judging by the G-Bike score I just did for the sake of showing off my skills your magnificent work, the maximum amount of points is 20000. Am I right?

Anyway, for the high score, see my screenshot here: http://i218.photobucket.com/albums/cc143/Shadow_Saix/G-BikeScore.png (http://i218.photobucket.com/albums/cc143/Shadow_Saix/G-BikeScore.png)
NOTE: The hi-score in the screenie is outdated - look at the new score instead.   ;D

The truck got hit only two or three times during the entire chase. Also, I missed one red motorcycle at the very end of the road; whatever points I'm missing are the ones from that red motorcycle and the 2-3 hits the truck took.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-27 20:25:48
There is no maximum score that I know of.  There likely is a limit but online the highest I have seen is 29000.  Someone prob has slightly more or less.

At the moment, I have 20000+ as the top prize and that seems good.

Thank you for that. Seems to confirm to me that 20000 is a good high score.
Title: Re: Mini-game Fixes
Post by: Ansem on 2013-02-27 20:40:07
Fair enough. Glad to be of help. :)
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-02-28 05:15:13
Although this one is tool assisted >

http://www.youtube.com/watch?v=YIYzKCi-bC4

So perhaps 29000 is either exactly the top score or very near it.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-01 11:30:27
Seems that there was meant to be another wonder catch minigame in the second room of Wonder Square. When you first get there an NPC is blocking it, but later in the game he is not there.  Even though he is not there anymore, it doesn't matter because any programming that was there in script is gone.

Probably very easy to put something back but for now I don't think I will bother.

I have updated the prize for Snowboard so that if you get 100 on every course you get top prize of 500GP.  I may try to update this so that it also gives out prize for brilliant times in speed attack.  But for now I am happy with this.

I have updated submarine so that each level gives out increasing GP and prize. Of course... the new minigame is also much harder for each level with the new updates I have made.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-26 20:16:12
I may need NFITC1's help to finish the Submarine minigame.  The AI of the enemy is a little weird to understand....  everything else is done.  I'd appreciate someone looking into what I have found here anyway because it makes no sense to me and someone with more insight into assembly would answer a few questions. I will get back to this soon.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-27 01:40:08
Submarine mini game.  The following addresses are memory.

009884F8
First table.  Seems to be main initialisation data of player submarine (initial position etc). I fixed this up to the International standard by copying the table from the PSX International game.

Some Questions.

1. Why does the game take these values from the exe at run time when it doesn't need to.  It is already  in memory. If you edit memory, it is simply replaced from the exe itself. In other words, it is replacing the SAME data.  Is it possible to disable this behaviour so that we can edit memory to reflect changes at runtime  rather than have to edit the exe?

2.  Why are there almost identical tables to this one further down, like the one starting at 0098B6E8?   What is this for?  I assumed each table was for the different game levels, but if this is so, why doesn't  changing the exe for them do anything?  (at least that I saw).    Is it the case that they were designing  5 unique difficulty levels and then just gave up?

3.  The tables (or at least parts of them?) are copied when  the sub game starts to yet another area (area  changes).  The area being the temp data area/ vars around 00125000)  Why isn't it just reading the  values from where they are originally in memory (009884F8 for example)?

4. The byte value A0 8C in the tables (and other hard coded places like 00780DB6) is the time limit (10  minutes, 36000/60/60).  This time value, and other values, are not reflected when they are changed.   Instead, all levels share the value at 00980DD0, which can be edited at run time.  So there are multiple  A0 8C values that appear completely redundant.

5. There is hard coded data related to the enemy subs starting at 00780E4A.  The value here is Sub 1  (of maximum 12) energy (4000). The following entries are related to Sub 1.  Sub 2 starts at 00780EBC  for example.  Each level has 12 hard coded subs (so total is 60 records for the 5 difficulty levels).  Whether a sub will appear or  not in any given level is dependent on whether its flag is set to 1.  I forget which this is now but it is  easy to find again.  probably the entry like at 00780E8C.  Some of these values affect the enemy sub's  starting point and possibly speed.  However, when I documented these entries a while ago (which I have  now lost), the actual sub's movement pattern remained a mystery.  Where is it coming from?  How  does the AI work for each sub in each level?

6. It seems that some of  this data is not used at all and again.. data is duplicated.  Why is there 2  identical sets of data, 1 hard coded and 1 tabled? For example, look at the main table 009884F8 and  then compare to 00780DB6.  What the fuck is going on???

7. The data above the main tables has a format like

Code: [Select]
37 37 37 37 37 37 37 37 37 37 37 37 34 30 30 34
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
34  34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
34 34  34 34 34 34 34 34 34 34 34 34 34 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30

I remember this being the actual level design itself?

 :o :o :o :o I need help.  I am going insane in that exe. :o :o :o :o
Title: Re: Mini-game Fixes
Post by: nfitc1 on 2013-03-27 04:27:07
Some Answers (or at least educated guesses):

Quote
1. Why does the game take these values from the exe at run time when it doesn't need to.  It is already  in memory. If you edit memory, it is simply replaced from the exe itself. In other words, it is replacing the SAME data.  Is it possible to disable this behaviour so that we can edit memory to reflect changes at runtime  rather than have to edit the exe?

Probably sanity checks. I'll explain this later on.

Quote
2.  Why are there almost identical tables to this one further down, like the one starting at 0098B6E8?   What is this for?  I assumed each table was for the different game levels, but if this is so, why doesn't  changing the exe for them do anything?  (at least that I saw).    Is it the case that they were designing  5 unique difficulty levels and then just gave up?

These are maps. There are TWO submarine mini-games in this game, the one the game forces you to play, then the one at Gold Saucer. They are both treated as different games although there is lots of duplicate and shared code. This is probably why the sanity checks exist. You can retry the Gold Saucer one, but not the one that's forced on you. The multiple memory replacements mentioned above probably exist to ensure that a retried game resets the data to the starting point.

Quote
3.  The tables (or at least parts of them?) are copied when  the sub game starts to yet another area (area  changes).  The area being the temp data area/ vars around 00125000)  Why isn't it just reading the  values from where they are originally in memory (009884F8 for example)?

Because anything less than 0x401000 is considered mutable. Every processor handles this differently, but it's essentially processor level cache that can be read and modified more cheaply than going out to RAM. It wouldn't be an issue with more modern hardware, but when it came out every tick counted.

Quote
4. The byte value A0 8C in the tables (and other hard coded places like 00780DB6) is the time limit (10  minutes, 36000/60/60).  This time value, and other values, are not reflected when they are changed.   Instead, all levels share the value at 00980DD0, which can be edited at run time.  So there are multiple  A0 8C values that appear completely redundant.

Not surprising. This kinda goes back to the sanity check thing.

Quote
5. There is hard coded data related to the enemy subs starting at 00780E4A.  The value here is Sub 1  (of maximum 12) energy (4000). The following entries are related to Sub 1.  Sub 2 starts at 00780EBC  for example.  Each level has 12 hard coded subs (so total is 60 records for the 5 difficulty levels).  Whether a sub will appear or  not in any given level is dependent on whether its flag is set to 1.  I forget which this is now but it is  easy to find again.  probably the entry like at 00780E8C.  Some of these values affect the enemy sub's  starting point and possibly speed.  However, when I documented these entries a while ago (which I have  now lost), the actual sub's movement pattern remained a mystery.  Where is it coming from?  How  does the AI work for each sub in each level?

It's possible it's getting set in 0x79CF47. Can't confirm that though, but it does have something to do with the sub game. I would imagine it as a bounded random motion until it detects the player's sub and begins attacking.

Quote
6. It seems that some of  this data is not used at all and again.. data is duplicated.  Why is there 2  identical sets of data, 1 hard coded and 1 tabled? For example, look at the main table 009884F8 and  then compare to 00780DB6.  What the f*ck is going on???

Sanity check.*

Quote
7. The data above the main tables has a format like

Code: [Select]
37 37 37 37 37 37 37 37 37 37 37 37 34 30 30 34
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
34  34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
34 34  34 34 34 34 34 34 34 34 34 34 34 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30

I remember this being the actual level design itself?

Yep. Those are altitudes of the terrain in ASCII format (30 = "0", 31 = "1", etc). Don't ask me why they chose that instead of straight byte numerics. They could have even compressed it further by grouping it in triplet bits since none of the values goes higher than "7". You remember this, right? (http://forums.qhimm.com/index.php?topic=13773.0)

Now, as for sanity checks. Remember there are multiple people writing code for this game. The mini-game developers were a team, but they didn't always communicate everything. That's why some values are hard-coded in static memory and some are coded in the executable commands. Someone probably created modular instances after they were all hard-coded in another usage. Rather than convert the hard-coded instances to modular, they were just left there (probably because it would take too long to convert). That will make it slightly hard to track and sync with each instance, just know that there are two places to modify things like this.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-27 04:35:51
Thanks for that, it's at least a little clearer now...

The Gold Saucer gives the option for Mako reactor battle.  If I edit this game, can I assume the actual in game version will be changed also?  Or is it completely separate?

The tables I mentioned and other data... is  lot of that completely unused in game?  Redundant due to this Sanity Check?

If so, how can I know what is and is not used, and is it possible to make it simpler by just zeroing all the none used data?
Title: Re: Mini-game Fixes
Post by: nfitc1 on 2013-03-27 11:34:09
Quote
Thanks for that, it's at least a little clearer now..

Good. I'm not sure I understand it all. ???

Quote
The Gold Saucer gives the option for Mako reactor battle.  If I edit this game, can I assume the actual in game version will be changed also?  Or is it completely separate?

Very likely not. There are at least two copies of all the maps for this game. One set is for the forced game to randomly select from and the other set is the Gold Saucer maps. It shouldn't be too hard to tell which one is which.

Quote
The tables I mentioned and other data... is  lot of that completely unused in game?  Redundant due to this Sanity Check?

I wouldn't say completely unused. There are three possibilities. One is that both games load them all in which case only the second load is important. Another is that one of them loads both while the other only loads one. And finally, it's possible that they both are separate and only one gets loaded per game. Given what you've already said I'd say it's likely the second option. The shared code should stay.

Quote
If so, how can I know what is and is not used, and is it possible to make it simpler by just zeroing all the none used data?

Yup. This looks like a job for trial and error. Good old fashioned brute force attack. A "good" way to start IMO would be to figure out which maps go with what loading routines and five them different identifiable patterns ( like a big letter "A" in one, "B" in another, etc). Since they are ASCII values they are easy to modify.
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-27 18:04:58
I think it is loading them twice you know... All data twice... if that is the case and only second set of data matters I suppose I can ignore whatever comes first.  I will do some proper tests soon on this.  It does seem that the code in there could be 10x simpler....  If I were making this game there is no way there would be 2 sets of data, or maps... if the data is there then it should be simple to use it without dupes.

I will see what happens.  I am sure I zeroed all that map data before... and nothing changed.  If that is so it means the maps are hardcoded elsewhere as well.  I will test all this out...  get to the bottom of it.

If you could, and have the time, see if you can find out how the AI works.  I mean I understand some of those values I sent deal with its start location, whether it is displayed, its type (blue,yellow, red) and what not, but I was never able to find what controls the enemy submarines movement pattern around the map.  They all move differently, at different speeds...
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-28 01:09:33
The level map tables are used.  The game does use both sets of data separately for Mako battle and Gold Saucer Mako battle).  The main table at 9884F8 is used but all the identical type tables afterwards seem to have absolutely no use at all at the Gold Saucer.  haven't checked main game one yet but I am betting the only one that is used is 9884F8.  I am beginning to wonder whether this minigame was once to have unique level difficulties including different times etc... but that it was cut.  I mean... all 5 levels are the same except for submarine numbers and map type.  Something went really wrong with this game... very likely time ran out. 9884F8 sets the time, and ally sub data (starting position, health etc). It is my belief that each level was supposed to change all these values... that all 5 tables were once used (1 for each level) but now only the first is. 

Enemy sub data starts at 00783574 for first sub gold saucer mako battle version.  I am looking at what the values mean.  So far:

All values below are hex.

1. Health (1770) [Ally sub default damage is 200 a missile if I remember]
2. Unknown (0)
3. Unknown (0)
4. Angle of the submarine graphic. (0) 
5. Unknown (12C)  Related to movement of Sub. When set to 0 and record9 is set to 57, sub seems to continually move about with speed set at record6.  There are a lot of variables involved here, so the exact relationship is hard for me to get.

6. Speed of Sub (36B0) [Although after a certain amount of time, some subs have a secondary speed...weird).
7. Draw Sub flag 0 and 1 (if set to 0, sub will not appear)
8. Type (0=Yellow, 1=Blue, 2=Big Red, 3=Red)
9. Unknown (0) if set to incorrect value, game will crash.  Seems to be related to movement pattern of Sub.
This value may actually be an identifier for the AI itself. A value of 57 seems to be an example of a pattern that does not end, but loops.  The sub just roams about in a circle after moving to a certain point first.

10. Unknown (FFFFFFE4)
11.Unknown (0000000A)
12.Unknown  (FFFFFFF1)

Subs either seem to follow a pattern that never ends, or follow a pattern that ends with a. sub banking near end of map and staying there b. Sub changing to a new speed and roaming about the area.  I think AI patterns have 2 types, those that end, and those that loop.  It seems certain patterns work for a limited time and then the sub changes speed and behaviour. 
Title: Re: Mini-game Fixes
Post by: nfitc1 on 2013-03-28 17:46:46
What little I've seen so far (there's too much to comprehensively understand ???):

Subs have several things going for them. There's a xyz-coordinate set for position, rotation, direction, "up", and "right". I'm not sure what "right" means or what it has to do with anything.

Position is obvious.
Rotation is where the sub is pointing.
Direction is the vector along which it is traveling.
"Up" seems to point in the positive y direction initially and I'd guess this is the camera's "up" orientation. It changes from time to time, but not much.
"Right" is similar to "Up" in that it shows which direction the camera should consider to be the extreme right.

I can't tell for certain, but direction (at least for one sub) gets changed at 0x799969 based on rotation. The rotations are stored as magnitudes of 1/4096 of a complete circle.

Dir.x = cos( rot.x ) * sin( rot.y )
Dir.y = -sin( rot.x )
Dir.z = cos( rot.x ) * cos( rot.y )

It doesn't care about the rotation of z so I might be misinterpreting it's function.

It just gets more confusing from there. There are a lot of functions involved
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2013-03-28 23:42:25
where can initial position of enemy sub be set?
Title: Re: Mini-game Fixes
Post by: DLPB_ on 2014-10-21 22:08:30
Here's an example....  This may be the sanity thing you mentioned ages ago.  But anyway>

The time limit for submarine is set 2 times [Both code areas are used on every level at Gold Saucer and in story version)

at

Code: [Select]
0077F7B2 (table) and again from table at 0077DAB6 (hardcode)
In this case, the table version is the one that is reflected in game.
In other areas, like the enemy submarines energy, it's the hardcode that takes precedence.

I have no idea what is what tbh. I don't think it's a very realistic task to figure out which parts are actually being used.   Or perhaps

they all are in different places at different times.

 ================

The actual map used and some starting values for each mode (0 is the story version)  is here:
77F131 (which originates at 77DA14)

Code: [Select]
0 [77F156] Story version
Map: 00996F10 (Map 7)
Data 1: 00988CF8
Data 2: 00997F6C

1 [77F191] Mako Battle at Gold Saucer
Map: 00994708 (Map 6)
Data 1: 00988CF8
Data 2: 00995764

2 [77F1CC] Level 1 at Gold Saucer
Map: 00991F00 (Map 5)
Data 1: 00988CF8
Data 2: 00992F5C

3 [77F207] Level 2 at Gold Saucer
Map: 0098F6F8 (Map 4)
Data 1: 00988CF8
Data 2: 00990754

4 [77F23F] Level 3 at Gold Saucer
Map: 0098CEF0 (Map 3)
Data 1: 00988CF8
Data 2: 0098DF4C

5 [77F277] Level 4 at Gold Saucer@
Map: 0098A6E8 (Map 2)
Data 1: 00988CF8
Data 2: 0098B744

Multiple maps at 981000 (unused?)

Notice straight after the maps above is a table
like the one at 997F18
It generally starts with a time value (which is never used to decide the time).
These tables are the enemy submarine data (as far as I can see) in table form.
However, this data is duplicated as hard-code.

I haven't checked yet, but I bet zeroing these tables does nothing to the game.

My only theory is that once upon a time.. there were gonna be 6 unique levels
each with their own time limit. But I can't be sure what is going on really.

========================

What I am doing at the moment is hijacking the code at
Code: [Select]
77DA14 (mov ax,[00E74760])
Which pulls the current submarine mode (0-5).

With this I can then set my own default values, like time limit (for each level) by forcing my own value over the one that is used (in this case of time limit, the address 980DD0).
The only time limit value used across ALL games is at 980DD0, which is set at 77DAB0.

But given multiple tables exist, is there any way to set the time and some other values from those instead?  The real question is...  Are the tables (apart from 9884F8) at the following addresses redundant in favour of their hard-coded counterparts?

Code: [Select]
997F18
995710
992F08
990700
9884F8 (actual used time limit value is taken from this table)
98DEF8
98B6F0
987018 (strangely, time limit value here differs from 8CA0).

Other instances of time limit (8CA0) [i..e, hard-coded versions of above tables]
at:
Code: [Select]
77F7B2 (hard-code)
77FC5E (hard-code)  [Corresponds to 987018]
780DB6 (hard-code)
78346E (hard-code)
785B26 (hard-code)
787698 (hard-code) and 7876D4 (hard-code) [Prob corresponds to  990700 and 990718]
788B56 (hard-code)
78A458 (hard-code)




Title: Re: Mini-game Fixes
Post by: DLPB_ on 2015-02-13 23:49:29
I have fixed up the Submarine battle half and half.  Now that R02 is completed, and retranslation completed, I can turn my attention to fixing up my difficulty mod.

I am still debating whether to scrap Cait Sith project.  Although, I'd dearly love to stick it to the fanboys.

In meantime, this is what I just wrote to luksy:
Quote
[00:42:38] Daniel Burke: the sub reprogramming has been far the biggest headache
[00:43:00] Daniel Burke: it's a total mess because a massive amount of it is unused
[00:43:07] Daniel Burke: entire tables unused
[00:43:13] Daniel Burke: tables dupllicated 3 times
[00:43:17] Daniel Burke: maps not used
[00:43:23] Daniel Burke: it's unbelievabl really
[00:44:31] Daniel Burke: in fact every enemy sub (12 * 6) has had its table duplicated by hardcode.  The hard code overrides the table version in most parts.
[00:44:32] Daniel Burke: Not all.
[00:44:57] Daniel Burke: The tables are copied, then copied again, then overwritten by hardcode making them totally redundant
[00:45:47] Daniel Burke: it's quite obvious that there was originally going to be 5 unique difficulties each with own time limits... but time ran out, so it all got scrapped, but it's all still in there... and a last minute fix was done to make the game at least playable
[00:46:29] Daniel Burke: the enemy subs don't even have AI... they have some crazy functions that they can use to decide what pattern to adopt
[00:46:46] Daniel Burke: a lot of those aren't complete either, so the enemy subs then just default to the screen edge and wait to die
[00:47:50] Daniel Burke: the enemy subs also fire 2 shots by default, but no delay has been included so both missiles are let off at same time and follow the exact same route