Non Important Updates - April 10, 2008

Mycal

Staff member
Well, while there has been a lot of updates/optimizations to the Demo, there has been a few things that have been slowing the game down on loading/drawing etc.

The biggest was the enormous loading times anytime you started the demo. One problem was generated by the conversion to DX8. I screwed up and packed every single image in a tileset and then packed the whole tileset which was a little redundant and took a long time to do. Once I realized what I did, I immediately fixed it and now all images are pushed into the tileset and then packed as a whole. That sped up loading times a whole lot (which was evident with 7.0.1). Now the only slowdown is the loading of maps. A little info about this process follows:

Before today, maps were saved in a strange manner. I was having problems with the normal method (after this paragraph) and defaulted to this method instead. Every piece of data was stored in a string and padded to a certain length. After the string was formed, it was then compressed/encrypted and stored in a file. Loading was simply reversing this process. The slowdown comes mainly from the conversion to/from string (even though the compression/encryption does take some time itself).

Today I changed this to go back to a good simple method that is much faster. Rather than converting data into a single string (which is wholly a stupid idea), map data is now just put in binary and retrieved in the same manner. Of course I'll still have to encrypt the file itself because the whole process can still be reverse engineered (I just tried and did it with little effort) and since our mapformat was easily available to everyone who downloaded (see bssmf.dll) it would be a bad idea to not encrypt.

So, now maps are loaded faster. And I will also be removing the dependency and just including it inside the project itself. It increases file size but its so small anyway, what does it matter?
 
Top