June 3, 2013 | Dukus | 21 Comments
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.
However, 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...
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 π
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.
@Andy - there is always room for improvement, but there is time for that π
That town is going FAST.
that looks cool π
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
@DAn - yes!
Awesome pic. Its like a huge freak heatwave going through a winter town causing some sort of wierd mirage effect
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!
WOOT!
I'm guessing whatever shader you used to make water ripples some how got spread over the rest of the scene? XD
Looks great!
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!!
This effect is really nice to simulate the citizens having a nice party and drinking too much. You should keep it it.
For some reason, I love optimization stories
@WarBane
If you want to play games, you should just buy a Windows pc. Also better bang for your buck
Awesome improvements! π
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!
Thanks for sharing your thoughts on just click the up coming page.
Regards
This was one of the best things I've ever seen.
why donΒ΄t you let us finde the bugs ??
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.
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 http://www.fizzlive.com/member/259672/blog/view/284235/