-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missile.cpp: yield based damage #4927
Conversation
|
||
double queryRadius = 2000.0; // hardcoded to 2 km, this is sufficient for most explosions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why such a large distance compared to the old one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the query distance, not the "real" explosion distance. There is no real explosion distance due to the nature of an explosion in empty space. The spatial data structure which is queried has to know a maximum query distance.
I've chosen a relatively large distance to allow for a bigger yield without modifying the queryDistance too.
Note here that this doesn't have any effect on the performance because the query is done once and because space is relatively empty anyways. Not an issue in my opinion here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I suggest adding a comment to that effect?
double queryRadius = 2000.0; // hardcoded to 2 km, this is sufficient for most explosions | |
// The radius in which to search for possible recipients of the damages | |
// Hardcoded to 2 km, this should be sufficient for most explosions | |
const double queryRadius = 2000.0; |
I am done here with this PR. The computation is still not as realistic as it may get. I think the transfered energy depends on the solid angle of the exposed surface of the hit target. The computation to approximate it better isn't that much more complicated. |
|
|
Sure, I withdraw my objection. |
I'm still (unfortunately) unable to chime in further, but I'll echo @impaktor's comment that we'd love to see this exposed to Lua and the equipment system. If you have any suggestions or ideas for how to improve that system that come up as you work on it, I'd love to hear them - not sure (and don't have time to check right now) if there's an open issue, but I'd definitely like to see equipment capabilities gain a bit more structure and flexibility than simply lumping them all into the Ship's properties. |
Is this just waiting on clang formatting to be fixed? |
Yes |
closes #4923 |
@PtrMan we're about to do a release soonish (in a few days? a week?), so if you could 1. rebase to master, 2. and fix the clang complaint, then we could merge this, assuming @fluffyfreak is OK, which he seemed to be. |
Maybe I'll do it, I don't care if it is in this release or a future one. |
Add yield based damage calculation for missiles; damage now scales exponentially with the proportion of the explosion force instead of linearly by distance. This has the side effect of making missiles more viable in combat.
This PR has been manually merged into master in commit 3b4b436. Thank you for proposing it! |
Missiles use with this change only the yield. The received damage computation is now more physically correct/realistic.
This addresses some of the computation of #4923 .
It basically allows warheads with a wide range of choices for yield and type of explosion (conventional explosive, (thermo)nuclear)