Jump to content


Photo

BG1 engine FIX - extending limit of maximum GLOBAL variables


  • Please log in to reply
No replies to this topic

#1 Zed Nocear

Zed Nocear
  • Member
  • 8 posts

Posted 14 July 2011 - 05:15 AM

File Name: BG1 engine FIX - extending limit of maximum GLOBAL variables
File Submitter: Zed Nocear
File Submitted: 14 Jul 2011
File Category: Miscellaneous Released Mods

MODS CONTENT:
This fix doesn't change anything visible in the game but allows you to
finish BG1 with quest mods while avoiding serious difficulties.

Technically it extends the limit of GLOBAL variables to 4096 by the
modification of 1 byte in the EXE file.

The BG1 engine uses variables for various events memorization and the
count of variables is limited. New global variables and timers above
the limit are just ignored. The game doesn't crash but you have serious
difficulties and the plot is stopped. BG1+TotSC handles global variables
only up to 1024 and if you play with more than one quest mod, the
difficulties occur late in the game (usually Chapter 5 or above). I
played BG1-TotSC with my MotSCv3 + BGQE + TGCe1 and reached the limit in
Chapter 7 in the Duke's Palace. BG1 without TotSC is even more limited,
with only 512 global variables and it couldn't be played with mods at all
without troubles. BG2 has no problem, because the memory allocations for
variables is dynamically extended when the count of variables grow.

COMPATIBILITY:
The fix works with seven most popular BG1 engine versions:
- BG1       international 1.1.4315 - BGMain.EXE  5,022,720 bytes, offset 1892A8
- BG1       international 1.1.4315 - BGMain.EXE  4,948,015 bytes, offset 18C937
- BG1       international 1.1.4320 - BGMain.EXE  4,857,856 bytes, offset 186A87
- BG1+TotSC USA/Canada    1.3.5508 - BGMain2.EXE 5,046,319 bytes, offset 18E6D5
- BG1+TotSC international 1.3.5512 - BGMain2.EXE 5,042,223 bytes, offset 18EEF5
- BG1+TotSC international 1.3.5521 - BGMain2.EXE 5,009,408 bytes, offset 186A1D
- BG1+TotSC international 1.3.5521 - BGMain2.EXE 4,923,392 bytes, offset 1869F5
The fix should be compatible with all other WeiDU mods for BG1.

ACKNOWLEDGMENTS:
 - Avenger(teambg) for offset founding in one version 5521, what was
   crucial for creating this BG1 engine fix.
 

Click here to download this file