Qhimm.com Forums

Miscellaneous Forums => Troubleshooting => Topic started by: Colonel Ramsay on 2010-04-02 17:56:52

Title: No battles?
Post by: Colonel Ramsay on 2010-04-02 17:56:52
Ok, Kramner made me a nice little program before to disable battles by changing memory value.  I am wondering if it is possible to hex edit the FF7.exe or other game file to achieve same result?

Must admit I am not up to speed with these kind of things but surely is is possible?
Title: Re: No battles?
Post by: sl1982 on 2010-04-02 18:05:10
I don't see why this wouldnt be possible. Somehow change the game mechanics to disable random battles altogether. Boss battles and story line battles may be harder to do. Another idea may be to use a save game editor to give you a pile of mastered materia that reduces the rate of encounters.
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-02 18:10:45
I assumed that it only registers one of the "enemy away" materias and that further ones would be useless?  Or will it really work?  16 Enemy Away materias = very low battle rate?  

edit:  tried it....doesn't work.  Seems to have a cap on how much it will reduce it. 
Title: Re: No battles?
Post by: sl1982 on 2010-04-02 18:15:15
http://www.gamespot.com/ps/rpg/finalfantasy7/show_msgs.php?topic_id=m-1-41207955&pid=197341
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-02 18:17:29
ahh yeah :)  Still pretty common though in game sadly....  but maybe someone knows where I can alter this in the game files.  oh well..  :-P
Title: Re: No battles?
Post by: Kranmer on 2010-04-02 21:45:00
Well its pretty easy to remove the enemy encounters from the game's EXE, all you need to do is patch the instruction at
005CB25C
from
mov byte ptr [00dbcad9],al
to
mov byte ptr [00dbcad9],00
and that will remove random encounters from the game.
If you dont understand this i could proberly just make a patch or just post a screenshot of what you need to hex edit in the EXE.
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-02 21:53:42
Yeah screen shot will have to do it.  Nice one btw :)

I can hex edit, but we are talking as basic as you get :)
Title: Re: No battles?
Post by: Kranmer on 2010-04-02 21:59:44
lol ok here it is made extremely simple.
(http://img532.imageshack.us/img532/3792/noencounters.jpg) (http://img532.imageshack.us/i/noencounters.jpg/)
top is the original ff7 EXE and the bottom is the one with no encounters.
the only way i can make it simpler is to make a patch.
let me know how you get on.
Title: Re: No battles?
Post by: titeguy3 on 2010-04-02 22:24:29
That hex editor spaces up the data oddly... I'm used to seeing it byte by byte, 16 bytes per row.

But so basically zero the byte at 0x1CA658. That is pretty simple.
Title: Re: No battles?
Post by: Kranmer on 2010-04-02 22:32:31
That hex editor spaces up the data oddly... I'm used to seeing it byte by byte, 16 bytes per row.

But so basically zero the byte at 0x1CA658. That is pretty simple.

I supose it is a little odd, I just sort of got used to it over the years though so to me it doesnt seem it now.
And yes you are right just enter Zero bytes 0x1CA658 and save the EXE and your done,
And hopefully if you enter a different number you can get more or less encounters, (for example 01 would give you very few, but FF would proberly give you none stop)
Title: Re: No battles?
Post by: obesebear on 2010-04-02 22:45:26
Nice!  This won't mess with non random battles like Jenova right?
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-02 22:47:00
Yeah they are grouped different but I understand that fully.  Very simple. Cheers. Haha I have been altering the world map dialogue byte by byte and pointers too recently :P

Nice!  This won't mess with non random battles like Jenova right?

No, storyline battles etc are different I believe.
Title: Re: No battles?
Post by: Kranmer on 2010-04-02 22:49:51
well i havent fully tested but i wouldnt have thought so, I did run into "midgar zolom" and the battle went fine but thats as far as my testing has gone, if anyone else could give feedback i would appreciate it.
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-02 22:50:39
well i havent fully tested but i wouldnt have thought so, I did run into "midgar zolom" and the battle went fine but thats as far as my testing has gone, if anyone else could give feedback i would appreciate it,
Also i havent ever really used jenova so could you tell me what it mess's up on non random battles ?

It shouldn't do, but I will :)  I have one such battle right near a save.

Edit:  Ultima Weapon attack at Mideel works fine.
Title: Re: No battles?
Post by: Kranmer on 2010-04-02 23:07:41
It shouldn't do, but I will :)  I have one such battle right near a save.

Edit:  Ultima Weapon attack at Mideel works fine.

Thanks for confirming that.
I have also confirmed that the first few battles in the game that are scripted work fine (first battle against the soldiers and the scorpion boss)

EDIT-
Also 1 thing you should note is that if you equip Enemy Lure materia Random battles will come back (i just tested this)
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-02 23:41:54
yeah that is because it alters memory again overriding the default setting you set in the exe :)  Noted.  Hopefully nothing else does this....like going in and out of towns/areas.
Title: Re: No battles?
Post by: Kranmer on 2010-04-02 23:50:36
yeah that is because it alters memory again overriding the default setting you set in the exe :)  Noted.  Hopefully nothing else does this....like going in and out of towns/areas.

well i have tested going in and out of some of the town's in the game and it doesn't seem to make any difference but if anyone is finding this a problem i may be able to just NOP the whole instruction for random battles but i would rather not do this if possible incase it breaks anything.

EDIT-
Ok i have now just completely stopped the instruction for random battles so even materia wont make any difference, I also ran into a few scripted battles and everything still seems to be working fine,
I even tried saving the game with the encounters off EXE then loading the save with the original EXE and hey presto the save worked fine and random battles are back, here are the new Hex values
(http://img638.imageshack.us/img638/4355/norandombattlesv2.jpg)
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-03 00:23:19
Very nice!
Title: Re: No battles?
Post by: Kranmer on 2010-04-03 01:13:35
ok here is a quick patcher to do this for you (only tested on the original 1.02 EXE)
http://www.mediafire.com/?mwzkmgjt2zw
(NOD32 + VBA32 virus scanners detect this patch as a virus but it isnt, All other virus scanners dont detect it as a virus)
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-03 10:57:46
cheers! 1 thing though ;)  maybe add an unpatcher too :-P  (hides)

No seriously I am grateful as it is for all you have done :)

Title: Re: No battles?
Post by: Kranmer on 2010-04-03 12:43:03
cheers! 1 thing though ;)  maybe add an unpatcher too :-P  (hides)

No seriously I am grateful as it is for all you have done :)

A unpatcher shouldnt be needed if you used the Backup option at the bottom of the patcher but i have made one for you anyway
Unpatcher 0.1
http://www.mediafire.com/?txzmodhjgzv

Also here is somthing that might be even more usefull, I made a quick loader so that you wont need to patch your Original ff7.exe,
All you do is run my loader instead of ff7.exe from the "Final Fantasy VII" folder and my loader will launch the game with No Random Battles WITHOUT making any changes to the ff7.exe so when you want random battles again all you need to do is launch the game as normal.
Loader 0.1
http://www.mediafire.com/?mjgjuyh2dw3

also i wonder if i should post this is the "game tweaking" section when testing is done.
Title: Re: No battles?
Post by: Bosola on 2010-04-03 13:01:33
Kranmer, this isn't entirely related per se, but I am interested in how you reverse-engineered the executable. Did you use some sort of decompiler?
Title: Re: No battles?
Post by: Kranmer on 2010-04-03 14:20:04
Kranmer, this isn't entirely related per se, but I am interested in how you reverse-engineered the executable. Did you use some sort of decompiler?
sort of hard to explain how i did it (not hard to do, just to explain) but basically i used Cheat Engine 5.6 to find the virtual memory value for random battles, then i used its browse memory function to see what was happening everytime i used a enemy lure materia, then i traced where the game writes from and to and looked at the code in the "assembly code" (basically the same as a decompiler but allows editing) and it looked easy enough and thats where i came up with this.

I also tried doing other things like removing the black bar at the bottom of the screen, and was sort of successfull to an extent but it had serious problems (because i had messed with the coordinates it made all NPC's etc off their original points so basicly NPC's would be in the middle of walls etc and exit points would be a little off, which made the game very unplayable).
Title: Re: No battles?
Post by: Colonel Ramsay on 2010-04-03 16:11:43
Yeah I think you should release this Kranmer properly :)  A good tool!
Title: Re: No battles?
Post by: Bosola on 2010-04-03 18:30:28
Kranmer, this isn't entirely related per se, but I am interested in how you reverse-engineered the executable. Did you use some sort of decompiler?
sort of hard to explain how i did it (not hard to do, just to explain) but basically i used Cheat Engine 5.6 to find the virtual memory value for random battles, then i used its browse memory function to see what was happening everytime i used a enemy lure materia, then i traced where the game writes from and to and looked at the code in the "assembly code" (basically the same as a decompiler but allows editing) and it looked easy enough and thats where i came up with this.

Aha. So, you used a cheat engine / memory tracker to see which addresses were involved, and then you just looked for the asm that wrote data to that offset. From there, you just traced the logic. Very clever.
Title: Re: No battles?
Post by: Kranmer on 2010-04-03 23:07:27
Kranmer, this isn't entirely related per se, but I am interested in how you reverse-engineered the executable. Did you use some sort of decompiler?
sort of hard to explain how i did it (not hard to do, just to explain) but basically i used Cheat Engine 5.6 to find the virtual memory value for random battles, then i used its browse memory function to see what was happening everytime i used a enemy lure materia, then i traced where the game writes from and to and looked at the code in the "assembly code" (basically the same as a decompiler but allows editing) and it looked easy enough and thats where i came up with this.

Aha. So, you used a cheat engine / memory tracker to see which addresses were involved, and then you just looked for the asm that wrote data to that offset. From there, you just traced the logic. Very clever.

Lol yeah that's probably a better way of wording it Bosola (i am very bad with the way i word things),
Doing this sort of reminds me of when i used to make xbox (xbox1) trainers at maxconsole since it used a similar method.

Also other things could probably be done this way for anyone who is interested, it doesn't have to be just random battles, The same could be done to make it so you can Save or PHS anywhere or i could even make it so the Timer is frozen (the countdown timer like when escaping the reactor)