Live data from Hacker News

Orbit Tessellation developer diary for Kerbal Space Program 2

kerbalspaceprogram.com

31–40 of 84 posts

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#31
post #6

Space rendering is full of interesting problems like this. Another one is that single precision floating point doesn't have enough precision to represent both planet scale and human scale in the same coordinate system (let alone solar system scale or galaxy scale), yet GPUs don't support double precision well. So you have to make sure that you do calculations needing high precision on the CPU in double precision and…

KSP's approach to the precision problem is surprisingly simple: whenever you get more than two kilometers away from the origin, move the entire universe two kilometers so that the location of your craft, and all the physics-relevant computations on it, have small numbers as coordinates. (This fix was known as Krakensbane: it solved a bug known as the Deep-Space Kraken, which was essentially that floating-point physic…

Pretty sure that the floating origin moves with the craft now every frame. The entire universe also orbits around the craft when it is below the inverse rotation altitude threshold, which means that PhysX is doing physics in the co-rotating reference frame. That means that the "First point of Ares" -- normally (1,0,0) -- rotates around the z-axis as the craft moves and you have to query Planitarium.right to determine what its current orientation is. That means that tick-to-tick coordinates change, which makes trajectory optimization hard because values in the future won't match at all. You have to remove that rotation to get something like actual inertial coordinates (after also removing the offset origin to the vessel as well).

They've also recently fixed issues with single precision calculation in KSP1 and used a double-precision QuaternionD.LookRotation in the maneuver nodes to keep interplanetary trajectories from hopping around a lot.

[ oh it also uses left handed coordinates, which is terrible which means (0,1,0) is the north pole and the left handed cross product gets used so dual vectors like angular momentum point south for east-going orbits -- except the Orbit class uses normal right handed vectors and when you forget to .xzy swizzle a vector for one reason or another you can wind up debugging an issue all day long ]

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#32
post #12

My biggest problem with trajectories in KSP was that they flip non-continuously once the trajectory passes through a sphere of influence. I believe it would be much clearer and easier if trajectories were continuously changing but just marked once they pass through a SoI.

There's I think 5 different ways to handle rendering of orbits once the vessel goes through an SOI that KSP supports.

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#33
post #2

My biggest question: who the hell plays KSP without the orbit map interface?

I watched a streamer play KSP for the first time, not have the patience to learn orbits (at least on stream), just point at the Mun and go for it. I was yelling at the screen that it wouldn't work, but somehow he made it there, though with the same delta-v he could have gone to Eve.

Believe in the tutorial it teaches you that you can do that (or at least it did). I suspect the orbit of the Mun is not placed by accident.

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#34
post #2

My biggest question: who the hell plays KSP without the orbit map interface?

Actually it can be a fun exercise flying purely in IVA with a slide rule and window- or periscope-based reticles, just like those on Apollo Lunar Module [1][2], or Russian space stations [3]. The Apollo descent and landing procedure included elaborate roll maneuvers to confirm everything visually with the landing point designator. You can measure the horizon curvature and use similar techniques to guess your altitude and attitude.

[1] https://apollo11space.com/apollo-11-windows/

[2] https://www.hq.nasa.gov/alsj/coas.htm

[3] (yes, ISS has an optical viewfinder called VShTV - it's installed in Zarya module. It was meant for emergencies and never been used to reorient the module manually, AFAIK)

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#35
post #10

KSP 2 has easily been my most anticipated game for a while now. It's a bummer that there's still a while to wait, but I'm hoping that it's worth it.

You can give Simple Rockets 2 a try in the meantime. It uses fully customizable procedural parts (wings, fuel tanks, even engines) instead of premade parts like KSP, it looks a bit nicer and it includes a visual programming environment for your spacecraft (e.g. you can build a SpaceX-like autoland routine).

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#36
post #6

Space rendering is full of interesting problems like this. Another one is that single precision floating point doesn't have enough precision to represent both planet scale and human scale in the same coordinate system (let alone solar system scale or galaxy scale), yet GPUs don't support double precision well. So you have to make sure that you do calculations needing high precision on the CPU in double precision and…

An interesting piece of industry-insider information, at least as far as I recall from the Sony pub regulars I knew back in the day: the colloquial term for the polar artefact you describe is the cat’s bumhole.

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#37
post #29

One of the things KSP taught me is that orbital mechanics aren't that complicated, but even so, pretty much all movies and TV shows about space were written by someone who doesn't even know the basics.

The problem is that if you show a ship heading away from a planet by burning parallel to it, or heading to the planet in the same way, people watching will be confused.

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#38
post #2

My biggest question: who the hell plays KSP without the orbit map interface?

Getting to the Mun manually isn't too hard once you know what you're doing. Get to a low orbit, then thrust prograde when the Mun comes over the horizon. Keep an eye on your remaining delta-v (or do the math beforehand and watch your stopwatch) and you should come pretty close. Make sure your Munar orbit is counterclockwise and returning is just prograde thrust again.

For a more immersive experience, install the RasterPropMonitor mod to get interactable IVA displays. Add a compatible camera mod and Docking Port Alignment Indicator and you can even do a multi-craft Apollo style mission entirely from the cockpit.

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#39
I used a very similar approach to render airplane contrails in a flight sim back in the late 90s. The contrail had a binary tree representing the volume of space taken up by segments of the trail. Projecting this volume into screen space and comparing against a heuristic resulted in either rendering the segment or recursing down the tree for finer detail.

Re: Orbit Tessellation developer diary for Kerbal Space Program 2

#40
post #29

One of the things KSP taught me is that orbital mechanics aren't that complicated, but even so, pretty much all movies and TV shows about space were written by someone who doesn't even know the basics.

Expanse season 1 was a nice exception to the rule, but I find that as the longer the show goes on the more it gets ignored. Missiles that fly into the sun at faster than light speeds...

The expanse still gets the physics right for the important scenes. Watching people stand for over a few days looking at a torpedo slamming into the sun would be boring.

Space combat physics is still done very well.

Post reply on HN