Jump to content

Proposal: tweaking invisibility


Recommended Posts

Worth mentioning: I've got Sanctuary working (in EE) with a translucency effect instead of that horrid rippling cylinder overlay. MUCH better.

 

It requires opcode 232, 326, 321, and two different subspells. :jump:

 

Kjeron, am I crazy to go to such lengths? Is there a blur or translucency .VVC I could stick in the resource field, instead?

Link to comment

I think a low-level spell that only grants the "improved" part of improved invisibility would be interesting. As long as it is canceled if you cast a spell or land a hit, as described above. It would require EEs or a custom sectype.

 

That would be quite powerful: -4 AC, +4 saves, and cannot be targeted by spells...

...............................

 

EDIT - I just did a very brief test, and I don't think EE opcode 363 can be used to cancel a stat or spell upon movement. Unless you were thinking of some other method, the movement thing is probably not possible. (I really like the concept, though.)

-4 AC/saves is crazy. To my grief, EE hardcoded these into the opcode itself, and apart from a rather ugly workaround I see no way to change it.

SR didn't allow even 4th level Imp.Invis. to have +4 to saves, yet in EE it does. Albeit it's an interesting idea...

 

I'll see what I can do with 232, but I'm not overly convinced about the outcome.

Yea, I was thinking about Shaman dance thingie (if that's 363). But if it doesn't work... :undecided:

Link to comment

-4 AC/saves is crazy. To my grief, EE hardcoded these into the opcode itself, and apart from a rather ugly workaround I see no way to change it.

SR didn't allow even 4th level Imp.Invis. to have +4 to saves, yet in EE it does. Albeit it's an interesting idea...

 

I don't think it's that crazy in the specific context: you cannot do anything (cast any spell or strike any enemy) or else you lose the bonus. That's why I say it could stand in for Expeditious Retreat (and spoilers, my own spell tweaks mod is going to make this replacement :) ): it only lets you run away, and it makes it hard for enemies to hurt you while you run away. With a low duration, that seems fine to me.

 

As far as the 4th-level spell: yeah, it's a shame that was hard-coded, but I guess there were issues before where, if the bonuses had their own durations, they could keep going even if your semi-invisibility was dispelled. Or something.

 

...

 

Here is my rough plan for tweaking basic invisibility (note, EE-only):

 

1) Make arrays of all spells and items that do basic non-improved invisibility (have to loop through headers/effects... gross.)

 

2) Patch each spell and item on the arrays to add Sanctuary, and Translucency, and opcode 177 triggering effA

 

3) effA uses opcode 232 to cast spellA every 6 seconds (condition = hp% < 102)

 

4) SpellA has opcode 324 filtered by stat_sanctuary = 1, so nothing will happen if you are protected by Sanctuary. It then adds opcode 321 effects canceling every spell and item in the arrays we made above.

 

5) Add opcode 193 to See Invisible and True Sight (SR already has this :) )

 

6) Convert opcode 116 to opcode 136 in See Invisible.

 

Result:

- When you cast basic Invisibility from the 2nd-level spell, the ring, the potion, or similar sources, it will also affect you with Sanctuary and Translucency for the same duration.

- If a mage casts See Invisible, you will lose your invisibility, but will retain your Sanctuary and translucency. Now, that mage can see and target you, but nobody else can.

- If you cast an offensive spell or attack anyone, your will lose your Sanctuary; and the next time SpellA fires, it will cancel the remaining effects form the spell or item - specifically, the translucency and the 177/232 will be canceled. At this point you will be fully visible and anyone can target you with both weapons and spells.

(There will be a slight delay between actually becoming targetable by enemies, and having the translucency go away so that you appear fully visible. What can I tell you, I'm a tinkerer, not a magician.)

Link to comment

-4AC/Saves actually makes sense, whatever crazy it is. But it is really not that much offensive now when you can make your character a kensai/berserker/sorcererer/assassin. What difference it makes? Just make improved invisibility spell unavailable for fighter/mages - only sensible nerf in my opinion.

 

Normal invisibility is more for utility/convenience than combat. Invisibility is especially useful now in SCS era against SCS thieves and their bloody backstab and nasty AI (I observed cases in my own game when Aerie/Yoshi/Jan/Viconia was backstabbed by two or three thieves at the same time). Now Keto is in my party and how I actually use her?(sry) I just cast invisibility on her, turn her AI off and just let her sing all the time and only sing basically. That is why I would prefer you just leave invisibility alone or make it optional component.

Overall, in my opinion the best way/method for invisibility nerf is by adding "see invisible" ability to certain enemies not by nerfing invisibility itself.

 

 

Dude, just cast stoneskin.

uhmm...no.

Link to comment

Now Keto is in my party and how I actually use her?(sry) I just cast invisibility on her, turn her AI off and just let her sing all the time and only sing basically. That is why I would prefer you just leave invisibility alone or make it optional component.

Yeah, that's realistic. It's not like anyone could see her being the loudest thing in the room.

Yeah, bards song needs to reveal and dispel the users invisibility. Be it cast from mage spell level 1 or 9. I like the 6 seconds of leed time, and even movement breaking it(the regular non targetable invisibility)... with illusion based protections with Improved Invisibility & all, can stay.

Also, Liches HAVE TO BE immune to "invisibility", they can project themselves and utilize Simulacrum's etc, but that's different from invisibility. As those break exactly at the time the projection is destroyed.

Edited by Jarno Mikkola
Link to comment

 

Now Keto is in my party and how I actually use her?(sry) I just cast invisibility on her, turn her AI off and just let her sing all the time and only sing basically. That is why I would prefer you just leave invisibility alone or make it optional component.

Yeah, that's realistic. It's not like anyone could see her being the loudest thing in the room.

 

This is spot on imo. But in my mind, it goes beyond bard singing. Humans don't depend on their sight alone; you can notice things that aren't in your vision range by other senses. Combat is loud. You can hear footsteps. As I said, I'd only nefr "normal" invisibilty; Imp. version I can live with by imagining it being more "magical" so one can'be detected at all.

What could be done is a regexp patch - if a creature is; example; animal, kobold, gibberling, human with sufficent intelligence etc. to give them ability to remove invis if you venture close enough.

Link to comment

For funsies, here is some drop-in code (for EE2.0+) to make Sanctuary use a translucency like Invisibility, rather than the horrid ripple-cylinder:

ACTION_IF FILE_EXISTS_IN_GAME ~enginest.2da~ BEGIN
  APPEND ~splprot.2da~ ~5ANCTUARY%TAB%63%TAB%1%TAB%4~
  COPY_EXISTING ~splprot.2da~ ~override~
    COUNT_2DA_COLS cols
    READ_2DA_ENTRIES_NOW rows cols
    FOR (row = 1; row < rows; ++row) BEGIN
      READ_2DA_ENTRY_FORMER rows row 0 ~stat~
      PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~5ANCTUARY~ BEGIN
        SET sanct_row = %row%
      END
    END
  BUT_ONLY
  CREATE EFF ~sppr109~
    WRITE_LONG 0x10 232
    WRITE_LONG 0x14 1
    WRITE_LONG 0x20 20
    WRITE_LONG 0x28 60
    WRITE_SHORT 0x2c 100
    WRITE_ASCII 0x30 ~SPPR109A~ #8
    WRITE_LONG 0x48 102
  COPY_EXISTING ~sppr109.spl~ ~override/sppr109a.spl~
    LPF DELETE_EFFECT INT_VAR match_target = 1 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 power = 0 parameter1 = 0 timing = 1 STR_VAR resource = ~SPPR109~ END
    LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 324 target = 1 power = 0 parameter2 = %sanct_row% timing = 1 STR_VAR resource = EVAL ~%SOURCE_RES%~ END 
  COPY_EXISTING ~sppr109.spl~ ~override~
    LPF ALTER_EFFECT INT_VAR silent = 1 match_opcode = 153 parameter2 = 1 STR_VAR resource = ~~ END
    LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 153 opcode = 59 parameter1 = 25 parameter2 = 0 STR_VAR insert = ~first~ END
    LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 153 opcode = 275 parameter1 = 25 parameter2 = 0 STR_VAR insert = ~first~ END
    LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 153 opcode = 66 parameter1 = 128 parameter2 = 0 STR_VAR insert = ~first~ END
    LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 153 opcode = 177 target = 1 parameter2 = 2 parameter1 = 0 STR_VAR resource = ~sppr109~ insert = ~last~ END
END


That's only for the spell Sanctuary, SPPR109.SPL. Using the Sanctuary effect and giving it translucency elsewhere is more involved, I'm still working on it.

 

Just for fun, it includes a 25% bonus to stealth, so it is a bit more useful for rangers and cleric/thieves.

Edited by subtledoctor
Link to comment

Humans don't depend on their sight alone; you can notice things that aren't in your vision range by other senses. Combat is loud. You can hear footsteps. As I said, I'd only nefr "normal" invisibilty; Imp. version I can live with by imagining it being more "magical" so one can'be detected at all.

What could be done is a regexp patch - if a creature is; example; animal, kobold, gibberling, human with sufficent intelligence etc. to give them ability to remove invis if you venture close enough.

I think the easier method is to simply give those creatures opcode 193 to smell/hear you. Or, something like, have opcode 193 constantly toggling on and off, so they can attack an invisible creature for 2 rounds, then they lose it, and then two rounds later they can attack it again, etc. etc. You could code this as an ongoing effect on certain CREs, or you could have it be an aura radiating from invisible creatures. (Although in that case, two or more invisible creatures are in the same vicinity would interfere with the timing of it.)

 

Although... even if someone does smell or hear you when you're invisible, they should still have a penalty when attacking you - not seeing the thing you smell or hear is pretty disconcerting. Which brings me back to the idea of adding an "improved" invisibility effect to "base" invisibility, in a way that is canceled when your invisibility is canceled. You don't even need to use the "improved invisibility" opcode - you can just make a subspell with -2 AC or something, and set it to be canceled when your invisibility goes away, in exactly the same fashion my translucency effect for SPPR109 goes away a few seconds after your Sanctuary goes away.

 

Poop, now that I've said it, I might as well implement that one too. :p

Edited by subtledoctor
Link to comment

You don't even need to use the "improved invisibility" opcode - you can just make a subspell with -2 AC or something, and set it to be canceled when your invisibility goes away, in exactly the same fashion my translucency effect for SPPR109 goes away a few seconds after your Sanctuary goes away.

 

Poop, now that I've said it, I might as well implement that one too. :p

You might want to set it so you have more than one subspell that one can have only one(highest) to count as a bonus. As the invisibility casters level tends to scale, while the effect doesn't. So it should fix that issue too.
Link to comment

And for poops and giggles, here is some code to convert Pro Petrification/Expeditious Retreat into my "Chameleon" spell:

COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~
    LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~SPWI108~ END
 BUT_ONLY

 COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
    LPF ADD_ITEM_EFFECT INT_VAR type = 99 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~SPWI108~ END
  END
 BUT_ONLY

 COPY_EXISTING ~spwi108.spl~ ~override/spwi108x.spl~
    LPF DELETE_EFFECT INT_VAR match_opcode = 321 END
    LPF DELETE_EFFECT INT_VAR match_power = 1 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 21 power = 1 target = 1 parameter1 = 1 timing = 1 duration = 0 resist_dispel = 0 END
    LPF ALTER_SPELL_HEADER INT_VAR speed = 1 END
    WRITE_BYTE 0x19 (THIS BOR 0b00000100) // set "hostile" flag
    SAY NAME1 ~~
    SAY UNIDENTIFIED_DESC ~~

 COPY_EXISTING ~spwi108.spl~ ~override~
    WRITE_BYTE 0x1f (THIS BAND 0b11011111)                // don't forbid transmuters
    WRITE_BYTE 0x1f (THIS BOR 0b00010000)                 // forbid necromancers
    WRITE_BYTE 0x25 5                                     // illusion school
    WRITE_SHORT 0x22 13                                   // illusion animation
    WRITE_ASCII 0x10 ~CAS_M01~ #8                         // illusion sounds
    LPF DELETE_EFFECT INT_VAR match_opcode = 321 END
    LPF DELETE_EFFECT INT_VAR match_power = 1 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 20 power = 1 target = 1 parameter2 = 1 timing = 0 duration = 30 resist_dispel = 3 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 92 power = 1 target = 1 parameter1 = 25 timing = 0 duration = 30 resist_dispel = 3 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 59 power = 1 target = 1 parameter1 = 25 timing = 0 duration = 30 resist_dispel = 3 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 275 power = 1 target = 1 parameter1 = 25 timing = 0 duration = 30 resist_dispel = 3 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 power = 1 target = 1 parameter2 = 0 timing = 1 STR_VAR resource = ~SPWI108x~ END
    LPF ALTER_SPELL_HEADER INT_VAR target = 5 END
    SAY NAME1 ~Chameleon~
    SAY UNIDENTIFIED_DESC ~Chameleon: this spell makes you camouflaged and hard to hit, but if you cast a spell or strike someone, its effects will end.~

This makes you "improved" invisible but not "normal" invisible (so, targetable by weapons but not by spells), with a 4-point bonus to AC and saves, as well as a 25% bonus to Stealth and Pick Pockets. (Good for mage/thieves!) If you cast a spell, or if you strike someone, or after 5 rounds, the spell ends.

Edited by subtledoctor
Link to comment

...aaand, if anyone's interested in taking some of these ideas for a spin, I've implemented several of them in my fork of Tome and Blood, in the new "Spell Tweaks: Revised Invisibility" component.

 

(It also has fun new stuff like specialists being able to use normal memorization slots to spontaneously cats any spell in their specialty school, revised illusionary clones, simplified armored casting, and bonus spells for high stats.)

 

EE 2.0+ only - sorry, I've simply become too dependent on the EE-only stuff. Basically opcode 321 and SPLPROT.2DA.

Link to comment

About this. I personally *hate* invisibility spells, potions, rings etc. It makes stealth skill virtually useless. So, I'd like to change this a bit. Am not sure how however - but something among these lines:

1) if you're alone (no PCs around you) invisibility works as it does now

2) if you're surrounded by enemies, they have a %-based chance of noticing you.

3) if you move, you become visible

 

Now, I'm wondering about the implementation.

Another idea, which again requires EE because I'm sorry, the EE 2.0 opcodes are Just. Too. Useful.

 

When you are invisible (but NOT improved invisible), you could radiate an aura that has a small chance of granting 193 'invisibility detection by script' to nearby enemies. And, thanks to opcode 326 and SPLPROT.2da, we can make the chance of it happening dependent on your Stealth skill. In fact, we can make it specifically dependent on the Move Silently skill, rather than Hide in Shadows. :D

 

Something like, 30% on any given round that enemies within 10' can detect you. If your MS > 40%, drop it to 20% chance. If your MS > 70%, drop it to 10% chance. If your MS > 99%, drop it to 0% chance.

 

Btw we could actually do something similar for Hide in Shadows: you know the stupid part of the mid-game where your stealth skills are around 40-60%, and you keep pressing "Hide" until it succeeds? We could put a repeating effect on rogues polling their HiS skill, and give them a boost so that you are more likely to succeed if your HiS is higher. But when you are hidden/invisible, the boost changes to a modier based on your MS skill. So now your chance to stay hidden is dependent on the average of the HiS and MS skills. It's would be a bit complicated, but I think it's doable.

 

Combine those two ideas, and you (finally) end up with differentiation between HiS and MS: HiS makes it easier to hide, and MS makes it easier to stay hidden. :D

 

And the way it works in practice would probably be: at low levels you prioritize HiS because it would let you hide, get behind an enemy in 6 seconds, and backstab; but that means at these low levels invisibility will be unreliable. Invisibility would get more reliable at higher levels, as you build up your MS skill. And invisibility will never be totally reliable for fighters/clerics/etc.

Edited by subtledoctor
Link to comment

Btw here's more code that might be useful to people: create arrays of all spells and items that make you invisible, but not improved invisible.

 

 

  OUTER_SET invis_spell_index = 0

  OUTER_SPRINT $d5_invisibility_spells(~%invis_spell_index%~ ~timing~ ~duration~) ~spell~

  COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~
   PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
    SET invis_spell = 0
    READ_LONG 0x64 abil_offset
    READ_SHORT 0x68 abil_number
    READ_LONG 0x6a eff_offset
    PATCH_IF (abil_number > 0) BEGIN
      READ_SHORT (abil_offset + 0x1e) eff_number
      WHILE (%eff_number% > 0) BEGIN
        SET eff_number = (%eff_number% - 1)
          READ_SHORT (%eff_offset% + (eff_number * 0x30)) eff_opcode
          READ_SHORT (%eff_offset% + (eff_number * 0x30) + 0x8) param_2
          READ_BYTE (%eff_offset% + (eff_number * 0x30) + 0xc) eff_timing
          READ_LONG (%eff_offset% + (eff_number * 0x30) + 0xe) eff_duration
          PATCH_IF (%eff_opcode% = 20) BEGIN
          PATCH_IF (%param_2% = 0) BEGIN
            SET invis_spell = 1
            SET invis_timing = %eff_timing%
            SET invis_duration = %eff_duration%
            SET ++invis_spell_index
          END
          PATCH_IF (%param_2% = 1) BEGIN
            SET invis_spell = 0
            SET eff_number = 0
          END
        END
      END
      PATCH_IF (invis_spell = 1) BEGIN
        TEXT_SPRINT $d5_invisibility_spells(~%invis_spell_index%~ ~%invis_timing%~ ~%invis_duration%~) ~%SOURCE_RES%~
      END
    END
   END
  BUT_ONLY

  ACTION_PHP_EACH d5_invisibility_spells AS index => spell BEGIN
    ACTION_IF (%index% > 0) BEGIN
      PRINT ~%index% - %spell% - %index_1% - %index_2%~
    END
  END

  OUTER_SET invis_item_index = 0

  OUTER_SPRINT $d5_invisibility_items(~%invis_item_index%~ ~timing~ ~duration~) ~item~

  COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
   PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
    SET invis_item = 0
    READ_LONG 0x64 abil_offset
    READ_SHORT 0x68 abil_number
    READ_LONG 0x6a eff_offset
    PATCH_IF (abil_number > 0) BEGIN
      READ_SHORT (abil_offset + 0x1e) eff_number
      WHILE (%eff_number% > 0) BEGIN
        SET eff_number = (%eff_number% - 1)
          READ_SHORT (%eff_offset% + (eff_number * 0x30)) eff_opcode
          READ_SHORT (%eff_offset% + (eff_number * 0x30) + 0x8) param_2
          READ_BYTE (%eff_offset% + (eff_number * 0x30) + 0xc) eff_timing
          READ_LONG (%eff_offset% + (eff_number * 0x30) + 0xe) eff_duration
          PATCH_IF (%eff_opcode% = 20) BEGIN
          PATCH_IF (%param_2% = 0) BEGIN
            SET invis_item = 1
            SET invis_timing = %eff_timing%
            SET invis_duration = %eff_duration%
            SET ++invis_item_index
          END
          PATCH_IF (%param_2% = 1) BEGIN
            SET invis_item = 0
            SET eff_number = 0
          END
        END
      END
      PATCH_IF (invis_item = 1) BEGIN
        TEXT_SPRINT $d5_invisibility_items(~%invis_item_index%~ ~%invis_timing%~ ~%invis_duration%~) ~%SOURCE_RES%~
      END
    END
   END
  BUT_ONLY
 
  ACTION_PHP_EACH d5_invisibility_items AS index => item BEGIN
    ACTION_IF (%index% > 0) BEGIN
      PRINT ~%index% - %item% - %index_1% - %index_2%~
    END
  END
Link to comment

Final thought for the day: what about the mid-level anti-illusion spells? There is this weird mismatch where (assuming the tweaks in this thread work) mages can use a 2nd-level spells to see invisible enemies... but priests cannot. And then priests can use a 3rd-level spell to dispel all invisibility... but mages cannot. And mages can use a 3rd-level spell to dispel low-level illusions... but priests cannot. And then mages can use a 5th level spell to dispel mid-level illusions.

 

So basically priests can blast away any invisibility effects, no matter how powerful, but they cannot dispel a simple Reflected Image until True Sight comes along.

 

And Mages can get progressively better at dispelling illusions... but they can't dispel a Shadow Door or Pixie Dust until Oracle.

 

Should these things be reconciled? I'm mostly thinking about Invisibility Purge vs. Detect Illusion, both at 3rd level. Should they be merged into a single spell of uniform application? I hate stuff like the vanilla versions, where DI can dispel 4th-level Imp. Invisibility but not 5th-level Shadow Door, even though Shadow Door just applies the 4th-level spell to the caster. How does that make sense?

Link to comment

differentiation between HiS and MS: HiS makes it easier to hide, and MS makes it easier to stay hidden. :D

these skills already work this way; even in old engine. :)

And I can't make the spell work so differently for old vs new engine....I'd rather polish what's there now, and after that do only EE stuff.

 

Final thought for the day: what about the mid-level anti-illusion spells?

......................

Should these things be reconciled? I'm mostly thinking about Invisibility Purge vs. Detect Illusion, both at 3rd level. Should they be merged into a single spell of uniform application? I hate stuff like the vanilla versions, where DI can dispel 4th-level Imp. Invisibility but not 5th-level Shadow Door, even though Shadow Door just applies the 4th-level spell to the caster. How does that make sense?

Heh...If you knew how much I hate all this anti-invisibility; anti-spell protection, anti-weapon immunity nonsense......

If SR was mine alone; I'd remove half of the illusion spells from the game altogether (ditto spell protections/removals).

Less is more in this case, imo -but my hands are tied on this. Demi always wanted to include a spell for each school at each level. Example, I wanted to remove the Oracle spell and replace it with True Seeing for the AI (the difference 5-6th level is minor). But that leaves 5th level slot for Divination empty....

And, believe it or not, I don't know how half of these illusions/dispel illusions spells even work in SR to begin with :rolleyes: - I only use priest version in BG1 (I think it's level 3 Dispel invisibility...or Purge?) and for mages level 6 True Seeing (BG2-ToB).

And that's the only two (three, if you count priest's True Seeing) spells I'd leave in the game. I agree that there's no point in having 5-6 spells dedicated to removing illusions.

To make Mirror Images less annoying, I'd make all AoE spells not only bypass them, but destroy them instantly....that's actually already doable :D

All being said, I'll think about the possible revisions to the system.

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...