20 ms·
Orbit Tessellation developer diary for Kerbal Space Program 2
- elil17 5y agoMy biggest question: who the hell plays KSP without the orbit map interface?
- Arubis 5y agoSome people start fires just to watch them burn.
- kroltan 5y agoPresumably the folks that make airplanes instead of rockets?
- SAI_Peregrinus 5y agoOr that one guy who only makes trains.
- kroltan 5y ago...trains? That's news to me lol. Guess that in a game about space, the only limit is your imagination.
- DavidSJ 5y agoI've done this for fun to see if I could get to the Mun only looking out the window in the crew cabin. (I succeeded!)
- elil17 5y agoThat’s what I was imagining but I would have thought it impossible. Very impressive!
- DavidSJ 5y agoThanks! It requires some planning. It's been ~7-8 years, but I guess I probably figured out what trans-Munar injection velocity I needed and roughly what phase angle I wanted the Mun at (these are some basic astrodynamical calculations). You can determine velocity precisely from instruments and phase angle well enough from visuals that you pretty much guarantee a rendezvous. Once you enter the Munar sphere of influence, just wait until periapsis and start killing velocity. You'll want a table prepared (somewhat conservatively, to give yourself room for fine-tuning) of what your velocity should be at a given altitude to make sure that you land at 0 m/s without using too much propellant, and remember to adjust the "sea level" altitudes for ground level before your radar altimeter kicks in. I guess the hard part is making sure you land on something flat, but you can impart some lateral impulse if necessary until you see a good landing spot below. Getting back is similar, but the calculations are a bit simpler.
- Uehreka 5y agoHere’s a recording of another guy doing it to “Ride of the Valkyries”: https://youtu.be/iXYGo9KO2nI https://youtu.be/iXYGo9KO2nI
- jhgb 5y agoApollo 8 proved it possible, actually. ;) The onboard sextant worked perfectly.
- cridenour 5y agoI 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.
- orbital-decay 5y agoActually 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/ https://apollo11space.com/apollo-11-windows/ [2] https://www.hq.nasa.gov/alsj/coas.htm 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)
- ranger207 5y agoGetting 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.
- xondono 5y agoWith enough boosters you can get to the Mun in a straight line :D
- esjeon 5y agoI'm a bit puzzled here, after seeing the word "screen-space". I'm no game dev, but I know that there's tessellation shader for this very purpose. We can let the shader churn out more points on-demand in a separate step in the rendering pipeline. I think doing this in "screen-space" is a bit unnatural. (Just nitpicking.)
- teraflop 5y ago"Screen space" refers to the coordinate system. Regardless of whether you were doing tessellation on the CPU or the GPU, you would want to use screen coordinates to make your decisions about which segments to subdivide, because what you care about is the deviation of the rendered curve from its "ideal" path. A large error in world coordinates doesn't matter if it's so far from the viewpoint that it looks tiny. Tessellation shaders are useful for processing polygonal geometry with many thousands of polygons, but they have a fairly constrained programming model. And as you can see from the example images, rendering a high-quality orbit path only requires a few dozen vertices. The performance benefit from moving that computation into a tessellation shader is likely to be insignificant compared to the additional complexity and overhead.
- esjeon 5y agoThanks for the reply. I've written graphics code only on more-or-less lab environments, and have read many papers mentioning screen-space algorithms which trades off accuracy for other characteristics. Maybe I'm triggered by that. lol
- modeless 5y agoSpace 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 only send the GPU coordinates it can handle, or your 3D models will get crunched by precision errors. Another one is that a planet sphere renderer will often tesselate the sphere into quads in lat-lon space. Of course the quads are split into two triangles for rendering. However, at the poles, one of the triangles has zero area because two of its vertices are the same, the pole. Then when you texture map that "quad" with a square texture, half of the texture is not shown, and you get visible seams (Google Earth suffers from this artifact, or at least it did in the past). What's less obvious is that this problem is present to a lesser extent in every quad on the sphere, because the triangle with the horizontal edge nearer the pole is smaller than the other, so half of the texture is stretched and half is shrunk. The fix is to use homogeneous texture coordinates.
- wwarren 5y agoCan’t we use an icosahedron for a better sphere?
- modeless 5y agoYes, and there are many other tessellations you can use, if you texture it with a single texture. But you can't texture a whole planet with one texture if you allow zooming from planet to human scale, the texture would be terabytes. You must tile the sphere with textures that are loaded on demand, and textures are square, so it makes sense to divide the sphere into quads (actually a quadtree for zooming).
- exDM69 5y agoIf you want to texture a sphere, the cubesphere is the best way to draw. It is what you get when you subdivide a cube using slerp instead of lerp for interpolation. Icosahedron doesn't work well if you have textures. The triangle topology near the poles lead to bad texturing. Icosahedron may work better if you have a fully procedural pipeline and don't need to worry about square textures.
- cas8 5y agoKSP 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.
- Toutouxc 5y agoYou 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).
- capableweb 5y agoI've never tried Simple Rocket, could you compare it to KSP? At a glance, it seems more serious than KSP while KSP has a "fun" edge, but besides that they seem more similar than not.
- Toutouxc 5y agoSR2 is a little bit more serious than KSP, I'd say, but it's no Orbiter either. They use a smaller-size solar system (bigger than KSP though) by default (you can swap it out for a community created realistic system in-game), so you can still brute-force to orbit or build a SSTO and it will kinda work. What I love about SR2 is the aerodynamics and the procedural parts. You can create an airplane and design its wings and control surfaces by hand, you can play with the center of gravity, custom fit it with a jet engine (by tweaking the compression and bypass ratios, adding or omitting an afterburner) and just fly some aerobatics. You can use electric powered rotators and hinges, powered procedural wheels for cars and other cool stuff. And if everything else fails, your rocket is saved is a plain and simple XML file, so it's easy to just dig in and tweak some more. On the other hand, there is no campaign yet and only a bunch of tutorial-like-tasks to get you started (take off, reach speed X, achieve orbit, hit the Moon with your spaceship etc). I wouldn't say that either game is better, SR2 is just different and provides you with some more freedom and options than vanilla KSP. Also KSP is Windows + Mac + Linux + consoles, while SR2 is Windows + Mac + iOS + Android, and the mobile versions are surprisingly playable (especially on tablets or larger phones).
- deepsun 5y agoMy 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.
- teraflop 5y agoIf I'm correctly understanding what you mean, I'm fairly sure that's a deliberate optimization/design choice. In the real world, a spacecraft or other object in orbit around Earth is also being constantly influenced by other celestial bodies, especially the sun and moon. Over short timescales this causes the spacecraft's orbital parameters to slowly drift; over longer timescales, it means the long-term position and fate of an object is chaotic and unpredictable. The behavior near the "boundary" between two spheres of influence is just a situation where these perturbations are more noticeable. KSP only implements two-body physics, so a spacecraft is only affected by the gravity of one celestial body at any given time. This allows you to put something in orbit and know that it will stay there without you needing to constantly check on it and perform stationkeeping. It's also the key simplification that makes "time warp" possible, since two-body orbits have closed-form solutions. To implement time warp with many-body physics, you would need to either keep the integration step size the same and drastically increase the amount of computation, or increase the step size and suffer from extreme inaccuracy, causing objects to crash or fly off into space.
- Dylan16807 5y ago> It's also the key simplification that makes "time warp" possible, since two-body orbits have closed-form solutions. To implement time warp with many-body physics, you would need to either keep the integration step size the same and drastically increase the amount of computation, or increase the step size and suffer from extreme inaccuracy, causing objects to crash or fly off into space. It makes things nicer at extremely high time warps, but it's not necessary. It's not like you need to update orbits nearly as often as part physics. The max time warp is 100000x, and at that speed if you updated orbits every 10 game seconds that would only be 400 calculations per tick, per craft. So without that simplification you might need a smaller cap on satellite swarms, or a max speed of 10000x, but time warp would still be well inside the realm of "possible". Edit: You could probably get processor use really low by using an exact curve for the most influential object and a very slowly updated offset for other influences.
- fy20 5y agoOne 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.
- GuB-42 5y agoOften, artistic license take over actual physics, even when the writer knows about the field, he will prefer do it in a way that fits the plot. I mean, even Interstellar, with a Nobel Prize on board sometimes forgoes scientific accuracy for nicer pictures. There is also a game about accuracy, viewer expectations, and attention. For example, most people will thing that the best way to land from orbit is to point the ship towards the ground is fire the thrusters, obvious right. If the ship points 90 degrees away, people will ask themselves why. If orbital mechanics is central to your movie, that's good, but you may have some explaining to do. If you are in the middle of an epic space battle, it is not the time for a physics lesson, so go for the obvious (and wrong) and let the viewer focus on the action.
- m_mueller 5y agoExpanse 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...
- dogma1138 5y agoThe 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.
- m_mueller 5y agoI’d argue that it’s just an effect of lazy writing though. Deorbiting anything into the sun is a very expensive way to get rid of it. They showed instant proto molecule cleanup operations in another season - just use that again.
- mypalmike 5y agoI 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.
- avereveard 5y agocan't wait to see what they will be doing with multiplayer