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






Jeremy's House - ground decal resolution problems


Date: Nov 13, 2011
Screenshot #211: Since Jeremy's House also had the same nonstandard spacing issue, I also needed to redo it, though mainly the foreground. Until this time, I haven't had any problems with my ground decal system. However, should the scaling get closer than 6, then I do have problems. This is due to the fact the finest resolution I could use was 1/64 scaling unit. To allow for the 1/512 scaling unit that I needed for this, I had to not only update this part of my game engine, but fix the bugs. One of the bugs took nearly 3 hours to figure out. This screenshot gives an idea on this. Now, the ground decals work to 1/512 scaling unit just fine... until I get beyond a scaling of 1536. Remember that a scaling of 1536 is basically 1024 screen-widths into the distance, immensely far. Once the bugs were fixed, I was amazed as to how detailed things were. You'll see the results in one of the next screenshots.




Jeremy's House - making houses 1


Date: Nov 15, 2011
Screenshot #212: I spent nearly the entire day adjusting and redoing the houses. Redesigning their main shape was first (unfortunately, it'll also mean redoing the ground decals some, due to the shadows being different). That part was fairly easy. The looks of the houses are otherwise the same as before, only a little bigger and the usual floor spacing of 2 blocks is used. The larger size meant a larger second floor to go with it, allowing for another window (or room if you will). Outside the addition of a lock on the door, there isn't much difference in the general design. Unlike the previous case where the houses' scaling stepped by 1 where I could simply scale down a 1-scale baseline house as needed, I have houses with scaling stepping by 3's with 2 and, most importantly, 3.25 as the base. It's the 3.25 that means, for optimal accuracy, I need to have the houses scaled to 4 times the original size, essentially as if they had a scaling of 4.

The big difference comes from not how the houses look or are designed, but, rather, how they are aligned within each 2048-CU city block. 2048 CU (300.373 feet, 91.5538 meters) is exactly 64 blocks or 2 screen widths. The roads and sidewalks use up 8 total blocks leaving me with 56 blocks for the houses. The original houses were 310 CU wide with the roof included meaning I could almost fit 6 such houses, though only 5 would work. Thus, after running some calculations, I found that, with 11 blocks for each house and a half-block padding on both sides, I have the entire 56-block remainder used up. However, houses joined roof to roof doesn't make sense. I had to include a gap between the houses that was large enough for a reasonable distance between roof tops, but to maximize the living space. This is where I had a hard time and it was because of the misremembering of the base scaling used (I kept thinking it was 0.5 instead of the correct 0.25). This one culprit caused 3 redos of the roof. Another culprit, the biggest, is the gap between the houses on the edges and the road. This led to a massive 6 redos' worth, though it was sometimes combined with the first culprit. I knew about the 1/2-block clearance from the road on the left and right, but I was over looking the gap between the houses. Costing a lot of the time was having everything aligned based on that half-block spacing and not ending up with the same on the right. Nothing more than shifting the houses half the distance between the roofs was all I really needed.

In the end, I got the spacing I wanted. The roofs are spaced 1 block apart leaving 2 blocks for the ground below between the walls of adjacent houses. This all results in a 1-block spacing between the road and nearest house. The spacing is different on the Z axis though (the depth; it seems strange how I'm working on a purely 2D game but working with 3 axes instead of 2). This is where front and back yards are present, what little there is. This is because land is at a premium around Ronnis (The Yuris region, visible far into the distance beyond the hills, has different rules and regulations).




Jeremy's House - making houses 2


Date: Nov 15, 2011
Screenshot #213: There is one problem I have with doing the houses in world 1 though: 2 GB of RAM. From the day I changed to the i7-2600K processor, which forced me to upgrade my RAM (DDR2 is incompatible with DDR3 motherboards), I had to cut back on total memory. Surprisingly, even 2 GB is not enough for most of my needs. Although it is possible to have 3 GB's worth of memory being used with only 2 GB of physical RAM, overflow results in a lot of speed problems due to having to write to the hard drive, for swap file. The hard drive is extremely slow compared to RAM, thus, it's not the best tool, but it's the only way to have more RAM than physically installed. Due to very limited funding, I've been slow on upgrading the RAM to something I need and the 4 GB original that I had.

This is one case where 2 GB of RAM is really causing me problems. Why such a big image? Efficiency. This is due to the lighting layer that I must have. GIMP's lack of precision with "merge visible layers" or "merge down" steers me away from these making me need to use "flatten image", of which doesn't have the accuracy problems. GIMP versions beyond 2.2 are horrible in many regards - extremely slow scrolling when going off the image, unable to drag image contents without a long-winded routine, and many others, of which slows down my work flow much more than the swap file. For faster results of this, I prepare every layer of houses at once and work on them accordingly. With 4 GB of RAM, I wouldn't have problems here - have GIMP use 3 GB tile cache and 1.5 GB undo history and I'll be in good shape easy (instead of 1 GB tile cache and 0.5 GB undo history, the latter not as important). Because of this, I've had to take some extra measures to get the most out of the little RAM I have. Why only 4 GB? Beyond 4 GB is purely wasted as I only have a 32-bit OS.

The houses are done much the same way as doing the buildings. There's the usual preparation step (though done differently) then the randomization of colors. Unlike the buildings, however, heights are fixed and colors aren't limited from 192 to 255 - they span the entire range from 0 to 255. Why are all the houses black in this case? It's actually temporary. With bucket fill and the "fill similar colors" option, I'm only one click away from setting the house color (after getting the randomization done). Thus, doing the houses is far faster than doing the buildings. There are, like the sky scrapers, 800 houses in all. Unlike the sky scrapers, however, they all repeat every 1/2 Kbl, or 16,384 CU (that's 2402.99 feet or 732.43 meters). Levels in world 1 are very small, typically about 2048x1024 or so, with the supersize level peaking at about 5120x2048, far smaller than the repeat span of the houses.









Jeremy's House - making houses 3


Date: Nov 16, 2011
Screenshot #214: After resolving the memory issues as much as I could (not upgrading), I made all 800 houses in just 1 day. This screenshot shows the first step - preparing the base image. The video above covers this as well though in more depth. First, I resize the layer so that it is a multiple of what I'm scaling. For the layer at scaling 30.25, the most distant of all the houses, the image must be a multiple of 30.25*4 or 121. My spreadsheet in the background covers this - the bold part in the center right is what I refer to for this stage of the process.

Exclusive to the video is the duplicating and spacing of this base layer to form the main image I'll be working with. I put everything into a single layer to streamline my process as much as I can. Unlike the previous screenshot, I don't bother with the lighting layers or all that.




Jeremy's House - making houses 4


Date: Nov 16, 2011
Screenshot #215: After preparation comes random color generation via a random number generator, the noise maps you should be familiar with by now. This is a case where I got 3 luck points, as per my self-entertainment system. You never know what color the next house will be.... Notice that GIMP has 2.8 billion page faults in Windows Task Manager? This is the highest I've ever seen the page fault counter - that's more page faults than almost any program uses for writing or RAM usage outside high end games.




Jeremy's House - making houses 5


Date: Nov 16, 2011
Screenshot #216: After the colors get randomized, I next prepare the lighting layer. It's nothing more than shades of gray. The darker the shade, the darker the color and deeper the shadow. Preparing it is done through nothing more than duplicating and merging as the above video demonstrates very well.




Jeremy's House - making houses 6


Date: Nov 16, 2011
Screenshot #217: GIMP has accuracy problems with "merge visible layers" and "merge down". "Flatten image" is the only way to maximize the accuracy of the colors. For this, I only keep the 2 layers I need visible - the houses with their random colors, and the lighting layer, set to multiply mode. I make sure the background color is black (or any color not used by anything else will work). Once flattened, I copy the image, paste it to make sure it's copied, undo until the flattening is undone, delete the temporary lighting layer, paste the copied part into the remaining layer, then clear out the black.




Jeremy's House - making houses 7


Date: Nov 16, 2011
Screenshot #218: Scaling this resulting image is next. For this, I use my spreadsheet to determine the size I use. In this case, it's the far right column. Why so small? Raw distance. At a scaling of 30.25, these houses are exactly 20,650 2/3 CU away (20 1/6 screen widths, 23028.76 feet, 923.17 meters). At that kind of distance, everything at the size scale of houses is small, very small.




Jeremy's House - making houses 8


Date: Nov 16, 2011
Screenshot #219: With only a single move, GIMP produces 250 million page faults. Can you figure out how to do that? I've known this for at least 3 years by now, though about 650 million is the highest I've ever had until this point. Big hint: look at the screenshot carefully for several clues. Just look at that page fault delta! Yep, every half second, I'm getting about 1/3 of a million page faults. No wonder why I've got 3.1 billion (and counting rapidly) page faults (5 times my previous record)! All I'm after, though the video doesn't show it, is moving the scaled down image into the top left corner so I can finalize it.




Jeremy's House - making houses 9


Date: Nov 16, 2011
Screenshot #220: Finalizing the image is the last step. This involves splitting the vertically-spanned image into a purely horizontal one, joining each set roof to roof so I can make the most out of the memory usage.






Footnotes:
None.