# Hyperjump exit point is sometimes too close to White Dwarf #4479

Open
opened this issue Oct 20, 2018 · 11 comments

Projects
None yet
5 participants
Contributor

### Observed behaviour

The hyperjump exit point is sometimes too close to a White Dwarf.
There is no chance of escape. The ship gets destroyed within seconds.

### Expected behaviour

Have a chance to survive.

### Steps to reproduce

Jump to a White Dwarf e.g. Van Maanen's Star (0, -2, 0)

My pioneer version (and OS):
current master

Contributor

### fluffyfreak commented Oct 20, 2018

 I dunno @robothauler that's quite a high expectation ;)
Contributor

### WKFO commented Oct 21, 2018 • edited

 Van Maanen's Star has a surface gravity of 207186.972g. (for reference, Sun only has about 25-30g) Exiting somewhere close to that star is rather unsettling. Maybe we could take both the star's radius AND the mass into consideration to calculate the exit point. Also, this problem does not happen every time I jump to Van Maanen's Star, but it is not a single time occurance.
Contributor

### fluffyfreak commented Oct 23, 2018

 Erm, what stars did you jump from when testing, because I've had a variety of things happen. Sometimes I miss the star and get flung out. Sometimes I smash into it. There's some randomness involved in exiting but it also depends on where you came from a bit.
Contributor

### fluffyfreak commented Oct 23, 2018

 Also the calculation does take into account the mass of the target star when determining what your "orbital" velocity will need to be... though as you've noticed (by dying) it isn't always that reliable a calculation 😀
Contributor

### WKFO commented Oct 23, 2018

 I never really looked at the code, but I know that the orbital speed formula requires the mass of the star. That's how physics (should) work. I've jumped to Van Maanen's Star system from Sol and Epsilon Eridani a few times, and that's it. I've also jumped between lots of other star systems, but the worst case was the orbital velocity was a little too high and I got suborbital trajectories. (At least that's what the orbit display told me.) So Van Maanen's Star is the only one that required me to panic immediately.
Member

### impaktor commented Oct 24, 2018

 One could spitt out an ordered list of the surface gravity of all stars pioneer has parsed, in some region, when starting the game, assuming star gravity is exposed to LuaAPI, if not it aught to be. ...then fly to the one with strongest gravity.
Contributor

### fluffyfreak commented Oct 24, 2018 • edited

 @impaktor it works ok for Sagittarius A* ... which should have plenty of gravity mass. I think it's the exit angle calculation which is suspect and that could fail even with relatively low mass stars.
Contributor

### fluffyfreak commented Oct 24, 2018 • edited

 If you look at the line starting here: https://github.com/pioneerspacesim/pioneer/blob/master/src/Game.cpp#L523 You'll see that I'm not 100% certain of my calculations in this area 😁 EDIT: line 539 is also self explanatory: https://github.com/pioneerspacesim/pioneer/blob/master/src/Game.cpp#L539
Contributor

### quickdudley commented Oct 27, 2018

 This might have also caused me to crash into Barnard's Star; but that might also have been caused by putting too much trust in the autopilot.
Contributor Author

### robothauler commented Jan 1, 2019

 I think this is solved since #4495. The only thing is that I'm approx. 400000AU away if I jump to Sagitarius A*. But I think this is a separate issue ;-)
Member

### impaktor commented Jan 1, 2019

 Well, if you arrive > 100 AU from the targeted body, it sounds like it still needs fixing to me.