Jump to content

[code] Code fixes, aka stuff we can't fix


CamDawg

Recommended Posts

On 3/19/2022 at 11:18 PM, CamDawg said:

Thought it might be good to have a thread of stuff that's broken but requires fixes in the engine itself. This is stuff that, generally, EEFP won't be able to fix.

I'll start with an oldie but goodie: using the auto-pause for 'spell cast' causes all sorts of issues. To replicate, start an IWDEE game with a druid and at least one other character. Memorize some Sunscorch spells on your druid, rest your party, and enable 'Spell Cast' on the auto-pause menu. Cast Sunscorch on the other party member.

Pausing on the moment the spell is cast causes each individual effect in the spell to be rolled separately for saves and probability. In the attached screenshot, the target has made their save against the actual blind effect, but failed the save for the blind icon, 'blinded' message, and damage. These effects should all roll one save collectively and either all be blocked or succeed.

Icewn011.png

Wait, in my last EET playthrough I enabled auto pause on spell cast because it was very convenient to immediately cast another spell without wasting time.

Are you telling me that feature was broken and is still broken in a EET game? Or are you just talking about IWDEE?

Link to comment

The bug in question affects all games.

I don't think it's a problem with the auto-pause feature exactly; a manual pause on the exact tick that a spell goes off would likely also decouple that spell's saves from each other. It's just that auto-pausing whenever you cast a spell will do that all the time.

Most of the time, it's a cosmetic bug. There aren't that many spells with multiple real effects that all have saves.

Link to comment
Just now, jmerry said:

The bug in question affects all games.

I don't think it's a problem with the auto-pause feature exactly; a manual pause on the exact tick that a spell goes off would likely also decouple that spell's saves from each other. It's just that auto-pausing whenever you cast a spell will do that all the time.

Most of the time, it's a cosmetic bug. There aren't that many spells with multiple real effects that all have saves.

Could there be any problems beside icons showing anyway even if the save roll against the effect succeeded?

If the problem is purely cosmetic, I could keep auto save on spell cast, right?

Link to comment

Icons showing even if the effect was saved against, log messages that say it worked on the enemy even if it didn't. missing log messages and icons even if the effect succeeded ... it varies widely. And it depends on the spell. Spells with multiple categories of effect, like Sunscorch in the screenshot with both blindness and damage, can have the saves for those parts decoupled. One enemy blinded but not damaged, another damaged but not blinded - it's not purely cosmetic with that spell.

And even in the cases when it's purely cosmetic, it's affecting the feedback you use to plan strategy. Cosmetic bugs matter too. Nobody's stopping you from using that feature - but if you do, you were warned.

Link to comment
On 3/13/2023 at 1:28 AM, jmerry said:

Most of the time, it's a cosmetic bug. There aren't that many spells with multiple real effects that all have saves.

There are (Prismatic Spray, Sphere of Chaos etc., note that this bug interferes with each effect in the block in terms of not only saving throws but percentile probabilities too, they're rolled separately if pause on autocast or one roll is used if not). It's also not really cosmetic to have someone confused without associated string/visuals/portrait icon because you won't know what's wrong with them (depending on how they behave confusion can be mistaken for fear, feeblemindedness etc.).

However, it only matters for spells without associated projectiles, which provide the needed time delay for the autopause to decouple from the effects in the spell's feature block, so fortunately stuff like Prismatic Spray always worked as intended. Sunscorch could simply be given a very fast projectile (I'm sure some other modder has already thought of this).

Link to comment

Besides Sunscorch and Vampiric Touch, the Command spell should probably also be given a fast projectile rather than none.

Power Word spells besides PW:Blind have no projectile last I checked, but also no save and 100% probability off all effects in the block, so need not be modified (for this issue anyway).

Link to comment

Here's one, this time for projectiles:

The ray-based projectiles use the caster and explosion coordinates to calculate subsequent ray orientation. Not an issue for 95% of the cases because the launch point of the parent projectile roughly coincides with the caster's x,y position. For the remaining 5% of the cases (i.e. traps or caster moves during Time Stop or large dragons) where the launch point doesn't coincide with the caster's x,y the rays' directions appear to be calculated in a seemingly odd manner.

An example where this can be reliably repro-d is any of the innermost ground traps in the room at x1970 y2300 in AR9714 of IWD:EE which cast Lightning Bolt. Normally, the Lightning Bolt projectile starts as a normal projectile that creates an explosion of a single ray that then continues onwards in the same direction for a set time/distance. To the player this appears to be a projectile that transforms itself from a honing single-target non-bouncy projectile into a hit-all-in-path bouncy projectile when reaching the initial destination, continuing onward in the same direction. In this repro case in IWD:EE, the Lightning Bolt changes direction upon hitting the initial target. The reason being is that the trap's x,y position is the center of the bounding box of the trap area which is different from the launch point of projectiles launched by the trap. So the PC's x,y position relative to the center of the trap is used to determine the direction of the ray which is incorrect. The issue is that the rays should be calculated based on the launch point of the parent projectile rather than the caster's (in this repro case trap's) x,y position.

A different and easy way to repro this is to cast Lightning Bolt during a Time Stop and move your caster to a different position relative to the target. The Bolt will continue onwards relative to the updated x,y position of the caster rather than the launch point of the original projectile.

Link to comment

Some more which persisted since the original game:

Personal space and foot circle size of the source isn't taken into account when calculating range as well as LOS. This can be best repro'd as follows:

- Store a touch-range spell in a sequencer i.e. Vampiric Touch or Cure Wounds. Walk next to a target and fire the sequencer at a close range. The stored touch spells will fail to launch because their range is calculated from the caster's center x,y to the target (center x,y?)

- Cause blindness in a creature with large personal space such as a dragon and it will never react to melee attacks.

Link to comment

This one has been around since the original game as well:

You're unable to cast (Limited) Wish after you reached the summoning limit even though the genies you summon do not have GENDER=SUMMONED set. The summoning opcodes seem to prevent new creatures from appearing once the limit is reached without checking for GENDER.

Link to comment
On 5/22/2022 at 9:21 AM, Bubb said:

op236, param2=3 (Simulacrum) is supposed to apply a level-drain effect to the clone equal to [(average of LEVEL, LEVEL2, LEVEL3) * 40%]. The code is bugged for dual class characters -- instead of using the character's average level it uses the level count of the original class.

This means dual class mages usually end up with Simulacrums that are substantially more powerful than intended.

oBG2/BG2EE uses average level for simulacrum, not affected

Edit: EE bug, not origial BG2 engine

Edited by Insomniator
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...