-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Surface impact alerts #4891
Surface impact alerts #4891
Conversation
Found a bug where IMPACT IMMINENT alert shows when you are passing by a planet safely at high speed. I know how to solve it, but it is past midnight so I will solve it tomorrow probably. Tomorrow as in today but after I sleep and wake up. |
@WKFO I'd definitely love it if you'd include a link to a breakdown of the motion equations used, if only for future maintainers to be able to understand which specific formula you're using (and to give future contributors a stepping-off point if they want to improve it!) EDIT: otherwise, I like the alerts so far - I'd recommend the text color be red instead of green (for obvious reasons), and possibly the "less-lethal" alerts should display in the bottom right with the orbit info. Ideally 'status alerts' like DESCENT RATE should display in the bottom right when it's not an immediate issue (say, when there are 30s or 1min of real time before the issue becomes fatal) and only promote to the center reticle when it's on the verge of becoming an unavoidable outcome (~10 seconds). |
Preferably this should be included as comment and/or commit message as well. |
The bug is fixed, I made a few changes. Still has room for improvement for sure, but is good enough for now. Here are the horribly drawn visualizations of what I tried to do. I think the equivalent of most equations can be found: https://en.wikipedia.org/wiki/Projectile_motion And I have this bookmarked which helps you predict orbits by velocity + position: Descent rate: Impact warnings are accurate themselves, only the escape possibility estimations have estimations in them. At this point it is accurate enough, anything more accurate in escape estimations does not earn the player anything (and gives the player less time to react), and also requires complex integrals which might become expensive to calculate every frame and are hard on my brain. And why would you need an "IMPACT IMMINENT" warning showing up just when impact becomes 100% unavoidable anyway? However, even then, I did make a few calculations for theoretically improved versions, trying to come closer to maximum physically accurate models. This is my whiteboard while I was trying to model "approach velocity over time depending on periapsis altitude or initial velocity vector". Another instance was me trying the same thing but using kinetic and gravity potential energy. None of them ended up turning into code, because I could as well just go on and simulate every atomic nuclei making up the ship. |
Alerts are now red instead of green. |
Fixed an issue. The descent rate alert no longer triggers when you force extreme time accelerations when the autopilot is docking. (Yes, I do that when I'm in a rush.) |
Oh wow. Lots of graphics, that ought to help understanding it all. On the subject of having a warning for impacts that are unavoidable: they are indeed relatively useless from a gameplay perspective, but in the real world you'd want them, in a "brace for impact" sort of thing. Sure, the player cannot "brace", but it'd still make sense to have the warnings for immersion. However, I'm quite partial to not implementing stuff that make my brains hurt, too ;-) |
Would be good if you could squash the bug fix commits |
Squash done! |
Is this ready for test/merge? |
@nozmajner was making an icon, so it should wait |
Right, I forgot about this, sorry. Or this: |
I did something and en.json turned into a binary file apparently! Just deleted the last commit, but I still have to fix the space/tab thingy that happened in that file. |
Spaces fixed, two conflicts left. |
Up-to-date icons file, pulled from master, added the collision icon to the end. |
This PR should be ready for test/merge now. |
Ok this PR is all done and ready to review+merge etc? |
@fluffyfreak yes, it is ready. |
Sorry it took too long to notice even though I've been testing this PR in-game for so long. Added the if conditions which I forgot, now the warning icon only appears in world (flight UI) view. (But sounds work in all views as before.) Dumb me. Still, should be ready for feedback/review/merge/whatever. |
I'd squash the last commit into the first, as they look to edit the same files. ...um, make sure you don't loose the icon file in the exercise! |
I don't mind if you don't do the thing with the icon and crediting. No need for the hassle. |
Done. |
The git fascist in me is happy. As for the code, I assume that blob that does the magic in lua is mostly heuristic, as such I don't intend to review it at any lenght, maybe someone else want to do it? If this has been tested and works, I'm happy to merge (or "rebase and merge" if using github's gui) as is. |
Adds HUD alerts for dangerous planetary (and stellar?) approaches. Has 3 modes.
"DESCENT RATE": If the player is flying close to the asteroid/planet/star and has a dangerously high descent rate, a HUD warning appears with a short audio tone. If ignored for longer than several seconds (descent rate not reduced), it usually guarantees a crash (especially if there is no atmosphere) or maybe a soft bump.
"IMPACT TRAJECTORY": If the player is far away from the body but is unable to decelerate before hitting the ground. Usually does not require immediate action, and disappears once the velocity vector is pointed away from the body. No audio tone.
"IMPACT IMMINENT": If the player is far away from the body but is on a dangerous impact trajectory. May appear if IMPACT TRAJECTORY is ignored for too long. The player is unlikely to survive unless immediate action is taken, and even then, it is hard to recover from. No audio tone, because we will let people die in peace.
Those are all calculated independently from the braking distance gauge, because it takes the regular ship velocity while I take approach velocity only. They have different purposes.
I did a lot of play-testing myself, but others should probably do some too.
The mathematics are pretty simple motion formulas, but if you can't read my handwriting I will gladly explain. They just look long because variable names are long.
(The last image might look survivable but no, you can't divert quickly enough. I tried.)