The World of Layonara  Forums

Author Topic: Ball lightning  (Read 456 times)

Hellblazer

Ball lightning
« on: April 25, 2009, 11:19:36 pm »
Where: silkwood forest

description: I was with phobo tried fighting the werewolf that were barely 20 feet away and all I could do is fling one ball lightning to the werewolf I had targeted.

Later on we went to fight the spiders, still in silkwood, again not even thirdy feet away from the group i tried to use ball lightning, only one got shot to the target, but when they swarmed us, now it decided to work. But too late, we were dead about three seconds later.

Could it be that the distance got skewed, to work withing less than 4 meters?
 
The following users thanked this post: davidhoff

Dorganath

Re: Ball lightning
« Reply #1 on: April 26, 2009, 12:25:11 am »
Ball Lightning and Firebrand (similar spells, just different damage) have always, as far as I have seen, appeared to shoot only a single "missile" that arcs toward a target when there is a single target in range of its AoE.  If you look at the damage though, it's in line with what the spell should have done.

The radius for Ball Lightning is the same as it is for Firebrand and all the other missile storm spells, that being 8.33m.  This has not changed.
 

Hellblazer

Re: Ball lightning
« Reply #2 on: April 26, 2009, 01:35:38 am »
The problem is that they were all in the AOE range

Dorganath

Re: Ball lightning
« Reply #3 on: April 26, 2009, 01:49:35 am »
I'll see if this can be confirmed in some way, but distances in-game seem shorter than they are mechanically. The Ball Lightning spell shares code with Firebrand and ILMS/IGMS, with different options, of course.

Just from personal experience with the spell, it's usually best to target Ball Lightning (and other missile storm spells) to the ground  in the midst of a group of targets rather than on the target itself, as the AoE then is not targeted around a creature that will move as soon as you cast, but on a bit of ground that is at or near the middle of them.
 

Hellblazer

Re: Ball lightning
« Reply #4 on: April 26, 2009, 02:03:56 am »
Well if it helps visualize. One of the werewolf were literally about 8 running steps away and it only shot one ball lighting to the one i was targeting while the other one was right in my face.

But Aye, I'll wait to see the results.

Ball lighting can't be targeted on the ground though, really :\\? I'll try it to be sure, but from memory the cursor only allows it to be cast when it is on a target.

Ball ligthning

Hellblazer

Re: Ball lightning
« Reply #5 on: April 26, 2009, 02:23:00 am »
I'll be , whished I knew that trick sooner hehe, but still I noticed the bug again against the mercs near the glooms wood. Four in front, casted while targeting down, only 3 ball lightning went off, all going to the ones on the far forward right, while the one nearer and to the left wasn't touched.

Dorganath

Re: Ball lightning
« Reply #6 on: April 26, 2009, 03:50:24 am »
I don't know what to tell you, except that I think your perception of the radius should be differs from what Bioware calculates it to be.  I don't know if you know anything about NWN scripting, but here's a snip of the targeting loop:
Code: [Select]
   oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE);
    //Cycle through the targets within the spell shape until an invalid object is captured.
    while (GetIsObjectValid(oTarget) && nCnt <= nEnemies)
    {
        // * caster cannot be harmed by this spell
        if (spellsIsTarget(oTarget, SPELL_TARGET_SELECTIVEHOSTILE, OBJECT_SELF) &&
           (oTarget != OBJECT_SELF) &&
           (( GetObjectType(OBJECT_SELF) == OBJECT_TYPE_PLACEABLE ) ||
           (GetObjectSeen(oTarget,OBJECT_SELF))))
        {
                //Fire cast spell at event for the specified target
                SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpell));

                // * recalculate appropriate distances
                fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
                fDelay = fDist/(3.0 * log(fDist) + 2.0);

                // Firebrand.
                // It means that once the target has taken damage this round from the
                // spell it won't take subsequent damage
                if (nONEHIT == TRUE)
                {
                    nExtraMissiles = 1;
                    nRemainder = 0;
                }

                int i = 0;
                //--------------------------------------------------------------
                // GZ: Moved SR check out of loop to have 1 check per target
                //     not one check per missile, which would rip spell mantels
                //     apart
                //--------------------------------------------------------------
                if (!MyResistSpell(OBJECT_SELF, oTarget, fDelay))
                {
                      for (i=1; i <= nExtraMissiles + nRemainder; i++)
                    {
                        // damage per missile applied here, cut out for brevity

                    }


                } // for
                else
                {  // * apply a dummy visual effect
                 ApplyEffectToObject(DURATION_TYPE_INSTANT, eMissile, oTarget);
                }
                nCnt++;// * increment count of missiles fired
                nRemainder = 0;
        }
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_GARGANTUAN, lTarget, TRUE, OBJECT_TYPE_CREATURE);
    }

So you see, it gets every creature within a radius of RADIUS_SIZE_GARGANTUAN (or 8.33 meters).  For Ball Lightning and Firebrand, the nONEHIT value is set to TRUE so only one missile is generated per target.  Keep in mind that one tile in NWN is a 10m x 10m square. What's in the middle doesn't matter much.  The key things are the GetFirstObjectInShape(...) and GetNextObjectInShape(...) calls, which ultimately loop through every creature centered around lTarget (a location, either the ground or the physical location of the directly-targeted creature) at the time the spell goes into effect.

It's also important to note that the target list is determined when the spell actually fires off, not when you click the target cursor and it starts casting.  This is an important nuance, as your intended targets may have shifted between when you start casting and when the spell actually fires off, since there's about 1.5 seconds between casting and casted.  The perception of what is in your AoE can also be skewed by normal network lag (I don't mean heavy, palpable server lag), as what is "seen" by the server and the client can differ at any given moment.

I hope this helps to clarify what you may be seeing.
 

Hellblazer

Re: Ball lightning
« Reply #7 on: April 26, 2009, 10:58:52 am »
It does, still though it doesn't explain my problem when I had the two werewolf near me (clearly withing the radius) and the one that was hitting me was not targeted while the one that was about 8 running steps (not sure what the distance of a running step is in game) was the only one who got fired upon.

If the 8.3 meter is accurate, which I totally don't doubt it is, both should have been fired upon.

When I tested it on the mercs though, the one of the left that wasn't fired upon probably was out of the targeted radius.

I'm starting to feel that it was a fluke that happened twice in a row. Thanks though.

Dorganath

Re: Ball lightning
« Reply #8 on: April 26, 2009, 11:09:24 am »
Well my best guess is that the nearest werewolf was just out of range of the targeted one by the time the spell fired.

The distance of a running step could easily be 1m (or slightly more) for an average human male (about 1.8m in height), which I believe is the size intent for the human/half-elf model in NWN.  So 8 running steps is 8-ish meters, possibly a bit more.  With 0.33m being about roughly the length of that same human male's forearm, it doesn't work out to too much distance in-game.  

Unfortunately, NWN doesn't have nifty overlay targeting circles like some other newer games do so you can see the intended area of effect and know for sure what you're targeting.
 

Hellblazer

Re: Ball lightning
« Reply #9 on: April 26, 2009, 11:22:55 am »
Agreed on that. Thanks for the help Dorg.

davidhoff

Re: Ball lightning
« Reply #10 on: April 26, 2009, 06:29:03 pm »
I will confirm Hellblazer's concern on ball lighting.  I normally use firebrand.  This time I decided to test ball lightning out in the Vehl Crypts as I gathered skeleton knuckles.

On one occasion I had three skeletons run at me hip-to-hip about 10 meters from me.  I casted on the one in the middle and only one ball fired off.  Another time I casted at a group of about 5 skeletons that were runing at me; they were grouped in a circle about 6 meters in diameter; I targeted the one in the back.  Only two balls shot off.  However, another time I had three skeletons right up on me swinging and casted and three balls shot off.

If I were using firebrand in the above scenarios I am confident all target would have been hit based on past exerience.  I was pretty disapointed in the spell at the time and made a mental note not to use it in the future.

As a related note, I have never seen anyone use ball lightning in game, where I have seen many players use firebrand...maybe this could be part of the reason why no one uses it?
 

Dorganath

Re: Ball lightning
« Reply #11 on: April 26, 2009, 07:38:15 pm »
Quote from: davidhoff
I will confirm Hellblazer's concern on ball lighting.  I normally use firebrand.  This time I decided to test ball lightning out in the Vehl Crypts as I gathered skeleton knuckles.

On one occasion I had three skeletons run at me hip-to-hip about 10 meters from me.  I casted on the one in the middle and only one ball fired off.  Another time I casted at a group of about 5 skeletons that were runing at me; they were grouped in a circle about 6 meters in diameter; I targeted the one in the back.  Only two balls shot off.  However, another time I had three skeletons right up on me swinging and casted and three balls shot off.

If I were using firebrand in the above scenarios I am confident all target would have been hit based on past exerience.  I was pretty disapointed in the spell at the time and made a mental note not to use it in the future.

Firebrand and Ball Lightning both call DoMissileStorm(...) in x0_i0_spells.nss.  For a "close enough" look, you can load up the NWN toolset and pull up this spell script and see what it does.  IGMS and ILMS also call this same routine.

The only difference, code-wise, between the actual Firebrand and Ball Lightning scripts is that Firebrand is called with parameters for fire damage and flame-looking arrows, where Ball Lightning is called with parameters for electrical damage and zappy-looking missiles.

It's a little difficult to say "If I'd been using Spell X it would have worked" because no two targeting scenarios are ever exactly the same.

Both spells use the same core code.

Quote
As a related note, I have never seen anyone use ball lightning in game, where I have seen many players use firebrand...maybe this could be part of the reason why no one uses it?

I've used both spells for years now with proper effect.  I have seen both spells behave exactly the same in terms of targeting, number of missiles, etc. Most people don't use it, in my opinion, because things like undead and a bunch of other creatures tend to have fire vulnerability.
 

Ravemore

Re: Ball lightning
« Reply #12 on: April 26, 2009, 08:18:31 pm »
I used it today seveal times with no issues. I like the idea of targeting the ground instead of a creature, tried it for the first time today because I was unaware you could do it with that spell..
 

 

anything