Overview


AfterLife is TobEx fork with more bugfixes/tweaks for original Baldur's Gate II engine. It is part of BG2 Improved GUI project, but only TobEx options are enabled.

Codebase was changed to custom one, this is no more "original" TobEx v26 by Ascension64, use it at your own risk. Includes v28 patch by Magus. Share same C++ sources with main BG2 Improved GUI, src files available at "bg2improvedgui\src" folder.

Selectable fixes:

Default AfterLife options state:
Character Behind Polygon Fix=1
Disarm Trap Distance Fix=1
Continuous Battle Music Fix=1
Set BG1 Animation during Character Generation=0
Flickering Cursor Fix=1
Cpu Idle=1
Over Target Visual Effect Fixes=1
Skip OpenGL Fullscreen Display Modes with Fixed Interpolation=0
OpenGL VSync On=0
Protection From Spell for Contingency Fix=1
Run In Background=0
Disable Hidden TobEx Patches=0
External Crashdump Saving Utility=1
Stop Animation/Sound of Interrupted Casting=1
Mixed Soundset for BGT=1
Externalise Animation Sound Reference Override=1
Externalise Animation Config Override=1
Mute Generic Animation Attack Sound=0
Disable Hardcoded BG1 Item Sounds=0
Self-Patched Effect Removing Fix=1
Sequence Sound Override Fix=1
Ankheg Range Weapon Animation Fix=1
Creature Embedded Sound overrides 2DA Entry=1
Restore Creature Attack Sounds #1=1
Restore Creature Attack Sounds #2=1
Enable Off Hand Weapon BG1 Animation=0
Enable Robe Armor Sound=1
Reset Idle Timer After Weapon Equipped=1
Weapon Speed Fix=1
Path Search Party Bumpable When Moving=0
Saving Throw Improved Invisible Bonus=0
Small Purple Elemental Palette Fix=1
44Khz Mixer=1
OverviewBACK TO TOP

Requirements


  • Baldur's Gate II Throne of Bhaal (ToB) expansion with official patch v2.5.26498
  • Installed TobEx original v26 or modded v28, mod will replace installed tobex.dll with custom version
RequirementsBACK TO TOP

Installation Order & Compatibility


Install before mods:

  • BG2 Improved GUI

Install after mods:

  • TobEx

Not compatible:

  • Component Saving Throw Improved Invisible Bonus not compatible with BG2 Fixpack
Installation OrderBACK TO TOP

Components


Disarm Trap Distance [Fix]

Add safe distance around trap to disarm, fixes bug when original engine move char to centre of trap and if trap has large polygon it will automaticaly triggered

back to overview

Character Behind Polygon [Fix]

Make character behind big polygon (door/passes/...) selectable for mouse actions. There is other types of objects like containers on ground, they are always unavailable if overlapped by polygon from LIST_FRONT list because these objects belong to LIST_MIDDLE or LIST_BACK lists

back to overview

Continuous Battle Music [Fix]

Battle Music plays without reseting when GUI/Screen switched from main Game screen

back to overview

Set BG1 Animation during Character Generation [Tweak]

Set "BG1 Type" animation to main character, require Infinity Animation installed. GNOME and HALFORC animation missed in BG1 set, animation of GNOME become DWARF, HALFORC become HUMAN

back to overview

Flickering Cursor [Fix]

In fullscreen mode for unknow reason engine renders cursor two times - first on backbuffer, then on primary surface. Writing to primary surface is bad idea because this surface is what graphic chip shows currently on monitor. Component removes writing to primary surface and keep only one way to render cursor - to backbuffer

back to overview

Cpu Idle [Tweak]

    1) Graphic Render uses infinite CPU cycle to synchronize with AI part of game(AI synchronized with constant timer). Component changes synchronization type to "events", events uses Windows API and don't load CPU
    2) Timing in Movie player changed from CPU Cycles to sleep states
    3) When switched from BG2 to other Application, put engine to sleep states
back to overview

Over Target Visual Effect [Tweak]

Some spells/weapons/items use "Over target (unattached) Visual Effect", this type of effect has adavantage(bug ?) - it ignores timing, always play animation only one time. And has visual disadvantage - no tracking to target/owner, animation plays always at same point on area, even target/owner moved far from this point. Tweak changes "Over target (unattached) Visual Effect" to be like "attached" version, e.g. move animation together with target/owner, also stop animation if owner is died/disappeared

back to overview

Skip OpenGL Fullscreen Display Modes with Fixed Interpolation [Tweak]

Since Windows XP, vendor's video driver can report same display resolution tree times:

    1) default mode
    2) centered at larger screen space
    3) stretched to fill larger screen space.

In Intel/NVidia control panel default mode can be overrided to few selectable option - scale by display/scale by driver/etc. BG2 engine don't expect same mode few times and always fetch first in line. Depending on video driver, it can be any of three modes, control panel in this case ignores user's preferences and rely directly on application request (Intel control panel has "Override Application Settings" to ignore application request, but this option not available for all possible scaling methods and doesn't work properly with OpenGL apps). Component skips centered/stretched modes and prefers default mode without any interpolation

Options:

  • 0: disabled
  • 1: skip all fixed interpolation modes
  • 2: force display's default setting
back to overview

OpenGL VSync On [Tweak]

Enable OpenGL VSync by game itself, useful with Intel VGA latest drivers when in Graphics Control Panel VSYNC and TripleBuffering can be enabled always together and no way to enable VSync only (all Infinity Engines don't compatible with triple buffering)

back to overview

Protection From Spell for Contingency [Fix]

Fixes Protection From Spell opcode to work with Contingency/Sequencer. Normaly engine parse all spells in Contingency list and place it to two queue, apply all available effects from first queue and only after this process second queue. Component places Protection From Spell and other opcodes to first(Message) queue to process one spell as one job

back to overview

Run In Background [Tweak]

Run game even in inactive window on screen, works only in window mode, at fullscreen game always pause if switched to other window

back to overview

Stop Animation/Sound of Interrupted Casting [Fix]

Adds handling "non-damage" events to stop animation/sound when NPC/Party interrupted casting or died

back to overview

Mixed Soundset for BGT [Modding]

For BGT changes default BG2 selection sounds to BG1/Mix/Max soundset for listed creatures. Requires external BGSNDSET.2DA:

2DA V1.00
*
            Type
AASIM       BG1
ABELA       BG2
IMOEN10     Mix
IMOEN15     Max
...         ...

first column - creature filename
second column -

    BG1 - CRE file has BG1 soundset: BG1_SELECT_ACTION1-3 (0x124-0x12C) + BG1_SELECT_RARE1-4 (0x130-0x13c)
    BG2 - CRE file has BG2 soundset: BG2_SELECT_ACTION1-7 (0x124-0x13C) + BG2_SELECT_RARE1-2 (0x1a0-0x1a4)
    Mix - CRE file has Mixed soundset: BG2_SELECT_ACTION1-7 (0x124-0x13C) + BG2_SELECT_RARE1-2 (0x1a0-0x1a4) + BG2EE_SELECT_RARE1-4 (0x1d0-0x1dc)(slots #75-78)
    Max - same as Mix + all unused slots in 0x1e0-0x230 range used as additional sounds:
1 MORALE2                    1e0 (slot #79)
2 HAPPY2                     1e4 (slot #80)
3 UNHAPPY_ANNOYED2           1e8 (slot #81)
4 UNHAPPY_SERIOUS2           1ec (slot #82)
5 UNHAPPY_BREAKING_POINT2    1f0 (slot #83)
6 LEADER2                    1f4 (slot #84)
7 TIRED2                     1f8 (slot #85)
8 BORED2                     1fc (slot #86)
18 DAMAGE2                   200 (slot #87)
19 DYING2                    204 (slot #88)
20 HURT2                     208 (slot #89)
21 AREA_FOREST2              20c (slot #90)
22 AREA_CITY2                210 (slot #91)
23 AREA_DUNGEON2             214 (slot #92)
24 AREA_DAY2                 218 (slot #93)
25 AREA_NIGHT2               21c (slot #94)

27 SELECT_COMMON7            220 (slot #95)
28 SELECT_COMMON8            224 (slot #96)
29 SELECT_COMMON9            228 (slot #97)
32 SELECT_ACTION8            22C (slot #98)
33 SELECT_ACTION9            230 (slot #99)

For example char with Max type will play MORALE sound from original offset 0xA8 and from additional 0x1E0 by random order. Max type plays rare sounds after 13 clicks.

BG2EE_SELECT_RARE1-4 works as BG1_SELECT_RARE1-4, plays rare sounds after 9 clicks.

Due engine bug when it lost first char of creature filename in savegame files, this component requires starting new game.

back to overview

External Crashdump Saving Utility [Debug]

Enables external Library (ExceptionHandler (c) 1998 Bruce Dawson) to save MS WinDbg compatible crashdump file to disk

back to overview

Externalise Animation Sound Reference Override [Modding]

Each animation sound 2da contains soundset information associated with each animation with the same 4-letter animation code (see reference ANIMSND.2DA). Unfortunately engine doesn't use ANIMSND.2DA, instead all 4-letter soundset filenames hardcoded to game code. Option externalises animation_id->sound_2da_filename mapping to ANISNDEX.2DA for override hardcoded values:

2DA V1.0
****
       File     Description
0x7101 MBAS2    BASILISK_GREATER
0x7200 MBER4    BEAR_BLACK
0x7202 MBER3    BEAR_CAVE
0x7203 MBER2    BEAR_POLAR
0x7401 MDOG2    DOG_WAR
0x7501 MDOP2    DOPPLEGANGER_GREATER
0x7702 MGHL2    GHOUL_GHAST
0x7B01 MWLF5    WOLF_WORG
0x7B02 MWLF6    WOLF_DIRE
0xA000 MWYV2    SMALL_WYVERN
...... .....    ..................
back to overview

Externalise Animation Config Override [Modding]

See "TobEx_redist\TobEx_ini.txt" for detailed info about this component

back to overview

Mute Generic Animation Attack Sound [Tweak]

If creature doesn't have personal attack sounds, on every melee attack engine plays ATTACK sound from animation sound 2DA file. TobEx's "Enable Animation Attack Sounds" option introduced playing additional specific attack animation sound together with ATTACK sound. This component disables first ATTACK sound and plays only specic attack animation sound.

back to overview

Disable Hardcoded BG1 Item Sounds [Tweak]

BG2 engine has one of BG1 legacy - some monster's weapons have hardcoded specific sounds. Same goal can be reached using new animation sound 2da files. Option disables hardcoded item mapping if this mapping will be rely on 2da files.
For example hardcoded melee ANGHEG1.itm->ANKHG06.wav and range ANGHEG2.itm->ANKHG05.wav can be implemented in 2da format:

ATTACK or ATTACK_SLASH/ATTACK_BACKSLASH/ATTACK_JAB  ANKHG06
SHOOT                                               ANKHG05

back to overview

Self-Patched Effect Removing [Fix]

Color setting effects (effect codes 7,8,9,51,52) may self-modify if applied on item in off hand. These effects can not be removed due 100% match requirement with original item's ability. Component enables removing effects with these codes.

back to overview

Sequence Sound Override [Fix]

Most animation types have hardcoded sequence overrides for animation sound 2da files. For example when Ankheg (animation_id 3xxx) does range attack, engine overrides SHOOT sound to READY. Component removes most overrides and makes using sound 2da files more precisely

back to overview

Ankheg Range Weapon Animation [Fix]

Vanilla engine assigns range animation for melee JAB attack and assigns empty animation for SHOOT/Range attack. Component set range animation for SHOOT attack and SLASH/BACKSLASH animation for JAB attack.

back to overview

Creature Embedded Sound overrides 2DA Entry [Tweak]

Tweak removes playing of attack animation sounds from 2da if creature has personal sounds.
Mapping:

  • DAMAGE mute 2DA's DAMAGE
  • DYING mute 2DA's DIE
  • ATTACK1 mute 2DA's ATTACK and ATTACK_SLASH
  • ATTACK2 mute 2DA's ATTACK and ATTACK_BACKSLASH
  • ATTACK3 mute 2DA's ATTACK and ATTACK_JAB
  • ATTACK4 mute 2DA's SHOOT
back to overview

Restore Creature Attack Sounds #1 [Tweak]

Engine has bug with Creature Attack[2-4] (0xe0-0xe8 offsets) sounds, it always play Attack1 sound only. Restore sounds with mapping:

  • ATTACK1 on slash animation
  • ATTACK2 on backslash animation
  • ATTACK3 on jab animation
  • ATTACK4 on shoot/range animation

ATTACK4 wasn't used in original engine and has unknow original purpose, Skellytz introduced new mapping - set creature personal range weapon sound.

back to overview

Restore Creature Attack Sounds #2 [Tweak]

If creature equipped with one of weapon with specific swing sound, game mutes personal(embedded) ATTACK1-4 sounds, but still plays attack sounds from animation sound 2da at same time. Component restores playing ATTACK1-4 sounds together with weapon swing sound (even for Darts and Touch weapons with special "mute all swing sounds" mode)

back to overview

Robe Armor Sound [Tweak]

Restores disabled ARM_01*.wav for Mages with Robes. For using with InfinityAnimation random Mage AnimID, requires anim_class=W in EXTANIM60.2DA/EXTANIM64.2DA

back to overview

Reset Idle Timer After Weapon Equipped [Tweak]

Enable long-timed SEQ_READY animation sequence if char equipped/re-equiped weapon or shield. Removes bug when SEQ_READY showed only for 1 or 2 animation frames and changed instantly to SEQ_HEAD_TURN

back to overview

Weapon Speed [Fix]

Ignores ammo speed (usualy = 0, max speed) for ranged weapon, instead uses launcher speed. Restores WSPECIAL.2DA's SPEED column speed bonus.

back to overview

Path Search Party Bumpable When Moving [Tweak]

Alternates Path Search algorithm to ignore Party/Ally current position to eliminate famous bug when char can not directly move to destionation point if other party member currently is blocking passage. Original algorithm may change current direction to other side of map, then recalculate after timeout and back to "right" way

back to overview

Enable Off Hand Weapon BG1 Animation [Fix]

Enables paperdoll off hand weapon animation for InfinityAnimation BG1 Chars, filename calculation:
WP[S/M/L] + WeaponCode + "O" + "IN.BAM".
Animation forced to use main hand weapon animation, there is no off hand weapon animation files in BG1

back to overview

Disable Hidden TobEx Patches [Debug]

Disables small patches when need to keep only few enabled options:

  • Set Wild Mage school to Generalist
  • Remove +2/-2 bonus "Unschooled weapon/item Effects versus Chars with any Kit
  • Allow equip Robe for Mages with BG1 type animation
  • Extended combat text mistypos
  • Clear "unstealable" bit when putting item to Bag to allow stacking
  • Remove hardcoded check for mage animation X2XX for Infinity Animation BG1 type Mage animation
  • Fixes Armor sound for Infinity Animation BG1/BG2 type Mage animation
  • Remove WAL_77*.wav Ready Sound for Infinity Animation 0x10XX/0x50XX animation monsters
  • Enable dual-classing for Infinity Animation BG1 type animation
  • Green highlight stats(with +bonus) on inventory screen
  • Undefined creating/assign CString from not null-ended ResRef::GetResRef()
  • Remove crash when "min level" field setted in .ITM
  • Enable any resolution in window mode
  • Mouse Wheel on some ScrollBars
  • Assign SPACE key as ENTER in dialogs
  • Bugged Mislead clone for Creatures with >327 HitPoints
  • Destructed first char of .CRE filename in save games
  • Trigger AreaCheckObject() crash
  • Remove doubling sound in dialogs
  • Remove spell hotkeys exploit
  • Gender Change opcode fix
  • Remove multi-target items/spell swap exploit
  • Disable 2DA sounds when playing SELECT_ACTION from .CRE
  • Add missed Bow/Crossbow/Sling Elf/Halfling race bonus when weapon in "ranged" mode (without ammo)
  • CAnimation1200::CAnimation1200() forget to set wAnimId
  • CreateInventoryItem(opcode=122) forgot to set "undroppable" item flag for Simulacrum clone
  • Disable resetting sequence to SEQ_READY in ClearActions() if:
    • Char going to walk after idle
    • Char already in idle state (has SEQ_HEAD_TURN sequence)
  • 2TB+ free space error window
  • Ambient sound muted after QuickLoad

Disables game code injects:

  • CEffect::CreateEffect()
  • CEffect::ApplyTiming()
  • CEffect::CheckSave()
  • CDerivedStats::OpAdd()
  • CEffectDamage::ApplyEffect()
  • CItem::GetAbilityEffect()
  • ResSplContainer::GetAbilityEffect()
  • CCreatureObject::ActionPickPockets()
  • CreateUIControl()
  • CRuleTables::GetMageSpellRef()
  • CCreatureObject::SetCurrentAction()
  • CCreatureObject::Construct()
back to overview

Saving Throw Improved Invisible Bonus [Compatibility]

Enable +4 Saving Throw Bonus at engine level, doesn't apply bonus against creatures with ability to see invisible. Component not compatible with BG2 Fixpack! (BG2 Fixpack has own, but worse fix)

back to overview

Small Purple Elemental Palette Fix [Fix]

Override palette .BMP references MFIEG1B->MFISG1B, MFIEG2B->MFISG2B for 0x7313 animation

back to overview

44Khz Sound Mixer Frequency [Tweak]

Change default 22kHz Mixer frequency to 44Khz. Affects only Primary DirectSound buffer, secondary buffers still use .WAV frequency, usually 22Khz. Also fixes little frequency shift, engine plays 22050Hz recorded sounds at 22000Hz.

back to overview

Credits


Author: Insomniator
Original TobEx source code: Ascension64
TobEx v28 patch: Magus
WeiDU coding: Insomniator


Special Acknowledgements to:

Programs/tools used in creation:
  • WeiDU, by Wes Weimer, the bigg and Wisp.
  • Near Infinity, by Jon Olav Hauglid, FredSRichardson, and Argent77.

Compilation

Folder "src" is modified sources of TobEx v28, merge with original TobEx filetree


Copyrights

TobEx AfterLife is not developed, supported, or endorsed by BioWare™ or Interplay/BlackIsle, Overhaul, Beamdog or the Wizards of the Coast. It was developed by Author, based on material from the game Baldur's Gate II and its expansion.

Most mod content is ©Author.

Baldur's Gate II: Shadows of Amn and Baldur's Gate II: Throne of Bhaal © TSR, Inc. The BioWare Infinity Engine is © BioWare Corp. All other trademarks and copyrights are property of their respective owners.

This mod was created to be freely enjoyed by all Baldur's Gate II players, and its content is free of rights.

If there are any copyright issues or this statement needs revision, then please contact me and advise me what to do about it. Most notably, if you see any artwork in this mod that might conflict with Copyright rules, please let me know as soon as possible, and I will remove the conflicting content immediately.

This work (including all code and documentation) is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License. You are free to share (copy, distribute and transmit) and to remix (adapt) this work, except for commercial purposes. See the Creative Commons Public License for more details. Please post any changes or updates at the mod's forum.

All copyrights and trademarks are the property of their respective owners.

CreditsBACK TO TOP

Version History


Version 29.13
  • Added: Small Purple Elemental Palette Fix
  • Fixed: Ambient sound muted after QuickLoad
  • Added: 44Khz Sound Mixer Frequency
  • Fixed: Walking animation at READY state regression
Version 29.12
  • Added: 2TB+ Free Disk space Fix
  • Added: HTML Documentation
  • Synced with Improved GUI v5.5
Version 29.11
  • Added: Externalise Animation Config Override new columns
  • Added: Enable Off Hand Weapon BG1 Animation
  • Added: Enable Robe Armor Sound
  • Added: Reset Idle Timer After Weapon Equipped
  • Added: Weapon Speed Fix
  • Added: Party Bumpable When Moving
  • Added: Saving Throw Improved Invisible Bonus
  • Removed: Improved Invisibility saving throws +4 bonuses from patched spells
Version 29.10
  • Fixed: Mixed Soundset for BGT
  • Added: Mute 2DA's HEAD_TURN/READY/WALK sounds if SELECT_ACTION are playing
  • Added: Assigning key to not memorized spell exploit fix
  • Added: Multi-target item swap exploit fix
  • Removed: "Mixed Soundset for BGT Unknown BG1 NPC Have BG2 Soundset"
  • Fixed: Animation & Modal State with ACTION_CLEAR_BLOCK_VARIABLES action opcode
  • Added: new MAX type for Mixed BGT Soundset
  • Fixed: Gender changing opcode bug
Version 29.9
  • Added: Remove Improved Invisibility saving throws +4 bonuses from patched spells
  • Added: Assume SPACE key as ENTER in dialog
  • Added: Mixed Soundset for BGT
  • Added: Mixed Soundset for BGT Unknown BG1 NPC Have BG2 Soundset
  • Added: Externalise Animation Sound Reference Override
  • Added: Externalise Animation Config Override
  • Added: Self-Patched Effect Removing Fix
  • Added: Sequence Sound Override Fix
  • Added: Ankheg Range Weapon Animation Fix
  • Added: Disable Hidden TobEx Patches
  • Added: Stop Animation/Sound of Interrupted Casting
Version 29.8/V29.8_fix/V29.8_fix2
  • Fixed: Double Mouse Rate regression bug
  • Added: Crashdump saving utility
  • Fixed: Protection From Spell for Contingency crash
  • Fixed: Level One Proficiency Restrictions regression
  • Added: Protection From Spell for Contingency Fix
  • Added: Unpause engine in background window
Version 29.7
  • Added: Restore "Minimal Level" field in .ITM
  • Added: OpenGL VSync On
Version 29.1-6
  • Added: Skip Fullscreen Display Modes with Fixed Interpolation
  • Added: Over Target Visual Effect Fixes
  • Added: Flickering Cursor Fix
  • Added: Cpu Idle
  • Fixed: HASTE moving regression after Character Behind Polygon Fix
  • Added: Set BG1 Animation during Character Generation
  • Removed standalone install mode, removed languages except english
  • Added: Continuous Battle Music Fix
Version 29.0
  • Added: Trap Disarm Distance Fix
  • Added: Character Behind Polygon Fix
  • Allow equip armour items(Robes) to mages with BG1 type animation
  • Wild Mage school fixed NONE->Generalist
  • Removed unnecessary +2/-2 bonus "Unschooled weapon/item Effects versus Chars with any Kit"
Version 29.pre0
  • Refactored to fix compiler/analyzer warnings:
  • Fixed most "mixed unsigned vs signed comparing"
  • Added missed parentheses "x & y == z" -> "(x & y) == z"
  • Rewritten Charisma/Morale/xxx TobEx fixes
  • Field names changed to Bioware's names (based on "BG2EE baldur.pdb")
  • Function names changed to Bioware's names (based on "BG2 Tob PowerPC symbols")
  • Partially removed unnecessary constructor/destructor calls
  • Partially replaced "__thiscall calls to bgmain.exe" to simple macro
  • Merged with BG2 Improved GUI
Version 28 (by Magus)
  • Loader: Modified error messages to be very slightly more informative
  • Log Dialogue Bar: Fixed a bug that prevented user patches from working if TobEx_dlg.log already existed
  • Magic Resistance Mod Fix: Fixed a bug when successfully resisting a spell showed too many messages in the dialogue bar
  • Saving Throw Fix: Fixed a bug when successfully saving against a group of effects showed too many messages in the dialogue bar
  • User Patches: Successfully applied user patches are now logged too
  • WeiDU: Updated simplified Chinese and traditional Chinese translations (by Hindo’s Doom)
  • WeiDU: updated to v246
  • Switched PlatformToolset to v100, updated Detours to 4.0.1.
Version HistoryBACK TO TOP