Page 1 of 1
Is it possible to have linear edgeeffectiveness?
Posted: 25 May 2018, 11:15
by Forboding Angel
edgeeffectiveness, for whatever reason works on a curve instead of a linear dropoff. I honestly don't understand how this is preferable to a linear dropoff where you can have fine tuned damage control, but that is an argument for another time.
Is there any way to make the damage drop off linearly?
Re: Is it possible to have linear edgeeffectiveness?
Posted: 25 May 2018, 19:20
by FLOZi
Re: Is it possible to have linear edgeeffectiveness?
Posted: 25 May 2018, 20:56
by Forboding Angel
Oh, well that works. Silly me then. But default used to be 0.5 (at least according to the wiki), but I see now that it is 0. Awesome, a problem that solves itself. I can dig it. Thanks
Edit: I just used the waybackmachine to double check that. As of 2014 it was 0, which makes me curious where I got the firm memory of it being 0.5.
Re: Is it possible to have linear edgeeffectiveness?
Posted: 26 May 2018, 13:41
by PicassoCT
Back then when the maidens where many and willing.. oh i remember the days, the fruits where plenty, the youth respected the elders, when they yelled to stop thiefing- and even the sticks where firmer and a edgeeffectiveness only costed 0.5 a factor.
Those where the days sygh, those where the days.
Now look at us, old grumpy reptiles sitting on benches, that are neither pink nor red. Yelling at the api.
Re: Is it possible to have linear edgeeffectiveness?
Posted: 26 May 2018, 14:40
by raaar
if we set edge effectiveness to 0.5, shouldn't the damage drop off linearly from 100% to 50% along the blast radius?
Re: Is it possible to have linear edgeeffectiveness?
Posted: 27 May 2018, 07:41
by Silentwings
No, read the wiki.
A discontinuity at the edge of the blast radius, which in many cases would be very annoying to players, is avoided. The formula used is a different sort of interpolation between the 'obvious' behavior expected in the 0 and 1 cases, to what you're thinking of.
Ofc, using Unit/FeaturePreDamaged, you can also implement your own formula.
Re: Is it possible to have linear edgeeffectiveness?
Posted: 27 May 2018, 08:03
by Forboding Angel
raaar wrote:if we set edge effectiveness to 0.5, shouldn't the damage drop off linearly from 100% to 50% along the blast radius?
A while back, that was a shock to me as well. It essentially makes edgeeffectiveness completely useless for all but a few applications.
Why? because LOL, that's why.
https://springrts.com/mediawiki/images/ ... veness.png << Visual illustration of how it works.
Re: Is it possible to have linear edgeeffectiveness?
Posted: 27 May 2018, 16:59
by raaar
so that means, if one uses edge effectiveness=0.5, in practice a unit caught halfway between from the blastpoint and the blast radius will receive about 0.6*dmg instead of 0.5*dmg (edge effectiveness=0).
Re: Is it possible to have linear edgeeffectiveness?
Posted: 27 May 2018, 23:53
by Forboding Angel
Yes, it sucks because it makes your carefully tuned aoe radius completely arbitrary, damagewise. For me this makes my usage of edgeeffectiveness completely binary.
Random damage numbers may be all fine and good in a *A game, but in evo I have very painstaking damage/hp balance/amounts. It's already annoying enough that something can still be alive with 0.0 hp.
Re: Is it possible to have linear edgeeffectiveness?
Posted: 28 May 2018, 11:22
by sprunk
Here's a gadget that should make damage fall off linearly to the value specified in the weapondef.
Code: Select all
function gadget:UnitPreDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID)
if weaponID <= 0 then
return damage -- environmental damage, no weapondef entry
end
local weaponDef = WeaponDefs[weaponDefID]
local ee = weaponDef.edgeEffectiveness
if ee == 1 then
return damage -- already desired behaviour and would else crash due to div0
end
local baseDamage = weaponDef.damages[UnitDefs[unitDefID].armorType]
local isArmored, armorMult = Spring.GetUnitArmored(unitID)
if isArmored then
if armorMult == 0 then
return 0
end
baseDamage = baseDamage * armorMult
end
local fraction = damage / baseDamage
local distance = (1 - fraction) / (1 - fraction*ee)
return baseDamage * (1 - distance*(1 - ee))
end