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?
Is it possible to have linear edgeeffectiveness?
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Is it possible to have linear edgeeffectiveness?
https://springrts.com/mediawiki/images/ ... veness.png
Use the default value of 0 for a linear decay.
Use the default value of 0 for a linear decay.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Is it possible to have linear edgeeffectiveness?
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.
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?
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.
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?
if we set edge effectiveness to 0.5, shouldn't the damage drop off linearly from 100% to 50% along the blast radius?
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Is it possible to have linear edgeeffectiveness?
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.
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.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Is it possible to have linear edgeeffectiveness?
A while back, that was a shock to me as well. It essentially makes edgeeffectiveness completely useless for all but a few applications.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?
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?
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).
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Is it possible to have linear edgeeffectiveness?
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.
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?
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