Platform Masters Title
Platform Masters - Will you be the world's next platform master?






Ground decals - rezoning to optimize


Date: August 6, 2014
Screenshot #561: With the ground decals getting a redesign in the way they are drawn, opening up new possibilities and saving memory for certain ground decals. So, with that in mind, I'm redoing existing ground decals, but only to rezone them (shifting as needed for optimization). After all, when you've got an area that's entirely transparent on the far left or far right edges, why draw that? Not only am I cutting this out, saving memory and improving efficiency, I also added in a feature for repeat widths to not be based on images. This was quite a while ago though, with Marusi Island. Now I'm doing it to every ground decal that can be optimized.

Which worlds can benefit? There are several situations. The far part of the city of Ronnis is one key instance. The Keveran River in Ronnisa Plains is another case. Lake Keveran's closest part could benefit considerably from this, even reducing the width below 4096 pixels many cases preventing the need to stack it. Keveran Forest's Teigram River was designed with this optimization known, a must for that memory-intensive world. Mount Sentusia's lava islands can benefit significantly, to the point where none of the images would exceed 4096 pixels wide. Nodera Ice shelf has 2 instances available for optimization - the farthest part of the closest iceberg is one area (shown in this screenshot) the ice shelf itself. Nodera Highlands needs an overhaul in the design of its ground decals. Earth Space Base has that area where the observatory is. Barugan Islands is what started the need for the optimizations, with Marusi Island and another, somewhat similar island or two. Musan Swamp is uncertain. The other worlds and decals can't benefit from this with existing ground decals.




Ronnisa Plains - the rejected bridge


Date: August 11, 2014
Screenshot #562: I was debating on whether or not to add a bridge into the scene for Ronnisa Plains. I decided that I would, initially. However, with the ground decal optimization, I thought I'd just leave it out to simplify things. Thus, this will be the only time you'll ever know of the existence of a bridge in Ronnisa Plains.




Jeremy's House - updated trees in concrete


Date: August 14, 2014
Screenshot #563: The trees in Jeremy's House were too bright, blending in with the grass too well. With the far textures having been darkened, I needed to do the same for world 1, for consistency reasons. The result? Well, aside from the tree species being rerandomized and darkened, the basic idea is the same. Of course, with the species change, there's also trunk position changes resulting in the tree ending up in the middle of the concrete such as this case. You can see one of the very close weeping willows in the bottom left corner.




Ronnis - updated and varied trees


Date: August 14, 2014
Screenshot #564: Ronnis is like that of Jeremy's House, only even more off. In addition to the brightness difference, I used Ronnis as a test bed to see how the trees would fit in, using just a single type. Now, not only did I make the usual brightness adjustment, I've also got a variety of trees, 3 different types, the same as Jeremy's House. You can clearly see the 3 different types of trees.




Ronnisa Plains - the foreground area trees


Date: August 16, 2014
Screenshot #565: I planned on having Ronnisa Plains with trees in the foreground area for several years. Now that trees are available, that is now a reality. I was intending on having trees at 1 SU, but it doesn't make sense as the trees would literally be inside the terrain. Thus, I rejected that (which also cuts out about 3 1/6 MB of memory). I'm not actually done with these trees yet. Why? Those eastern cottonwoods are incredibly tall, much taller than any of the other tree types. Thus, I'm considering splitting them out of the main layers and just using separate images instead. They are fairly rare trees but there's still plenty of optimization available, probably another 1 to 1 1/2 MB. Due to the rain, I need to be watchful of the memory usage in Ronnisa Plains as well, considering that the rain is in need of updating for standardization.




Maglev Train - trees old and new


Date: August 16, 2014
Screenshot #566: At the bottom: the old trees I had for placeholders. Above those: the new trees that are rich and vibrant. Those spruce trees have a considerable amount of detail present. The other ones... what detail? Although the forests are intended to be intermittent and varied instead of like this, I'm only using placeholders for now. I'm mainly just after previewing the effects and preparing for my intended video to demonstrate the trees.









Earth curvature effect - reworking the sky


Date: October 21, 2014
Screenshot #567: After a long break, of which ended very suddenly due to figuring out a solution to how to go about reworking the sky for the Earth curvature effect. This screenshot shows the level of detail and depth I've gone through just to accomplish this. Why redesign the sky? With the Earth curvature effect, the ground will shift downward which also means the sky will have to shift with it. The current design doesn't allow for shifting. This new system has many advantages but it also has a few disadavantages. The pros heavily outweigh the cons though.

The biggest advantage is that the sky has a far smoother transition than ever before. Instead of being purely stage-based where the image for the current stage is drawn fully opaque with the image for the next stage drawn partially transparent on top of it, the new system has the images themselves scaling and shifting as needed. This allows for a far more gradual change. What's more is that, instead of the stars abruptly coming in, they gradually come in.

The next biggest advantage is that it cuts out about 5 MB of memory (estimated). This is because I only need the gradients and a single image for the stars. Currently, I'm using 5 separate 1024x384 images (with some optimization where possible) for the stars. I only need a single 1024x768 image that never moves. I also don't need the bottom part added in either which will completely eliminate that part, saving another good chunk of memory. Monotonic images, from the Earth curvature effect itself, will replace this. There is an X and Z resolution setting (configurable independently) that controls how decent the quality of the Earth curvature effect will be.

The third biggest advantage is that it fixes the "dark bottom" problem. If you were to look at photos taken from 20 miles (32 kilometers) above, from weather balloons, or from the International Space Station, from weather balloons, the sky is still very bright at the point where it meets the horizon. The current design doesn't have that but this new design allows for it. This should greatly enhance the realism of the effect.

The other advantage is that the sky realistically shifts as the Earth itself curves. You're probably thinking that there isn't any point in doing this short of a player taking jumping or what not to the extreme. Well, even in normal game play, within the main levels even, the effect is noticeable. Consider air taxi, world 7. You're only barely 1000 feet (300 meters) above the ocean. Even then, there's a good 13-pixel shift downward, if I recall, just from the Earth curving. You won't really see the curvature as it's way too slight at that altitude. However, consider Sentus Mountains, world 10. There is an intended level that will push past about 27,000 feet in altitude. The Earth curvature effect will be quite noticeable at that altitude though not strongly. The downward shift, however, will be very noticeable.

The biggest disadvantage is that the whole system is very complicated to do. This is a disadvantage only on my end. Once I figured out how to approach the task, that's when it really took off. At the point of this screenshot, I pretty much have everything figured out in full, as this screenshot shows the level of detail.

The next biggest disadvantage is that the system will require a fairly GPU-demanding task: scaling an image down. This will need to occur a lot but the frequency can be reduced by reducing the X resolution of the Earth curvature effect. However, there are optimizations I'm well aware of that will keep this to a minimum.

The last disadvantage is that it will require several more draws. This, however, is almost a nonissue with the optimizations I'm well aware of, the same optimization in the above case, though the effect of those optimizations are stronger in this case. At a low altitude, such as near sea level or the ground in most worlds, most of the draws occur from the main scenery. It also happens that the Earth is pretty much perfectly flat so I can use very few draws in the already draw-heavy sections, about as many as are used now. However, as altitude increases and the curvature is stronger, the Earth curvature effect will use more draws. However, by then, the bulk of the draw-heavy scenery is out of the view so the effect, overall, is minimal.

Given this, you can see that the redesign is well worth it, improving the over all realism and quality while using less memory and having a minimal impact on the draws though the repeated scaling of images will be a bit more costly than usual. Now, just imagine jumping up at 6000 mph (10,000 km/h) and watching the Earth turn from being flat to becoming curved right before your eyes! What an amazing effect that would be!

You're probably wondering what all this even means. Well, the column headers say a lot. The red, green, blue, and alpha color values are a lot higher because I'm using integer math and to enhance the precision, it is necessary to multiply by a bigger value. When done and rounding is needed, add half of that multiplier then divide by it. This section is for the dusk sky. Note how the pixel count steps from 2 then, after a certain point, steps by 4? Note how the alpha is fixed for a while (at the maximum) then suddenly starts decreasing. This is because the stars are coming out at that point. There's still even more columns to the right as well on top of all this.




Earth curvature effect - day sky before curvature


Date: October 22, 2014
Screenshot #568: From the altitude of a weather balloon near its peak height, this is roughly what the sky looks like, as I have it. It turns out that there isn't as much of a memory optimization as I was thinking as it seems that I've optimized the previous system a bit better than I thought I did. However, the sky, in this case, is much smoother and much more realistic than the previous system. In this case, stage 4 is close to maxing out where stage 5 comes in. I used to have 12 stages but a very dark blue with an alpha of even 4 has practically no effect on the bulk of the scene and only a very slight effect on the stars and other bright objects. Thus, I've reduced it to 9 stages. In the end: a bit under 1 MB saved for the day sky and nearly 2 to 3 MB saved for the other skies each. The stars really do gradually come in as I had intended. I'm really impressed and the rich, deep blue really stands out well.




Earth curvature effect - testing the curve


Date: October 24, 2014
Screenshot #569: This is my first look at how the Earth curvature effect is. The dusk sky doesn't join up to that checkerboard simulation because I'm focusing on one thing at a time. Either my math if off somewhere, using the wrong formula (I checked it in Excel, doing multiple test cases), or the Earth curvature effect is stronger than I was anticipating. What's with the checkerboard pattern? It's so that I can see the individual chunks. This is based on the X resolution being 59. Clearly, I need a higher resolution than that. This is what the testing is for, to see how things are. As a side note, this is also roughly the view from the highest accessible altitude that platforms will be at. If you look closely, you can see that the sky has actually shifted downward. This is the only thing I have working for the actual Earth curvature effect at this point.




Earth curvature effect - view at highest normal point


Date: October 25, 2014
Screenshot #570: Except for possibly adding in lighting effects, the Earth curvature effect is pretty much done. What's the point of even having this effect? This screenshot says it all. Although the exact height is uncertain, this is roughly what I'm expecting to see for the height at the highest accessible point in a normal level, the level at the highest elevation of all in the entire game. That is, you can be standing on a platform at this altitude but there aren't any platforms higher than this. From this altitude, which is just a hair higher than Mount Everest, you can clearly see the curvature of the Earth. While it's not strong, the sky is noticably offset downward. I've since updated the dusk sky so that the stars come out even earlier (if you look closely near the very top, you can see them though the stars aren't final - I have to finish the overworld before they will be). Further optimizations and an X resolution of 1024 are used to maximize the quality of the effect. And to think that a 2D platformer gets this effect... that's really something! At the heart of it all is nothing new: Pixels*Scaling = CU... and some geometry involving big numbers.






Footnotes:
None.