Jump to content

Building a New Universe - KSP Discussion at Unite 2013


Apollo13

Recommended Posts

Is this from .22? I haven't been to Duna much in .21 but I don't recall it looking like that.

Could be the near polar regions, during my brief adventures with streaming (too much performance hit from recording while playing) I landed a rover near Duna's ice caps. There were very steep mountains there and I nearly crashed into one at 5 km altitude (IIRC) during descent.

Link to comment
Share on other sites

To me it looks like they got off on the wrong foot with their number system. If they'd had used integer math to represent the positions and wrote their own math functions to do the calculations on those numbers they could have started out with 64 bit integer numbers.

This would represent a universe of by my calculations of 922,337,203 MILLION meters radius at a resolution of 1/10th of a millimeter with the sun being in the center. That is what a 64 bit number universe could do for you. Then you wouldn't have to use a lot crazy trickery to get around the Space Kraken problem. And because you're using integer numbers to represent the universe, your calculations could be done a lot faster (no floating point). However, you would have to make your own trig functions to operate on those numbers, and this is probably why they didn't do this. It would take some serious math geniuses to come up with all that. But, there are libraries (program function libraries) that have already solved math with big numbers.

Most likely it is WAY too late to change anything over now, so I recon we gonna have to live with what we got.

Link to comment
Share on other sites

I don't understand any of these words but I feel smrter for listening to all of them. :sticktongue:

Seriously though, it is nice to see al the detail that ingame we just accept and don't see. When I'm playing, it's not triangulated quads with values of 1,2,4 or 8, it's just a place. I had wondered a little about the rails system with the orbits and how it worked with time, but it's nice to actually know.

Link to comment
Share on other sites

To me it looks like they got off on the wrong foot with their number system. If they'd had used integer math to represent the positions and wrote their own math functions to do the calculations on those numbers they could have started out with 64 bit integer numbers.

I am also a proponent of integer/fixed point where possible. Int64s would allow the entire Kerbol system to be represented to sub-micron accuracy. However, performing math on ints can be tricky, at best, and would be a terrible hassle for KSP.

The problem is this: suppose that we want to calculate the gravitational force on an object, which scales with r^2. Let us suppose that our number requires almost all of our 64 bits to represent. The issue is that squaring that number requires 127 bits to maintain full precision. This means that we would need to drop precision, so essentially we would only have had 32 bits worth of usable precision in the first place. 32 bits is *not* enough to represent the Kerbol system with decent accuracy (if it were scaled to fit eeloo, it would be at 100m resolution). Now, since this only applies to secondary calculations it may be possible to work with this, but it would be messy at least.

Also, what about stuff on Kerbol escape? Eventually it will hit the limit of ints and would require special treatment at that point. Though this may not happen until 1000 times further than eeloo's orbit, with doubles it wouldn't happen until roughly 10^300 times eeloo's orbit. A determined user could reach the first limit with infinite fuel and a lot of timewarp, but the only way to overflow the double here within several years would involve cfg edits. Of course, there would be 'farlands' effects much sooner, but it still allows much more flexibility than ints.

Also, integer computation is not noticeably faster than floating point (single/double) arithmetic. Floats are used so often in PC's nowadays that special hardware is used to crank these calculations, such that they are roughly on par with integer operations (and hence why nobody talks about 'flops' for anything except supercomputers and GPUs any more).

I like fixed-point, but there are a lot of issues here that could cause problems. That is why most developers shy away from such approaches (plus, it requires much more care on the part of the programmer when writing mathematical expressions).

Edited by arq
Link to comment
Share on other sites

I'm not a programmer but I know an elegant solution when I see one, and KSP has them in spades. This video gave me a lot of great insights in how the game works and how the devs have deftly maneuvered around many pitfalls so far. My favorite is probably the whole "move the universe around the ship" bit, though the way planets are rendered to ten different levels of accuracy (with those clever border verts) is really awesome too. Gave me a whole new appreciation for what I'm playing :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...