1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Half a modder's guide to Spell Durations

Discussion in 'Icewind Dale 2' started by Da Rock, Dec 26, 2006.

  1. Da Rock Gems: 5/31
    Latest gem: Andar


    Joined:
    May 31, 2006
    Messages:
    124
    Likes Received:
    0
    If you are happy in ignorance - while playing IWD2 - with spell durations, this is a SPOILER! If you are a programmer (like me - who like to get "behind" the scenes to see what is really happening) or a potential modder, this information could be useful...

    1) Duration

    This is all about spells that last a variable amount of time, based on a casters level. It does not look into "constant" durations, although the fundamentals are the same.

    I came across the oddities with this because I was messing with creating the "missing" 3 spells (Bear's Endurance, Fox's Cunning and Owl's Wisdom) that should accompany Bull's Strength, Cat's Grace and Eagle's Splendor. These 3 spells I was playing with should last 10 minutes/round. Here are a few fields in an .spl file that are used for spell durations (0xnn describes the offset in the .spl file):

    Flags (0x18) = Flag 14: Simplified Duration

    I have no idea exactly what this is, but it seems to be used for most "n rounds/minutes/hours per level" spells (oddly though, Bull's Strength does NOT). Any ideas what this really does would be welcome.

    Spell Duration - rounds / level (0x72)

    For a duration linked with the caster level. This seems to be the important field for most spells, and "0x72" will be referenced quite a bit.

    EFFECT extended header - Duration (0x0e).

    This seems to be set in seconds, where 7 equals a round.

    I saw the whole duration calculation being pretty screwed at first, but the first thing you have to learn is that "minutes" and "hours" are NOT real time (check existing spell descriptions)!
    Now, this is where it gets crazy...

    I picked 4 spells that last 10 minutes/level for reference, after looking at Bull's Strength and Eagle's Splendor. All have simplified duration and have 10 at 0x72. So how can 10 rounds/level equal 10 minutes/level? It got odder from there. Here are the four spells and the "Duration" values in their effects extended header:
    Invisibility = 1680
    Invisibility Sphere = 3000
    Protection From Arrows = 350
    Symbol of Pain = 770

    I am at a total loss as to why 4 spells that last the same amount of time have vastly different extended header effect durations. Are they really 10 minutes/level? Does Simplified Duration negate the need for this extended header duration? Or do these durations only effect enemies?
    Any suggestions would be welcome...

    Crazier still, let us look at 3 priest spells: Bless, Bane and Faerie Fire. All are supposed to last 1 minute/level.
    However, Bless and Bane have 10 at 0x72 (same as 10 minutes/level!), while Faerie Fire has 3. All "Duration" values in the extended header are 0.

    Remember minutes/hours is NOT real time? Well, I decided to test in-game some spells. The times are approximate, give or take a few real time seconds. The following are all described as lasting 1 minute/round:
    Bless (level 1, Battleguard) = 1:10
    Bless (level 1, Battleguard's Domain spell) = 2:23
    Blur (level 3, Illusionist) = 1:02
    Blur (level 4, Illusionist) = 1:23
    Blur (scroll - cast at level 6) = 2:05
    Protection From Evil (level 1, Watcher of Helm) = 0:24
    Protection From Evil (level 1, Watcher of Helm's Domain spell) = 0:41

    However, Bless has 10 at 0x72 (already said) while Blur and Protection From Evil (priest) have 3 at 0x72 (like Faerie Fire).

    There is a surprising discovery of which I wanted to investigate further - this is part 2 below.

    Let us now look at Mage Armor. This was not fun to time, as it is supposed to last 1 hour/level. In fact it lasts about 5:48. What is interesting, is that at 0x72, the value is 50 (rounds/level). Why is it interesting? Well, It is supposed to last 5 times longer than Bless - and it does! Ok, not so interesting, but here are the results (based on my timings being slightly inaccurate):

    One "minute" lasts 3 rounds, or 21 seconds.
    Ten "minutes" lasts 10 rounds, or 70 seconds.
    One "hour" lasts 50 rounds, or 5 minutes 50 seconds (350 seconds).
    Eight "hours" lasts 2400 (e.g. Iron Skins) or 3000 (e.g. Blindness) seconds.
    One "day" lasts 9000 seconds (2.5 hours as opposed to 2 hours the manual specifies).

    Unfortunately, it also shows that the spell description for Bless (and therefore Bane) is wrong. So how many other spells are described with incorrect durations?
    Well, you can see in the above results that either Iron Skins or Blindness is wrong for a start...
    (As a side note, my Eagle's Slendor seems to be a 1st level Enchantment spell, despite it working correctly as a 2nd level Transmutation spell!)

    2) Domain Spells

    From my timings above, I thought "domain spells last twice as long!". So I immediately went to test it on Executioner's Eyes (20 rounds instead of 10 - yes!). This spell has a fixed duration, so I wasn't surprised that it lasted the "correct" amount of time - 10 rounds, or 70 seconds. So I then wanted to know if this anomoly affected ALL "variable" length Domain spells. As usual, I wasted precious seconds of my life timing the following:
    Bless (level 1, Battleguard) = 1:10
    Bless (level 1, Battleguard's Domain spell) = 2:23
    Bless (level 1, Demarch) = 1:10
    Bless (level 2, Battleguard) = 2:20
    Bless (level 2, Battleguard's Domain spell) = 3:28
    Death Armour (level 3, Necromancer) = 0:21
    Death Armour (level 3, Stormlord's Domain spell) = 0:28
    Minor Mirror Image (level 1, Illusionist) = 0:28
    Minor Mirror Image (level 1, Demarch's Domain spell) = 0:35
    Minor Mirror Image (level 2, Illusionist) = 0:35
    Minor Mirror Image (level 2, Demarch's Domain spell) = 0:42
    Sanctuary (level 1, Silverstar) = 0:07
    Sanctuary (level 1, Silverstar's Domain spell) = 0:14

    I did test a couple of other spells and it appears that Domain spells are cast as though they are 1 level higher. What screws this up is Recitation:
    Recitation (level 7, Battleguard) = 0:48
    Recitation (level 7, Battleguard's Domain spell) = 0:48

    The only thing I can think of here is that this spell has no effects as such, but uses the spells EFFR1 and EFFR2 instead (these are what causes the Recitation effect).

    3) Casting time

    The values go from 1 to 10. There are no spell descriptions with a casting time of 10. Why? 10 equals a round, or 7 seconds. So a casting time of 1 equals 0.7 real time seconds.

    [ December 26, 2006, 19:44: Message edited by: Taluntain ]
     
  2. raptor Gems: 16/31
    Latest gem: Shandon


    Joined:
    Feb 13, 2005
    Messages:
    808
    Likes Received:
    1
    Regarding Castingtime: Remember that this is just modified Infinity engine. the previous games using AD&D 2E used "speed factor" or "castingtime" on spells. 3rd edition does not use this anymore, since spells doesnt add bonuses to the "initiative order" in 3E. Basically, castingtime or castingspeed is more likelly than not an old relic from the previous games in the same engine.

    The only things 3E should use is if a spell takes an action, a round or a full turn to cast. unless memory messes up (again) that should be just about the only "castingtimes" used in 3E.

    Also some spells in 2E had a castingtime of 0 iirc, or possible to reduse down to 0 in some situations, so it might be that "1" simply refers to castingspeed of 0 (zero) in that case.

    I can not say for fully certain though :)
     
  3. JT Gems: 12/31
    Latest gem: Moonstone


    ★ SPS Account Holder Veteran

    Joined:
    Jun 19, 2005
    Messages:
    498
    Media:
    11
    Likes Received:
    11
    Gender:
    Male
    There is definitely something wrong with time in IWD2.

    Standard DND 3.0 definitions:

    1 round = 6 seconds
    1 turn = 1 minute = 10 rounds = 60 seconds
    1 hour = 60 minutes = 60 turns = 600 rounds = 3600 seconds

    The problem seems to be that in IWD2, one globe-hour is *not* 600 combat rounds, but much less. I'll test this out soon and post results.
     
  4. Bailey12345 Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Dec 31, 2006
    Messages:
    11
    Likes Received:
    0
    Umm, sorry to get off topic, but have you had any success in creating those missing spells? Itd be nice to get them into my game :)
     
  5. Da Rock Gems: 5/31
    Latest gem: Andar


    Joined:
    May 31, 2006
    Messages:
    124
    Likes Received:
    0
    I'm still working on the spells, while having a (slow) jaunt in NWN2. I've just finished a spell called "Touch of Idiocy", - an enchantment spell that lowers INT, WIS and CHA by D6. It only required 27 ITM files to be created! I am about to start some level 3 spells (e.g. why is there no Protection From Cold?).
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.