Trinitycore: PBAOEs having less radius than what tooltip says

Created on 11 Nov 2011  路  29Comments  路  Source: TrinityCore/TrinityCore

Core revision: 583f6575e1976e177f6c0234bce1914cc91280ae
Db: TDB 335.11.43 + every update in this core revision

Afaik this bug is present in every revision.

Steps to reproduce the bug (having a gm account):

  1. Find an attackable npc which stays in place and doesn't move (I used Booty Bay's guards);
  2. using command .distance, position yourself 9.9y away from that npc (use 3D distance, NOT exact 3D);
  3. cast an AOE of your choice which has 10y radius. For GTAOEs you can use ".cast #spellid" to cast it precisely at your coordinates.

What should happen: the npc is hit by the aoe.
What appens instead: the npc is not hit by the aoe (is out of range).

Steps to reproduce the bug (not having a gm account):

  1. Take a rogue and a friend warrior (or whatever class han a 10y radius AOE), bring them to Gurubashi Arena (if they are of the same faction);
  2. use the range check from rogue's untalented Blind spell to position yourself between 9-10y yards away from the warrior (note: DO NOT use talented Sap to do this, it won't work);
  3. make the warrior cast Demoralizing Shout: you won't be hit.

By using .distance command and making some tries you'll discover that the AOE has an actual radius of 8.5y instead of 10y.
After some more tests you can find that every AOE has 1.5y radius less than the one written in tooltip.

Now, I know that every Unit has a fixed value (called COMBAT_REACH or MELEE_REACH if i remember right) which is used in calculating distance between 2 Unit and doing range checks for spells using a similar formula:

FinalRange = ExactDistanceBetweenUnits(Caster, Target) + Caster.MELEE_REACH + Target.MELEE_REACH

MELEE_REACH for Players is exactly 1.5y so my question is: Is this a bug or is normal because AOEs should not consider caster's MELEE_REACH? (if you think about it, an AOE is centered in a particular spot determined by coordinates so there is no reason why a point of size 0 should have a MELEE_REACH).

Update: this is bugged only for PBAoE, other AoEs are ok this way. The bug is that they don't count caster's size in rangechecks.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Branch-3.3.5a Branch-4.3.4 Branch-master Comp-Core Sub-Spells

Most helpful comment

Not hitting at 8.06 of EXACT distance. If this was supposed to include combat reach or bounding radius, it should be hitting up to 9.5 (if including caster reach) or 11 yards (including both target and caster reach) of exact dist. This is clearly not the case
obraz

Both screenshots are from retail today

All 29 comments

Why this issue has been closed?

AOE spells shouldn't use caster's size for calculating radius, at least that's what we think currently. For melee single target spells are using caster radius (like blind), so that's why your check failed. Range check for melee targets matches what's done in client, so it's totally blizzlike, current aoe check is right in our opinion, but there may be a tiny chance that it's wrong, so maybe someone should check that for us on retail.

QAston, I think that this is correct for every aoe except PBAoE: they are centered on the caster, so they should probably consider caster's size like other spells. If someone wants to check it on retail, he should do it for both GTAoE and PBAoE

Confirm what PKX is saying, all AOE spells with area centered to caster (for example Arcane Explosion) have a reduced radius, for example they have 8.5 yard radius instead of 10 yard. In general the radius of those spells is reduced of 1.5 yard.

I've noticed an interesting thing: if you make a big mob cast a PBAoE (ex. use ".cast back 48078 tr" on creature 32482) the animation of that spell gets bigger in proportion to that mob's size.
So that should be enough proof that PBAoE should consider caster's size as well.

any news on this?
what was that about sap (talented) and blind (non talented)? im having issues with talented sap not being able to hit a hunter in a flare but a non talented blind can... talented sap and non talented blind should both have 10 yards range according to tooltips.

what was that about sap (talented) and blind (non talented)? im having issues with talented sap not being able to hit a hunter in a flare but a non talented blind can... talented sap and non talented blind should both have 10 yards range according to tooltips.

This is correct and blizzlike (at least in wotlk), it's normal for flare to have more range than talented sap due to how distance calculation works (that's why I said "DO NOT use talented Sap to do this").
The bug is with PBAoE only, for example Holy Nova, Demoralizing Shout or priest fear.

so youre telling me its blizzlike that a 10 yard sap has less range than a 10 yard blind? i find that very confusing...

Yes, range checks for single target spells are made by the client (spell becomes red when out of range). The server check exactly maches what the client does.

Potential exploit?

but both sap and blind are single target?
scripting the core to fit to the client makes sense, i just gotta make sure i understand this correctly

If I'm not mistaken, this issue has been fixed either long time ago or by #16290.

Hi!
@chaodhib you fixed this issue here: https://github.com/TrinityCore/TrinityCore/commit/a1f2f30c145f6ad9c4baeffeff32618e71

But, with this commit appear this another issue: https://github.com/TrinityCore/TrinityCore/issues/19505

So, you decide revert the part of the code that cause the issue described in #19505
https://github.com/TrinityCore/TrinityCore/commit/2ff76e828f7c757b5120aba41947a6d63e082e17

But, I think, with that revert, this issue should be reopen because the part of code that try to fix this was reverted.
(I do not see it necessary to create another issue for this, since everything is explained here correctly)

We are asuming that combat reach should get from caster, but maybe we need get target combat reach.

I'm not sure, but maybe get targets in X distance and then get target combat reach?

@xvwyh is this implemented on your side? :)

I don't understand what is the issue here.
The spell target select code uses IsWithinDist2d (3d back then) to check if the target is in range to the center of the AoE, which adds the combat reach of the target to the checked range.

But .dist command uses GetDistance2d, which includes the combat reach of both the command user and the target.

Hence the difference. Spell checks the distance between caster's center and target's edge of combat reach, while the command gives you the distance between the caster's edge of combat reach and target's edge of combat reach. So of course it would be smaller by 1.5 yards, because that happens to be the combat reach of a player (caster).

The commit that was reverted (2ff76e828f7c757b5120aba41947a6d63e082e17) was attempting to add caster's combat reach to the checked range, so that target search would match .dist values, but it is debatable whether it should behave like that or not. Until someone provides proof from retail, I don't see a reason to change anything. Nobody presented me with such a proof, hence I didn't do anything about this on my server. .dist command is not a proof, because it's also implemented by server devs, not by Blizzard, and the server devs decided which values to display there.

P.S. It's bloody confusing to everybody to have this many functions that do seemingly the same thing, but each behaves slightly differently.

  • _IsWithinDist can include or not include self and target combat reaches depending on parameters
  • GetDistance(WorldObject*) includes self and target reach
  • GetDistance(Position) includes self reach
  • GetDistance(x, y, z) includes self reach
  • GetDistance2d(WorldObject*) includes self and target reach
  • GetDistance2d(Position) doesn't exist
  • GetDistance2d(x, y, z) includes self reach
  • GetExactDist/GetExactDistSq/GetExactDist2d/GetExactDist2dSq doesn't include anything
  • IsWithinDist3d/IsWithinDist2d includes self reach only, even though it's possible to pass WorldObject* to it, but it actually accepts it as Position* and thus doesn't include target reach
  • IsWithinDist includes both self and target reach
  • IsInDist(x, y, z)/IsInDist2d(x, y, z) doesn't include anything
  • IsInDist(Position*)/IsInDist2d(Position*) doesn't include anything either, even though it's possible to pass WorldObject* to it, but it actually accepts it as Position* and thus doesn't include target reach
  • IsInRange includes both self and target reach
  • IsInRange2d/IsInRange3d includes only self reach
  • IsWithinDistInMap(WorldObject*) can include or not include self and target combat reaches depending on parameters
  • GameObject::IsWithinDistInMap(WorldObject*) can include or not include self and target combat reaches depending on parameters
  • GameObject::IsWithinDistInMap(Player*) doesn't include anything

So of course it would be smaller by 1.5 yards, because that happens to be the combat reach of a player

This is the issue. And there's no "of course" here: spells that start from a unit do include that unit's reach in distance calculation, spells that start from a point do not. Why should PBAoEs be any different?

Until someone provides proof from retail, I don't see a reason to change anything. Nobody presented me with such a proof

What proof do you need? It's impossible to prove something which doesn't exist on retail. There's absolutely no mention of this exception on retail's forum and community sites, nor on any of the various classes theorycrafting sites, nor on pvp-focused forums; nobody in 15 years of retail ever noticed a different range caclulation for PBAoEs compared to other spells despite noticing it for GTAoEs (Flare + Blind/Sap interaction), why do you think it should behave differentty?

Even the client correctly adjusts PBAoEs' spell graphics depending of the caster's size.

You don't have to argue with me, I'm not a TC dev, convincing me won't change anything here. When I say nobody presented me with proof, I'm talking about the bugtracker of the server I worked on. I don't even remember if anyone even complained about this - after all, players don't have access to .distance, so they can't confuse themselves with conflicting numbers.

And I don't know what "PBAoE" is. A spell with TARGET_SRC_CASTER target as opposed to TARGET_DEST_CASTER? The absolute majority of AoE spells in the game are like that, the change you want to make will affect them all, if you were a player on my server - you would've had to present way better arguments for me to make such a global change.

What proof do you need? It's impossible to prove something which doesn't exist on retail.

How so? Did they get rid of all AoE spells that happen around the caster? I would've even accepted an example from the current retail expansion (because I highly doubt Blizzard would start changing such core design decisions 15 years into the game) that clearly showed that AoEs stops/starts affecting targets when the distance to them crosses "caster reach + effect radius + target reach" range.

Even the client correctly adjusts PBAoEs' spell graphics depending of the caster's size.

Can you provide an example? I tried changing my combatreach by calling SetFloatValue(UNIT_FIELD_COMBATREACH, 50.0f) and casting "Thunder Clap", and the visuals were of the exact same size as with 1.5 reach. Is "Thunder Clap" not a PBAoE spell? Well, it has the same targets as the "Demoralizing Shout" that you used as an example in your initial post.

Doubt.

Here is me casting frost nova (12 yard radius) on a target 12.1 yards away from me
obraz

Positions were calculated with a weakaura using this custom code

function ()
    local me = {UnitPosition("player")}
    local target = {UnitPosition("target")}
    if target[1] == nil or target[2] == nil then
        return me[1], me[2], "", "", ""
    end
    local dx = target[1]-me[1];
    local dy = target[2]-me[2];
    local dist = math.sqrt(dx*dx+dy*dy)
    return me[1], me[2], target[1], target[2], dist
end

UnitPosition returns exact X/Y coords if target is a player and in your group
No funky range estimations, this is exact distance
As you can see, my calculation completely ignores and combat reaches/bounding radius
Not only that but also applying side modifying buffs (vrykul drinking horn and time warp) did not change the range of frost nova (we know from sniffs that modifying scale also changes both bounding radius and combat reach)

@shauren you can test with warrior bladestorm (8yd) you can't hit if you dist with target > 6.5yd

you can test too with druid Starfall, Wrath have the same dist than Starfall (30yd), you can cast with 30yd and hit a target with Wrath but you can't hit with Starfall, you should be < 28.5yd to hit target with starfall.

Not hitting at 8.06 of EXACT distance. If this was supposed to include combat reach or bounding radius, it should be hitting up to 9.5 (if including caster reach) or 11 yards (including both target and caster reach) of exact dist. This is clearly not the case
obraz

Both screenshots are from retail today

Sorry, I'm saying if you test in tc335, you get the problem with bladestorm or starfall by example, and how you show in retail you can hit at 8yd with bladestorm

Edit: I understood that at 8yd you can hit with bladestorm, so maybe it's ok, I don't know xD

If this is how it works in retail, then the bug actually was "having 1.5y more range" (target's combat reach), which should already be fixed with 5d076cfe291980bc5be9d44ffbae887e3dd5ad59 afaik

so just to clarify
by example, if warrior charge can be used only if the target distance is >= 8yd, if you put at the limit to be able to cast charge (or almost ~7.9yd that you can't cast charge but you are in dist with target < 8yd) you can't hit with bladestorm?

Can you stop trying to judge spell range using other spells?

Also charge is only castable from 11 yards, its not an aoe spell and follows the range calculation from Spell::GetMinMaxRange -> SpellRange.dbc id 95, flags 0 -> it falls under this special case https://github.com/TrinityCore/TrinityCore/blob/6485422c6127262855b3c90183388e29dc251de5/src/server/game/Spells/Spell.cpp#L6409-L6412

Remember, range and radius are two totally different unrelated things (separate dbcs for that)

Ah I see, ok, so spell range calc isn't valid for test radius.
So if bladestorm should have 8yd radius, wich is the maxdist at can hit the spell in retail, 6.5yd like tc335? Because in that case I don't see any problem

@Faq, that ain't retail. By "live" they must've meant "live Sunwell server".

@PKX

which should already be fixed with 5d076cf afaik

No, target search still uses IsWithinDist2d:
https://github.com/TrinityCore/TrinityCore/commit/5d076cfe291980bc5be9d44ffbae887e3dd5ad59#diff-952c711803610aa78110e4f92ff2516aR7912
which still includes target's combat reach:
https://github.com/TrinityCore/TrinityCore/commit/5d076cfe291980bc5be9d44ffbae887e3dd5ad59#diff-29afb15ead2a8204cac07d94f074f260R1074

Was this page helpful?
0 / 5 - 0 ratings