Ugly Hack: FO2 World map slower (Bring back encounters!)

Discussion in 'Fallout General Modding' started by jdoe407, Feb 26, 2005.

  1. jdoe407

    jdoe407 First time out of the vault

    Feb 18, 2005
    This is quite an ugly hack to the fallout2.exe ( 1.02 us edition ) which modifies the main world map event loop. What it does is simply adds a useless loop that counts to a very large number, wasting many cpu cycles causing the world map to run like it was ment to run. You will have to tweak the number until it runs just right for you ( barely any lag, but slow movement speed ). This hack may cause problems in the future. I took out a large section of code which *cough* I hope *cough* was just for error checking/reporting. Either way - it may or may not work. Don't forget to backup your executable!

    Address     Hex
    000B025D    E8168D0000
    changed to 
    Address     Hex
    000B025D    E954B10000
    The number that I was talking about is 00000001 the number is backwards so its really 1000000 in hexadecimal. EB295033C0403D00000001...
    Address     Hex
    000BB3B4    7429E8D106000089C1E8EE01000089EA89F8E8D1FFFFFF89C285C0750789C8E89005000089D0E9C5010000
    changed to
    Address     Hex
    000BB3B4    EB295033C0403D000000017CF858E8B1DBFFFFE9964EFFFF90909090909090909090909090909090909090

    here is the assembly from ollydbg
    --- Original code ---
    Address    Hex           Assembly
    004BFE5D   E8 168D0000   CALL  fallout2.004C8B78
    Address    Hex           Assembly
    004CAFB4   74 29         JE    SHORT fallout2.004CAFDF          
    004CAFB6   E8 D1060000   CALL  fallout2.004CB68C
    004CAFBB   89C1          MOV   ECX, EAX
    004CAFBD   E8 EE010000   CALL  fallout2.004CB1B0
    004CAFC2   89EA          MOV   EDX, EBP
    004CAFC4   89F8          MOV   EAX, EDI
    004CAFC6   E8 D1FFFFFF   CALL  fallout2.004CAF9C
    004CAFCB   89C2          MOV   EDX, EAX
    004CAFCD   85C0          TEST  EAX, EAX
    004CAFCF   75 07         JNZ   SHORT fallout2.004CAFD8
    004CAFD1   89C8          MOV   EAX, ECX
    004CAFD3   E8 90050000   CALL  fallout2.004CB568
    004CAFD8   89D0          MOV   EAX, EDX
    004CAFDA   E9 C5010000   JMP   fallout2.004CB1A4
    --- ugly hack ---
    Address    Hex           Assembly
    004BFE5D   E9 54B10000   JMP     fallout2.004CAFB6
    Address    Hex           Assembly                          Comments
    004CAFB4   EB 29         JMP     SHORT fallout2.004CAFDF
    004CAFB6   50            PUSH    EAX                       ;  store original eax value
    004CAFB7   33C0          XOR     EAX, EAX                  ;  set eax to 0
    004CAFB9   40            INC     EAX                       ;  increase eax by 1
    004CAFBA   3D 00000002   CMP     EAX, 1000000              ;  see if eax is less then given value
    004CAFBF   7C F8         JL      SHORT fallout2.004CAFB9   ;  if less, do loop again, else continue
    004CAFC1   58            POP     EAX                       ;  restore original eax value
    004CAFC2   E8 B1DBFFFF   CALL    fallout2.004C8B78         ;  this is the start of the worldmap loop
    004CAFC7   E9 964EFFFF   JMP     fallout2.004BFE62         ;  jump back up to the main map loop
    004CAFCC   90            NOP
    004CAFCD   90            NOP
    004CAFCE   90            NOP
    004CAFCF   90            NOP
    004CAFD0   90            NOP
    004CAFD1   90            NOP
    004CAFD2   90            NOP
    004CAFD3   90            NOP
    004CAFD4   90            NOP
    004CAFD5   90            NOP
    004CAFD6   90            NOP
    004CAFD7   90            NOP
    004CAFD8   90            NOP
    004CAFD9   90            NOP
    004CAFDA   90            NOP
    004CAFDB   90            NOP
    004CAFDC   90            NOP
    004CAFDD   90            NOP
    004CAFDE   90            NOP
    edit: I haven't had any problems running the game with this patch and it's been on for a few hours

    edit 2ish 3: Made a simple binary file patcher that is already set up for this patch/hack found here ( source ). Just compile(or use the precompiled exe) and put the FO2-WorldMapPatcher.exe in the fallout directory. Back up the fallout2.exe even though the program backs it up for you automaticly. Run the FO2-WorldMapPatcher.exe and play fallout2.exe. I have only tested it on my version of fallout2 which i think is still 1.02 US
  2. Andy-Spacetrain

    Andy-Spacetrain First time out of the vault

    Aug 11, 2004
    Great, thanks for that. I'll add that into the next version of my FO2LC program when I can.
  3. dude_obj

    dude_obj Vault Senior Citizen

    Oct 19, 2004
    Andy, could you please also add the F2Debug patch to your next version? I'm trying to debug a mod that uses FO2LC but I have to patch the EXE file. The F2debug is here:
  4. Andy-Spacetrain

    Andy-Spacetrain First time out of the vault

    Aug 11, 2004
    Okay :) I'll have a look at that and see what I can do, should be fine.
  5. Andy-Spacetrain

    Andy-Spacetrain First time out of the vault

    Aug 11, 2004
    Hmmm, I wonder if I (or anybody else) could make an algorithm to test a users processor speed, and adjust this delay accurately (or as close to). If so, I can add this into FO2LC 0.4 where the loader itself will adjust it. Has anyone ever done this before?
  6. Wild_qwerty

    Wild_qwerty Sonny, I Watched the Vault Bein' Built!

    Feb 2, 2004
    On NT (Win2k and XP) Based operating systems it should be fairly easy as you could probably call the value of the CPU from the OS and just compare this in a look up chart to set the speed perhaps.
  7. [devilfish]

    [devilfish] First time out of the vault

    Sep 7, 2005
    The link doesn't work :( Could someone who has that, send me the file? 'Cause i'm having problems not encountering anything. I have tried encounter booster mod, but doesn't work for me. :(