Jump to content


Photo

[COMPLETE] Use EFF File Fix and Polymorph Fix

For beta 0024

  • Please log in to reply
13 replies to this topic

#1 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 13 April 2012 - 06:17 AM

Exact hack descriptions to come.

Use EFF File (177) didn't properly store values of the child effect if data was saved via the effect opcode in the child effect itself (e.g. if the effect opcode procedure actually modifies param1, param2, or stores data in param3 or param4 for later use). This is fixed in TobEx beta 0024 by storing certain information from the child opcode into the Use EFF File opcode unused structure members. However, it may break other opcodes that have compensated for this somehow.

One such example is Polymorph (135). Originally, polymorph with Appearance Only (param2=1) had issues with setting the colours for animations using colour gradients. However, if polymorph was the child effect of Use EFF File, the colours were set correctly (because information was not correctly saved - i.e. the Polymorph effect opcode procedure stores information in param1, param3, and param4), but caused animation stutter (e.g. check the application of Drow Transformation SPIN825). TobEx beta 0024 has fixed this effect to apply colours properly when used independently, and combined with Use EFF File fix above, fixes the animation stuttering associated with using Polymorph as a child effect to Use EFF File.

Edited by Ascension64, 13 April 2012 - 06:18 AM.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#2 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 13 April 2012 - 06:43 PM

This is fixed in TobEx beta 0024 by storing certain information from the child opcode into the Use EFF File opcode unused structure members. However, it may break other opcodes that have compensated for this somehow.


Nice work, but I think it might be better to put this into a separate "Experimental changes" component or something along those lines.

Don't get me wrong, I certainly appreciate the tremendous amount of work that went into TobEx and I agree that the polymorph gliding/stutter bug was very irksome and needed to be fixed. However, I still think that any changes which are insufficiently tested and may potentially cause undesired side effects should not be forced upon the players within the core package.

Edited by aVENGER, 13 April 2012 - 06:43 PM.


#3 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 14 April 2012 - 12:46 AM

That's why I have test releases. It is up to everyone to test them.
Currently, I only save the values of param1-4 to unused areas of the Use EFF File slot, and them put them back in the child effect. Errors may occur only in those opcodes where the effect opcode procedure itself modifies the values of the parameters. According to taimon's bg_effs.txt research, only the following opcodes should be affected (which I will check):
Animation Change 0x035: param1, param2 [2], timing [1,*], 0xCC [!0], param3 (if 0xCC == 0, else overriden)
Polymorph 0x087: param2 [0,*], resource, 0xCC [0,*], param3, param1 [lw] (p1 + p3 overridden in some paths)
The latter I have already dealt with. I will look at the former.

Update: Looked at the Animation Change code. Won't be affected by the Use EFF File fix.
Update 2: In fact, the Use EFF File Fix is actually important in the implementation of the various Repeating EFF fixes (repeating EFF, disease, poison, etc.) when using such effects as child opcodes of Use EFF File, because I make heavy use of the extra params to get the timing right.

Edited by Ascension64, 14 April 2012 - 03:43 AM.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#4 Maanape

Maanape
  • Member
  • 32 posts

Posted 21 April 2012 - 08:37 AM

This change prevents Divine Remix to remove the undue spells from priests. Clerics and druids get spells from clab files, and then a spell remove the undesired ones via remove spell effects. The way it is now, good priests get "cause wounds" spells, and evil ones can get "holy smite", "holy word", and so on. After disabling the tweak everything went fine, but I'm worried if this means poison, disease, regeneration and other aspects will work properly. I wonder if this change can break spells from Galactygon's Spellpack too...

#5 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 23 April 2012 - 12:01 AM

There is always the alternative of trying to fix this particular case. Can you give me a particular spell in Divine Remix where this does not work?

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#6 Maanape

Maanape
  • Member
  • 32 posts

Posted 23 April 2012 - 07:49 AM

Divine Remix used to work fine with Spellpack 6 and ToBEX beta 0023. When I decided to get the "awaken on damage fix" from beta 0.24.4.15_2, things stopped to work properly. Jaheira and Branwen should not get "Cause Light Wounds" nor "Curse", since these are evil spells. These are granted via 2DA clab, and removed by AP_CDLV1NA at the last line of the clab. The CDLV1NA.spl uses EFF 177 with children opcode 172 effects (remove spell) to delete undue spells from the spellbook, regarding the creature alignment. When the patch is set to 1, the spells are not removed; when is set to 0, Jaheira is cleaned up of evil spells, but Branwen still gets "Curse". I included Spellpack 6 spells in the sphere files and CDLV1NA too, and when the patch is set to 1, Branwen can't get "Battlefate", which is a chaos spell. I don't know if she can't get it from clab or if CDLV1NA is removing it erroneously. I've noticed the children effects have data in parameters 1, 2 and 3. I don't now how this is handled or carried by the parent EFF 177 file, but I suspect this can be the cause of CDLV1NA not functioning as intended. The files are: CDCURSE.spl and CDCAUSLW.spl.

Edited by Maanape, 23 April 2012 - 07:50 AM.


#7 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 24 April 2012 - 03:26 AM

There is an error in the alignment code of Use EFF File, so it doesn't have anything to do with extra parameters. Fixed this in local.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#8 Maanape

Maanape
  • Member
  • 32 posts

Posted 24 April 2012 - 04:31 AM

Thanks for the fast answer. I know maybe I'm asking too much, but since you're launching new versions so fast, and ToBEX is the first install to do before so many mods (which means every new version demands a full reinstall), could it be a way to change this? I know TobEX modifies BGMain.exe, which certainly means it can't be done without reverting all other mods with change it on top (like 1PP and Infinity Animations), but maybe some changes have to do only with the dll file, and this would be easier to update in order to test the new changes. I don't know if I'm being silly, it's only a thought. Anyway, thanks for your hard work and availability.

#9 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 24 April 2012 - 05:03 AM

Just put the .dll file in the Baldur's Gate II directory manually. If I rename or add new hacks, they won't work. But testing out existing hacks should.

Edited by Ascension64, 24 April 2012 - 05:04 AM.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#10 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 24 April 2012 - 05:21 AM

I always thought child effects (and in case of multiple nested children the last child) were stored directly on the .cre rather than instances of opcode 177. It sounds the most logical thing to do.

I see potential issues with this, such as the various decrementing immunity/bounce spell type opcodes if nested in a '177.

-Galactygon
Posted Image

#11 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 24 April 2012 - 06:23 AM

Nope. Use EFF File is stored in the CRE directly.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#12 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 25 April 2012 - 05:25 AM

I'll consult you before I burden the BGEE team with a request: do you think it's a fundamentally cleaner solution to have the last child effect in the hierarchy (where more nested effects are concerned) be stored in the .cre? Do you think it will fix the drow stuttering without breaking anything else?.

-Galactygon
Posted Image

#13 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 25 April 2012 - 11:45 PM

If you keep the Use EFF File implementation as vanilla, then I would think so. However, you have proposed (I think) to expand the targetting of the opcode based on the params (or externalising on the script). If you want to keep checking targetting for a modded Use EFF File (say, only apply the child effect when the HP < 50% for example), then we should store the Use EFF File opcode in the .cre.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#14 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 26 April 2012 - 10:04 AM

I've always imagined 177 as being a check once opcode, even if the conditions are externalized to allow .bcs use. I'd think for repeating checks, nested spells in opcodes 272 and 232 would do just fine. Thanks for the answer.

-Galactygon
Posted Image





Also tagged with one or more of these keywords: For beta 0024