Mini-game Fixes

  • Thread starter Thread starter DLPB_
  • Start date Start date
Status
Not open for further replies.
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.
 
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]
Code:
Time Limit and beginning of main initial data table.586ef83 Bytes [possibly 4, but anything greater than 59 min 59 sec requires further modding]Sub Speed multiplier [set to 40 (4x) for PSX international]586f40Health [default is 40h (64)When changing this the health bar graphic code below also needs altering]586f34
The following are memory addresses:
Code: [Select]
Code:
Health bar graphic 07925BB memoryunknown table009a85e4Main Function0079857bacceleration bar forward speed007985b5acceleration bar backward speed007985ccunknown acceleration bar forward speed action0079863aunknown acceleration bar backward speed action00798657descend graphic speed00798729ascend graphic speed00798743 Speed rotate 3d right0079875dSpeed rotate 3d left00798777descend speed0079882eascend speed0079884fdescend graphic catch up speed00798964ascend graphic catch up speed0079897eGraphic catch up rotation speed right00798a11Graphic catch up rotation speed left00798a2aGraphic speed rotate right0079875dGraphic speed rotate left00798777Area speed rotate right00798870Area speed rotate left0079889100798921Ascend/Descend delay (and other cmp values below).007989cbRotation delay (and other cmp values below).Unknown rotate right action00798a89Unknown rotate left action00798aa3Initial movement on descend00798b3c0798b64Initial movement on ascend00798b5300798b73Initial movement on rotate right0798b89007989200798bc4Initial movement on rotate left00798baa00798bb300798bd3unknown rotate right action00798be2unknown rotate left action00798bf1
Other memory addresses
Code: [Select]
Code:
Temporary address for energy (change reflected in real time)00987348Mine damage00799606Missile strength (both enemy and ally)0079D28f
 
Last edited:
You can turn wireframe view on with F2.  Did anyone else know that?  Making the wireframe green like International will probably be a doddle.
 
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]
Code:
Breakdown of Submarine ScorerStarting 007932f9mov eax,[ebp-0C] : Move Current points from non destroyed submarines to eaxadd eax,[edx+10]: Add points from Non Destroyed Submarines. This will loop untilall submarines have been added to ebp-0c.  When this is done, the loop willterminate and move on tomov edx,[00E981CC]: Move value into edx.  This value is the total points of allsubmarines active or destroyed. It is therefore the total points of all thesubmarines 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 betteryour score.  If you destroy no submarines, edx will now be 0.mov [ebp-04],edxmov 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 yourenergy intact 16384 points will be added. This also means that even if youdo nothing in  the minigame you will gain 16384 points.mov [ebp-04],eaxmov ecx,[ebp-04]:  Move eax to ecxadd ecx,[00E74770]: Move value of the time you had left.This value is seconds*60.  For example, if you finished the minigamewith 5 minutes remaining,  you would gain 18000 points (5*60*60).  mov [ebp-04],ecx : Move ecx to ebp-04mov 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 missedwhen locked on, you lose 100  points.mov eax,[ebp-04]: Move the current points you havebefore 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]
Code:
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 edited:
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.
 
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 :)
 
Great job, DLPB!

Looking forward to the release of this new minigame fix!  ;)
 
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?
 
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.
 
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.
 
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?
 
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
 
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]
Code:
Score= (Enemy_subs_destroyed*1000) - (Energy_lost/4) - Missiles_missed
Example:

Code: [Select]
Code:
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.
 
Last edited:
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.

new%20times.PNG
 
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!
 
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 )
 
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.
 
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
 
Status
Not open for further replies.
Back
Top