Sunday, June 2, 2013
Summary
Strong start to the week I am setting very high expectations for June. You can fire me if I don't hit them!
The biggest advancement of the day was making system properties continuous over space. Several people asked whether the system backgrounds would look coherent throughout a region, and I answered yes. Today I made it happen! I was initially thinking coherent noise, and didn't think twice that this would be the correct solution. But after implementing smoothly-varying properties via coherent noise, I realized that it was rather dumb to be generating properties based on some arbitrary partitioning of space when, in reality, I have already created a very strong partitioning via the hierarchical universe structure. Instead of praying that the relatively large distances between regions would cause them to have distinctive feels, why not generate the properties directly from the region itself? This led me to a new, recursive formulation of spatially-varying properties that looks and feels almost exactly like traditional fractal noise, except instead of being tied to a regular grid structure, the noise is based structurally on the actual hierarchical universe structure. Dunno if that made any sense at all, but the end result is good, and that's what matters Regions feel very coherent now. Quite fun to explore
I wrapped up the day with an unexpected code-cleansing session that targeted some of my math code in the engine. This came about as a result of my desire to move to a double-precision engine. Since I got so much flak about the size of the planets in the last update, I realize that I'm going to have to upgrade the engine sooner or later. The reason that I didn't make the planets huge (and the reason, for that matter, that planets in Freelancer aren't huge), is that a single-precision engine (i.e., one that uses 32-bit floats to keep track of positions) is insufficient for massive planets. Even with the system scale shown in the demo, we are already pushing the limits of single precision. If I increase the size of the planets a whole lot more, I will have to make the systems essentially only have one massive planet and not much else, since I cannot expand the system bounds much further without causing the graphics to become unstable. The solution is to move to double precision. If and when I do so, the engine will be able to handle massive planets and still have massive distances between them, so we will have some awesome systems with awesome scale!! Initially I had not planned on doing this for LT, but the demand is obviously high, and I am beginning to believe that it could be fun to have this kind of epic scale in the game
Moving to double-precision is a big switch, though, and requires some technical heavy-lifting. Today I converted my matrix math to generic format so that I'm ready to support double-precision matrix math. All my other math classes are already generic and can support any precision. The next step is to figure out the minimal required set of changes to switch. Contrary to popular belief, a double-precision engine (if implemented efficiently), doesn't use double-precision calculations everywhere. For example, there is absolutely no point in storing the rotation of an object in double-precision. Same for forces / velocities as well as a great deal of other calculations. Really, just about the only thing that needs the extra precision is anything dealing with world-space positions. The only real trickery here is that the double-precision world-space positions need to be converted back to single precision for use on the GPU. If done naively, this would result in no gain whatsoever. If done cleverly (the classic camera-at-the-center-of-scene approach), it provides virtually all the gain of double precision...but requires cleverness. So I just need to figure out how to be clever. And then we can have big planets
Hour Tally
Coding: 6.30
Internet: 2.66
Testing: 1.92
Thinking: 0.85
Total Logged Time: 11.73
Post
Sun Jun 02, 2013 11:02 pm
#1
Week of June 2, 2013
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford