Thursday, 25 March 2010

Lists, lists everythings in lists :)

Well I have been playing with lists (std::lists for all the techo's out there) basically these are dynamic easy to use lists that make memory usage as efficient as possible instead of having arrays for everything we just have a list. Lists make everything simple so if we have a ten byte class and we have an array with five elements in it (50 bytes) it will ALWAYS be 50 bytes no matter what, with lists we can have three elements (30 bytes), two (20) or even none (0 Bytes) :).

The reason for all this is simple, when writing a game engine not everything boils down to speed a big thing is also the memory footprint of the engine not every platform is a 4Ghz, 4Gb ram monster. As an example the iPod 1st and 2nd generation is 400Mhz and 128Mb ram with limited space, of that each app gets a maximum of 24Mb (normally around 7Mb) so as you can see writing a cross platform engine is a tough task but one that I have stepped up to the plate for :)

Tombstone will hopefully be a thing of beauty and it will be 100% cross platform when its finished.

I was going to return to arrays BUT after looking into iMinib3d ( another amazing free 3d system for the iPhone SDK) I have worked out where the slowdown was in my code and I can rectify it now so it works like it should.

No comments:

Post a Comment

blogdigger