[WIP] Custom Game Settings (FF7)

  • Thread starter Thread starter Wutai Clan
  • Start date Start date
Status
Not open for further replies.
I'm not certain that will work. When an enemy is defeated, it just adds its rewards to the overall battle rewards totals. After the battle ends it spreads those points between the active members in the battle party. There are no parameters involved. I can tell you what memory addresses those values reside at, but they're not fully populated until the battle is over.
Should be fine, it doesn't matter what the game does now, that's the point of this project, to make the game do what I want, when I want. :P

It doesn't matter if there are no parameters, I can patch individual instructions within the .exe..

ie, mov GIL, BattleReward

Can be changed to something like.

mov eax, BattleReward
imul eax, 2
mov GIL, eax
 
Sadly I can't help about all this technical stuff, but I have some other ideas, if you need them. Luckily, one day, some of those will be doable.

- making it so the Back Row modifiers are only applied when at least one party member is in the front row (doesn't make much sense that all allies can get access to the back row ; logic tells me that if nothing is in the front row, the back row becomes the front row... ...if logic can be applied to this row system, that is :P)

- expand the magic spell lists... ...I bet this one would be particularly tricky, since you'd have to expand the menus, too

- make weaknesses to status effects display when you use Sense

- remove the less than 30,000 HP requirement for Sense to work (or make this number much higher)

- make the Defend command also halve damage from Magic and Fixed damage, to increase its usefulness

- make it so that you can cast a single magic when you're equipped with the W-Magic materia. I find it annoying when I want to cast only one spell, and the game forces me to cast two (waste of MP). This downside to W-Magic makes no sense

- remove the W-Item glitch, of course :P

- make the Darkness/Blind status effect work on enemies (this one might be easier through AI editing, though)

- make the Defence and Magic Defence work differently. Since currently they work as a % reduction of damage received (512 being a 100% reduction and 256 being a 50% one), a bonus of 1 or 2 points in Def/MDef is negligible. In some RPGs, when you go from 50 points of Defence to 51 or 52, damage is sometimes reduced from 1000 to 500 or even 200. I love that. It would require a complete overhaul of the characters' and monsters' stats, but it would ultimately make the stats more important and thus, the game more interesting

- make the game consider materias as items, so they can be stolen / dropped / morphed from enemies. I'd love to be able to use the Hojo tool (or the yet-to-be-released Proud Clod that will render Hojo useless) to make a materia a battle reward.

...Mmm, maybe I should create another topic that would list all those ideas/requests, instead of posting them in your thread.
 
Last edited:
That 0x9055A0 (argh... address that's been burned into my memory...) is a base for all Script Op handlers. When a game gets an Opcode, it calculates the offset where a pointer to that function is stored (in a fashion: 0x9055A0 + Opcode << 2), and just calls it.

To find other stuff - get a debugger that helps you find references to a static memory address - it will save you a lot of time. For example, Exp is stored for each character, but if you search for a function that modifies it, you'll see something like 0xDB0000 + x * 0x84 - only Cloud's Exp is referenced, because Barret's can be calculated as an address that is 0x84 bytes higher than Cloud's Exp. If you then search for that specific const, you'll get EVERY SINGLE point in ff7.exe where it's accessed. Leave out all the reading accessors, and you'll end up with a short list of points where it's actually being written to.

Also, most global structures are referenced like that (so with the above method you can check all the subfields for writing). There are usually some unique values connected to each meaningful record, so debugging is really easy - even if the record is passed as a reference, it's structure remains intact (of course), and if the subfield was named szCharacterName, you'll get to know it as 0x234 and a single reference search for that const will get you a list of addresses where it's being accessed. Sometimes it's a mixed mode (so a subfield is referenced by global address and by subaddress somewhere else, but there aren't many cases like that).

Also, it helps how the FF7 was actually built - with absolute minimum optimization.
 
Do anyone think that the "No Screen Reward Display" is in the exe or something else? This code is used in the flashback.
 
- remove the less than 30,000 HP requirement for Sense to work (or make this number much higher)
Found it !  :D
The HP requirement for Sense is at offset 0x1C9515. Easy to find in a hex-editor and with proper testing. I just searched for 75 30 (= 30000 ; and I know the bytes are reversed in a hex editor).

Proof in picture :)

sensep.th.jpg
 
You rock! At which amount did you set it?

Edit : Given what you gave us, I assume it's 65 535. Higher of course, but not enough for Gjoerulv's mod :( Is it possible to extent it to some other unusued byte or even make it 4 294 967 295 (FF FF FF FF) which is more than any enemy, even in the hard mod.
 
Last edited:
A'ight. Here goes:

Battle Exp: 0x99E2C0
Battle AP: 0x99E2C4
Battle Gil: 0x99E2C8

Seems they get manipulated mainly in 0x430DD0 (which is the huge "end battle and dole out rewards" sub) and initialized in 0x5C6F9C. They get added per enemy too. You can give them an initial value before that point, but you can't manipulate the actual "earned" value until later.

Battle gil gets awarded in 0x6C6B30. You'll need to manipulate that value before that.
AP gets awarded in 0x5CAD70 that takes two arguments: (Character index [0-8], AP to award as unsigned WORD) (passed AP can not exceed 65535 here).
I can't quite nail down where exp gets applied. All I can find is the function that applies Level Up bonuses (0x5C7260 if you're wondering). That takes DWORD CharSaveMapOffset, DWORD Exp Gained, and DWORD Formation index in that order.


- making it so the Back Row modifiers are only applied when at least one party member is in the front row (doesn't make much sense that all allies can get access to the back row ; logic tells me that if nothing is in the front row, the back row becomes the front row... ...if logic can be applied to this row system, that is :P)

Possible? Haven't found this, but worth looking into.

- expand the magic spell lists... ...I bet this one would be particularly tricky, since you'd have to expand the menus, too

I'm not even going to try this. This will take graphical editing, actually, which I'm trying to stay away from.

- make weaknesses to status effects display when you use Sense

Would require a new battle text. I don't see why this couldn't be possible, except it would take a LONG time to list them all for some enemies.

- remove the less than 30,000 HP requirement for Sense to work (or make this number much higher)

Could solve this and the previous point at the same time, probably. Still wouldn't go above 65535 I bet

- make the Defend command also halve damage from Magic and Fixed damage, to increase its usefulness

Defend sets a flag that gets handled during physical-type attacks. You'd have to account for this in other damage types too, but I think the modifier's a function call anyway. Might not be enough room to do this, but it's possible to optimize a few extra bytes out of some of them.

- make it so that you can cast a single magic when you're equipped with the W-Magic materia. I find it annoying when I want to cast only one spell, and the game forces me to cast two (waste of MP). This downside to W-Magic makes no sense

Then don't equip W-Magic. :)

- remove the W-Item glitch, of course :P

I've been wanting to do this for a while, actually. I'd have to see how it's working now before I could tell you how to fix it. I don't know where commands are actually handled though.

- make the Darkness/Blind status effect work on enemies (this one might be easier through AI editing, though)

Does it not work for enemies? I've never tried it.

- make the Defence and Magic Defence work differently. Since currently they work as a % reduction of damage received (512 being a 100% reduction and 256 being a 50% one), a bonus of 1 or 2 points in Def/MDef is negligible. In some RPGs, when you go from 50 points of Defence to 51 or 52, damage is sometimes reduced from 1000 to 500 or even 200. I love that. It would require a complete overhaul of the characters' and monsters' stats, but it would ultimately make the stats more important and thus, the game more interesting

Never have found the attack modifiers so I couldn't tell you if this were possible. Maybe, but I'm not inclined to want it done.

- make the game consider materias as items, so they can be stolen / dropped / morphed from enemies. I'd love to be able to use the Hojo tool (or the yet-to-be-released Proud Clod that will render Hojo useless) to make a materia a battle reward.

Would require too much of a re-write.
Do anyone think that the "No Screen Reward Display" is in the exe or something else? This code is used in the flashback.
It's a battle flag set at the beginning of those battles. There are a few battles with that flag set, but not many.
 
I am afraid the maximum will probably be just 32767.  Unless someone changes code to allow more.  It is signed.
 
Thanks :)

I set it at FFFFFF : 16,777,215
The problem though, is that the Sense menu can't display more than 65535. So on the enemy I tested it on, which has 330,000 HP, the Sense menu will say that it has 2325 HP. And when you'll remove those 2325 HP from it, the menu will then display oddities like 65000/2325 HP. As if the enemy had 5 HP bars of 65535 HP each, and a 6th HP gauge of 2325 HP.

EDIT:

Thanks for posting a comment after each of those ideas, NFITC1. Though, with all due respect, your comment about W-Magic was pretty stupid :P
 
Last edited:
Armorvil sense'd an enemy with 60,000 HP (Proud Clod), so it's 65 535.

DLPB, with Menu Reconstruction, should be able to make it work. But hex-editing is a lot of work.

At the beginning of battles huh? Well, I ask this because I want my characters to gain/not gain Exp/AP/Gils in some battles.
 
@dziugo, alright, I'll check it out, I have IDA\MHS, and between the two, I can usually find anything I need, it just takes time, and diverts me from working on other stuff I need to do. (Like learning these last few hacking techs, and working on my code itself, building a nice friendly API for editing the game. It's taking forever just to fill out the struct that represents character data. I still have to make other structs for other known data too, etc,. Lot's of work.)

@Armorvil, that address you listed for Sense, I can't find it, not sure how that value relates to the disassembled code, I've seen 30,000 called in several places, RestoreHPMP, uses that same amount for fully restoring your characters, etc,. (I'll keep an eye out for it, but, if you can find it in memory, that would be good.)

@Vgr255, not sure what you mean by the no screen reward, like, after battle when it skips rewarding you?
 
Last edited:
@Armorvil, that address you listed for Sense, I can't find it, not sure how that value relates to the disassembled code, I've seen 30,000 called in several places, RestoreHPMP, uses that same amount for fully restoring your characters, etc,. (I'll keep an eye out for it, but, if you can find it in memory, that would be good.)
Unfortunately, my knowledge in programming is very, very limited (inexistent ? Perhaps). I want to learn but don't know where to start... ...So I can't tell you where to find it in memory. I just opened FF7.exe in my hex editor, searched for the bytes 30 75, replaced each of the found strings by FF FF, and tested the game until Sense worked on an enemy with 60,000 HP. This is how I found the address 0x1C9515.

I might also find other functions that call a specific value, but I have no idea what I could search for next.

EDIT:

- make the Darkness/Blind status effect work on enemies (this one might be easier through AI editing, though)
Does it not work for enemies? I've never tried it.
Yeah, it's one of the many FFVII bugs : the Ink item doesn't do a thing. Credit goes to Vgr255 for giving me the info (and I thought I knew everything about FF7). He also informed me about the Elixir bug, which I easily fixed with Wall Market (since the Elixir's formula is physical, a character equipped with the Cover materia would sometimes jump in front of the character you'd want Elixir'd, and drink it :o ).
 
Last edited:
Unfortunately, my knowledge in programming is very, very limited (inexistent ? Perhaps). I want to learn but don't know where to start... ...So I can't tell you where to find it in memory. I just opened FF7.exe in my hex editor, searched for the bytes 30 75, replaced each of the found strings by FF FF, and tested the game until Sense worked on an enemy with 60,000 HP. This is how I found the address 0x1C9515.

Also, I might also find other functions that call a specific value, but I have no idea what I could search for next.
You don't need to program to find the values in memory, get Cheat Engine\MHS(Memory Hacking Software)..

You can find countless tutorials, both written\video on the internet, try YouTube, look for Cheat Engine tutorials, MHS works roughly the same as CE, but it's a bit more advanced, I prefer it, but that's just my preference.

In any case, searching memory is easy, it's just a process of elimination, say you search for your chars HP, all you have to do, is increase\decrease the HP, then do a sub search for the new value, keep repeating this process until you find the value in memory that controls the chars HP. (It eliminates any non-matching values as you go.)

--

Btw, haven't used CE in some time, but MHS shows pointers in green text, that's what I need, pointers, those exist in the .exe, the other values are usually temp variables\DMA, and won't always be the same. (Pointers are always going to be same for everyone.)

---

Aside from values I already mentioned, I'm interested in the following.

1. Inside the buggy. (I want to remove random battles inside the vehicle, it's annoying to me. Other vehicles would be nice too, airships, etc,. I just want to know when I'm inside a vehicle\walking, that might help me track down a few other things too. Like functions to spawn the vehicles, etc,.)

2. GP for the Gold Saucer. (I may make a cheat(inf\max GP), but I might also remove the GP restriction on that save spot, which also annoys me.)

3. Any unknown battle vars, like, when you hit someone, and you see the little damage floater, getting that value, should allow me to find the damage formulas. (So anything like that, poison values, etc,.)

4. Anything else you think might make a good addition, or be useful in finding related stuff. (Like, how GP will help me find that GP save spot.)

(Remember, everything will be optional, with all cheats disabled by default.)

--

@NFITC1, seems like this where they all get calculated. -> [0x0043153F]

If you right click a variable in IDA, you can select "Jump to xref to operand" which will display a list of places the value get's used, then just look at functions with a "w" next to them, those are writes, "r" are reads.

These values only get written in two places, one sets them to 0, the other has to be the code we are looking for. (Unless it uses temps, and does it elsewhere, but it's probably done there.)

Anyways, thanks for finding those vars, I'll start playing around with patching the values, see if it works. (ie, actually gives the correct values, and hopefully shows up properly in the reward screen. EDIT: A quick test seemed to work exactly as I had hoped, it worked properly with the reward screen, etc,.)

(I also need to go through, and make sure the INI options won't go outside of their range, ie, if a value is 0-255, I'll just make it wrap any values outside the range, to the nearest valid value. ie, using the previous example, 300, would be clamped to 255.. I can probably add comments too, that indicate valid ranges, though, I'm not sure the .ini lib I'm using will allow me to use them, it's not well documented.)
 
Last edited:
Thanks for posting a comment after each of those ideas, NFITC1. Though, with all due respect, your comment about W-Magic was pretty stupid :P
No it wasn't. YOU'RE stupid. :P
Seriously though, W-Magic materia could be changed to just add W-Magic instead of replace it. That would be best changed in the KERNEL. Biggest problem with that is that it would displace some other command. There's only room for 12 commands, you couldn't have a Master Command, E.Skill, Magic, Summon AND W-Magic. There'd be no where for the W-Magic to go. Same thing with all the Attack replacing commands. If you want to expand that you'd have to expand the command menu (which I'm not going to touch). Although, expanding it to 16 commands could solve some other problems too like W-Item and the "Replace Attack" commands.
Otherwise, how do you suspect it would work? From a series standpoint, W-Magic has always forced the player to perform two magics per turn.

Yeah, it's one of the many FFVII bugs : the Ink item doesn't do a thing. Credit goes to Vgr255 for giving me the info (and I thought I knew everything about FF7). He also informed me about the Elixir bug, which I easily fixed with Wall Market (since the Elixir's formula is physical, a character equipped with the Cover materia would sometimes jump in front of the character you'd want Elixir'd, and drink it :o ).
O_o Really?! I never tried that either. That's awesome!! :D

Barret: Need.....elixir *pulls one out and throws upward for himself*

Cloud: Oh no you Di'int! *steals Elixir*

XD
 
I got the battle reward multipliers fully implemented, including the .ini options, thanks for the help NFITC1. :)

(I updated the first page with the new features\options, second post as always.)

--

Btw, can I fix the Elixir bug from my end, or is it better handled elsewhere? (I have no problem patching code to fix issues, so if there are any longstanding bugs that can be fixed via .exe hacking, let me know.)

---

Edit: Test release time..

See: Page 4 for an updated release..

Place both files in your FF7 directory, add the line to Aali's config..(Or use multi-loader)

load_library = GameSettings.dll

Don't forget to configure the .ini file..

Hopefully this works for everyone, let me know if those battle reward calculations seem right to you, I think they seemed kinda large at 2x, but I'm not sure yet.

You will need to install the VC++ runtime 2010 x86, google it, should pop right up. (You can check your installed programs list in the control panel, it will tell you if you need to install this, or if it's already installed.)

Note: This may not work properly with a modified .exe file, so you may want to use an unmodified version for testing.
 
Last edited:
So what we saying now, that we can limit the sense to 65535?  I will look into this later and see what I can see.  Which won't be much . ha.
 
For Sense, I would need both the current HP and max HP, and I can probably get it implemented. (Pointers to the values.)
 
Last edited:
I am looking now at the code.  In memory it is at :
5ca10f

It doesnt look too complicated to change.  Someone should be able to no probs.  Ill see what ive learned :)
 
Last edited:
I am looking now at the code.  In memory it is at :
5ca10f

It doesnt look too complicated to change.  Someone should be able to no probs.  Ill see what ive learned :)
Alright, I'll see what I can do, looks simple to change, so long as that's the only value that's causing issues. (All I have to do is replace that call with a jmp, patch the value, and return the execution to the next command.)

Code: [Select]
Code:
__asm{    cmp dword ptr ds:[0x009AB10C][ecx], FFFFh    jmp [0x005CA119]}
 
Last edited:
it does seem to do a compare though to

9ab2ac  What is it doing there?
 
Status
Not open for further replies.
Back
Top