Quesiton about AoE for wiki

Quesiton about AoE for wiki

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Quesiton about AoE for wiki

Post by FLOZi »

https://github.com/spring/spring/blob/9 ... r.cpp#L168

Why is damageAoE halved but Crater AoE is not? DOes that imply that areaOfEffect takes a diameter but craterAreaOfEffect takes a radius?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Quesiton about AoE for wiki

Post by Forboding Angel »

Perhaps edgeeffectiveness is applied with a different default?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Quesiton about AoE for wiki

Post by smoth »

Probably one of those things put there "cause it is cool" and forgotten
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Quesiton about AoE for wiki

Post by FLOZi »

Forboding Angel wrote:Perhaps edgeeffectiveness is applied with a different default?

Whut. I have no idea what you are trying to say here and tbh it can't possibly be relevant anyway as edgeEffectiveness has nothing to do with this, perhaps you misread / understood my post. :?

To answer my own question I'm 90% sure that I am right, areaOfEffect is read as a diameter (and converted to a radius internally by the * 0.5) but craterAreaOfEffect is read as a radius.

Would still like confirmation by an engine dev please.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Quesiton about AoE for wiki

Post by Forboding Angel »

ohhh, yeah you're right.

You're saying AOE != CraterAOE? (coming out to about half the distance? And by that logic Half Damage?)

Your first post isn't really clear at all :-/
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Quesiton about AoE for wiki

Post by knorke »

How is
craterAreaOfEffect takes a radius?
not a clear question.

There is much lolmath until craterAreaOfEffect acuelly is made into a crater.

GameHelper.cpp
void CGameHelper::Explosion(const ExplosionParams& params) {
line 185
const float craterAOE = std::max(1.0f, params.craterAreaOfEffect);

line 262
const float craterRadius = craterAOE - altitude;

So craterAreaOfEffect gets converted to a radius.

It then goes to BasicMapDamage.cpp
void CBasicMapDamage::Explosion(const float3& pos, float strength, float radius)

radius gets made larger again:
radius *= 1.5f;

But idk if that makes the crater acuelly larger or if it is just to get some "safety zone" for updating the heightmap?
(line 77 where it calcs x1, x2, y1, y2)

Either way I think craterAreaOfEffect is a radius but dont fully understand the part where it draws the crater.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Quesiton about AoE for wiki

Post by Forboding Angel »

knorke wrote:How is
craterAreaOfEffect takes a radius?
not a clear question.
Bad sentence structure. Does it take a radius and go to the store to buy milk? Or is taking a radius a euphemism for taking a dump?

Regardless, it doesn't matter as it appears that you have answered the question.

Thanks for the info :-)
Post Reply

Return to “Engine”