Prototype code…

Today I’ve decided that code written for prototypes should ALWAYS be thrown away. No questions asked.
This morning I was changing a few vertex and pixel programs to support some of the new environmental effects I’ve been working on. This led me to remove some data from the terrain that used to be used for coloration. The color data is now stored in a compressed texture instead.
While cleaning up the C++ side of things, I noticed the terrain rendering data was laid out in almost the worst way possible – both for performance and memory. I can’t think of too many worse ways to do it.
I wrote that code while I was prototyping Banished – way back sometime in 2011. I probably wrote it in less than a day, and it worked for the prototype so I never looked at it again. Why would I? It never caused any problems and never required any additional features.
The terrain was using something awful, like 28 megabytes of memory. After fixing things up properly, it now uses 4.25 megabytes for rendering the exact same thing. As a happy side note, I got an immediate 10 FPS frame rate increase when i reduced the memory usage.
Graphics AnomalyHowever, the first time I ran the game after reducing the memory I got a good graphics explosion. I mentioned this occuring previously – Graphics Explosion.
This was a particularly fine example of sorta awesome terrible graphics errors. At leat it was easily fixable.
As a side note, I’m somewhat amazed at my memory usage level. Two weeks ago, I saw the DX9 renderer using 310Meg on a fresh map. Today my DX11 renderer using 74Meg. Woo.
Maybe I should skim the rest of the code for remnants of the prototype…


    June 3, 2013 9:50 am

    Works pretty well with the winter scene.
    It would actually take a bit of work to intentionally come up with a more effective iced-up-camera-lens effect πŸ™‚

    June 3, 2013 9:59 am

    This needs to be printed and distributed as a fine work of abstract art.

    On the gaming/coding subject, you should always skim through your code, over and over again. There are always rooms for improvement.

    June 3, 2013 10:05 am

    @Andy – there is always room for improvement, but there is time for that πŸ˜‰

    June 3, 2013 10:14 am

    That town is going FAST.

    June 3, 2013 10:15 am

    that looks cool πŸ˜€

    June 3, 2013 10:16 am

    also, I’m really gonna need to get me a dx11 video card. I foolishly bought a dx10 card just before dx11 came out. it’s still fine performance wise but dx11 would be swish

    June 3, 2013 10:18 am

    @DAn – yes!

    June 3, 2013 11:19 am

    Awesome pic. Its like a huge freak heatwave going through a winter town causing some sort of wierd mirage effect

    June 3, 2013 12:11 pm

    I have to say that I have learned so much simply by reading your updates…seriously, it’s like i’m taking an on-line course in this! Now if this stupid computer monitor would just take the $$$ I keep throwing at it, all would be well!


    June 3, 2013 12:26 pm

    I’m guessing whatever shader you used to make water ripples some how got spread over the rest of the scene? XD
    Looks great!

    WarBane, BANISHED
    June 3, 2013 4:56 pm

    I love this game and have been following it for a while. I think this project is awesome and not many games have mastered this style of game but this one seems to be really close. I have been telling all my friends about this game and have spread it through my school. It would be nice if this game was natively on mac so i dont have to wait for a port or wrapper. Thanks!!

    Tom Duhamel
    June 3, 2013 5:13 pm

    This effect is really nice to simulate the citizens having a nice party and drinking too much. You should keep it it.

    Efe M
    June 3, 2013 5:45 pm

    For some reason, I love optimization stories

    June 4, 2013 7:39 am


    If you want to play games, you should just buy a Windows pc. Also better bang for your buck

    June 4, 2013 9:23 am

    Awesome improvements! πŸ™‚

    strandstoel hout
    June 6, 2013 7:10 pm

    I don’t even know the way I stopped up right here, but I assumed this post was great. I don’t recognize who you might be but definitely you are going
    to a well-known blogger when you aren’t already. Cheers!

    June 7, 2013 8:21 pm

    Thanks for sharing your thoughts on just click the up coming page.

    maillots de foot
    June 9, 2013 7:36 pm

    This was one of the best things I’ve ever seen.

    June 19, 2013 10:26 am

    why donΒ΄t you let us finde the bugs ??

    June 25, 2013 1:06 pm

    However in order to attempt my plastic material shoes boycott, Let me need a program. Given that clinging this cloth shoes within the entry way is just not foul-proof and also forgetfulness-proof, Now i’m finishing that will I am going to need to have a shoes will have on palm always compact one louis vuitton shoes outlet that will easily fit into my own shoes and also cut on to my own critical diamond ring just like it via ChicoBag.

    July 1, 2013 4:58 am

    I have been reading a lot on this topic lately, but your info is great. You have written your article in a most unique manner. best prom dresses here