beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
191 stars 97 forks source link

weapon defs: crater aoe is radius but damage aoe is diameter #1399

Closed sprunk closed 4 months ago

sprunk commented 4 months ago

Bad design. The big issue is of course that games exist and set both values already.

WatchTheFort commented 4 months ago

How many of the def parameters have this problem?

sprunk commented 4 months ago

Figuring that out is a good task for somebody.

lhog commented 4 months ago

TODO: harmonize parameter names to radius or diameter, leave the current ones as fallbacks.

sprunk commented 4 months ago

I checked the claim and actually both are diameter. It may look like crater radius is smaller but it's because only half of it is the hole and the other half is the raised rim.

lhog commented 4 months ago

Hmm, idk about that one.

craterAreaOfEffect weapontag has scaleValue(0.5f) There's also const float craterRadius = craterAOE - altitude; which hints it's radius.

sprunk commented 4 months ago

craterAreaOfEffect weapontag has scaleValue(0.5f)

Yes, but damageAreaOfEffect has that too. So they are both input as diameter, and then scaled by 0.5 to be stored as radius internally.

There's also const float craterRadius = craterAOE - altitude; which hints it's radius.

Yes, it's radius in C++ code, but that's after the 0.5 scaling. It is input as diameter from Lua unit defs (which is what I care about because that's the interface for gamedevs).

lhog commented 4 months ago

Yeah, you're right, I got confused.