Author Topic: [FFVII STEAM] Possible to disable exp. for out of party characters?  (Read 10509 times)

CoolMitten

  • *
  • Posts: 20
    • View Profile
Hello everyone! This is my first post. I searched qhimm several times to answer my question, but I didn't find anything relevant.

Characters outside of your party will gain experience at half of the rate of those who are in your party (i.e. actively fighting). I'm looking for a way to disable this, or at least change the multiplier to zero, so nobody gains experience outside of battle. I'm currently going back and forth with closing the game and opening Black Chocobo to edit my stats and nullify the 50% exp. share, but it is becoming more and more tedious. If it hasn't been done yet, might there be a direction in which to go, so that I could manually create this myself? Thank you!

JWP

  • *
  • Posts: 194
    • View Profile
I normally do FF8 stuff but this is how I would go about it:
1.) load a save game
2.) attach a debugger (e.g. Ollydbg) to the FF7 process
3.) search for the save game data in memory - it should mostly match the save game file, it should be in memory in this format
4.) put a memory breakpoint on the EXP of an out of party character
5.) start a battle
6.) if the breakpoint triggers after the battle, trace the code back and look for where the EXP is divided by 2 for out of party characters - it'll probably be something like:

Code: [Select]
SHR REG,1
or
SAR REG,1

where SHR (logical shift right) is used to do an unsigned division and SAR (shift arithmetic right) is used to do a signed division. Shift instructions are commonly used to multiply/divide quickly by powers of 2 when using integers.
REG is an x86 32-bit register e.g. EAX, EBX, ECX...
Those instructions would basically do REG = REG/2

and then you would change it to:
Code: [Select]
XOR REG,REG

XORing (exclusive or) a register with itself is a compact way of setting a register to 0 (it's used instead of MOV REG,0) and it fits into the same 2 bytes as the shift instruction.

Anyway, that's roughly how I'd go about it, I'll take a look tonight if I get some free time.
« Last Edit: 2016-05-18 09:49:33 by JWP »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Use a hex editor on ff7.exe to change the values at 0x1C6301 from

Code: [Select]
D1 F8to
Code: [Select]
33 C0
That will give 0 exp to every out of battle character.

EDIT:
This is JWP's suggested method. This is changing
Code: [Select]
SAR eax, 1to
Code: [Select]
XOR eax, eax
« Last Edit: 2016-05-18 14:56:18 by NFITC1 »

JWP

  • *
  • Posts: 194
    • View Profile
Nice work NFITC1! Saves me having to reinstall FF7 :P.

CoolMitten

  • *
  • Posts: 20
    • View Profile
Oh my gosh this is brilliant! I haven't tried to include this yet, but you know, I'm an optimist :) Thanks NFITC1 and JWP!

Edit: Time to learn how to hex edit, so far I'm trying to use DLPB Tools to accomplish this, and I'm having a tough time finding any tutorial materials outside of the general "read me" files that are included.
« Last Edit: 2016-06-10 18:47:03 by CoolMitten »

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Might help you to create patches for the for hext launch.
http://forums.qhimm.com/index.php?topic=16329.0

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Oh my gosh this is brilliant! I haven't tried to include this yet, but you know, I'm an optimist :) Thanks NFITC1 and JWP!

Edit: Time to learn how to hex edit, so far I'm trying to use DLPB Tools to accomplish this, and I'm having a tough time finding any tutorial materials outside of the general "read me" files that are included.

Whatever you do, ABSOLUTELY check the original values and make sure they are what I said they should be BEFORE making the change. I can't tell you the number of times I was off by just a few bytes and changed something completely different.

CoolMitten

  • *
  • Posts: 20
    • View Profile
Thanks for the resource Kaldarasha. This looks helpful.

I've spent a few hours attempting to hex edit the address specified by NFITC1, but I feel as though I'm mildly stuck. I'm having trouble using DLPB Tools to interface with the hex that I need to edit. I'm also apprehensive that I'll cause an error that will force me to re-install FF7, so I'm still not even at the stage of interfacing with hex yet (but I'm learning more as I read, so I feel like I'm getting closer to a breakthrough).

@NFITC1: When you say "check the original values," you mean to obtain a copy of the original, untouched hex and check the address of 0x1C6301 D1 F8? If it is the incorrect address, would it simply be missing? Is there a way to compare this against something else to determine if the values are erroneous/misplaced? and what's more, how would I find the correct location of the values that I need to change to obtain the "zero exp for out of battle party members" effect? I found some documentation by Kranmer on which addresses change what, but I'm not sure if it's outdated, or if the information I'm trying to find is absent from his writings.
« Last Edit: 2016-06-10 19:15:42 by CoolMitten »

CoolMitten

  • *
  • Posts: 20
    • View Profile
I am able to use HextEdit to point to a target (in this case, the FF7 Launcher) and issue commands to change hex values (I successfully understood this by observing and running the "test.file" after reading the "read me"), but it seems like I should be interfacing with a large array of addresses containing alphanumeric characters, e.g. a hypothetical "find" function to look up the address "0x1C6301", and then under this address modify D1 F8 to 33 C0.

Simply using HextEdit to issue "blind" commands to alter hex makes me feel cautious and unsafe about making changes, so I feel like I'm missing something more tangible and concrete. Should I be using Hextract to obtain a list of values, and then create instructions for HextEdit from this list?

Edit: Holy moly, I just realized that Black Chocobo has a hex editor built in that I might be able to use. Is this an acceptable/reputable means of editing hex figures? Thanks for sticking with me! :)
Edit 2: Darn, it looks like Black Chocobo can only hex edit the savestate and doesn't contain what I would like to edit.
« Last Edit: 2016-06-10 19:25:50 by CoolMitten »

DynamixDJ

  • *
  • Posts: 240
  • 1111 1111 0111
    • View Profile
I laernt how to hex edit a short while ago. I didn't find it too hard. I use EditPad Pro, which is basically just an ascii text-editing software, but also deals with hex editing. PM me if you'd like a copy. I opened up the ff7.exe within Edit Pad, then I'll zoom in to only show 16 bytes per line. I scrolled down to line 001C6300. the offset is 1, which is the second value in. D1 F8!
It shouldn't take you long  ;)

« Last Edit: 2016-06-10 20:03:44 by DynamixDJ »

CoolMitten

  • *
  • Posts: 20
    • View Profile
I was able to use Editpad Pro to see, identically, the screenshot that DynamixDJ posted; however, when I changed D1 F8 to 33 C0, it "bumped" all of the subsequent characters, and now it looks like my .exe is corrupted. I tried to change 33 C0 back to D1 F8, but it just bumped 33 C0 two spots to the right, along with all the other subsequent characters. Trying to see if I can revert it to have it fixed; otherwise, looks like I'll have to re-install.

CoolMitten

  • *
  • Posts: 20
    • View Profile
It was just that I made a simple mistake in the editor, and I realized that the bumped over entries were all the same from before, so I just removed the superfluous ones. The 33 C0 edit took, and my FFVII .exe is working correctly. Going to test to make sure that the change is what was intended :)

DynamixDJ

  • *
  • Posts: 240
  • 1111 1111 0111
    • View Profile
Glad to hear  :D

CoolMitten

  • *
  • Posts: 20
    • View Profile
Confirmed to have nullified experience for out of battle characters. Thanks!

I'm wondering if editing that messed something up with my input settings though. Now, it seems that button presses execute multiple functions, e.g. pressing triangle brings up the menu, but it also rotates one position through the overworld display map. Can one hex edit change multiple things? I'm 95% certain that I reversed any hex changes from the original .exe with the exception of adding zero exp for out of battle characters. Any ideas? It was working fine before I made that hex edit.

Edit: Whoa, loading a save outside of Nibelheim just placed me in the upper-left corner of the world map, way out in the ocean. Going to see if I can find out why this happened.
Edit 2: Controller inputs seems to be isolated to a problem with Xpadder utilizing both Direct Input and Xinput or the game reading inputs from both keyboard and joystick simultaneously.
« Last Edit: 2016-06-11 00:40:27 by CoolMitten »

CoolMitten

  • *
  • Posts: 20
    • View Profile
Tested again for a while today, and I can't duplicate the problem - it hasn't happened again. Probably just some flukey, one-time thing. Thanks for all of your help! Learning more about the hex system was really neat.

vega900

  • *
  • Posts: 16
    • View Profile
Is it possible to do this same thing for the PSX version?

CoolMitten

  • *
  • Posts: 20
    • View Profile
@vega900: I don't see why not. The hex should be quite similar, so if you can find a way to edit the same hex values in the PSX version, you should be able to replicate the same change. Of course, this could also not be true, and the PSX hex could be different, but I can't think of any reason why the PC hex and PSX hex would differ - would love to know more.

JWP

  • *
  • Posts: 194
    • View Profile
The Playstation uses the R3000 processor, so all the code uses the MIPS I instruction set, so it would be completely different from the PC version. It is possible to make a code change to do the same effect but I have no idea what that would be or how to locate it.