segunda-feira, 14 de dezembro de 2009

loading...

Last week I found that SDL was ported to Nintendo DS, so I tought that it would be a great thing to port Rockbot to it - I would love to recreate Rockman 9 and 10 to play on my DS once Capcom do not port it. Actually, the first reason I decided to create the whole Rockbot project was because I was angry Capcom did not wanted to port a game that is NES like to old platforms such as Playstation 2 and I do not have money, nor desire, to buy a new generation console.
But well, once settled the idea, I had to build all the DS SDK and SDL libraries, that showed to be a chalenge, because the SDL port was to an old version of the devkit and I had to fix some bugs before having an working dev enviroenment to build some tests. Once it was done, phase two started, I have to diminish memory usage from 46 MB to less than 4MB, that is Nintendo DS limit.

Now comes the fun part, most programmers today are just lazy to optimize code and take as much memory as he can get, and often people find that the good games are the ones that need a complete upgrade on your system, so you can have and ultra modded PC with internal lazer lights, water cooling and other pimp foolishes. Gladly videogames are not plagued by this upgrade-often fashionism. So, first thing is to use smaller variables, as I'm dealing with values under 64k, all integers were converted to short. Next step is to limit color usage to 256 colors, using web-safe palette, that is nice because looks more like old NES 8 bits style. Finally, we can't load the whole stage in memory, because it is the thing that uses more space, as the program core footset by itself is very small. So, I've lowered the size of the map, and now the game uses only just around 5.1 MB in RAM!
But we need more, so I plan to use the same tricks old NES games used: breacking the stage in parts. Remember how slow was the scrolling when you changed screens on a starircase? Always wondered why some games had a middle-boss room? This is why, in that moment, you just freed one map, and loaded a new one. So, I believe soon, we'll be able to reduce the memory usage to 3MB.

Next step is learn how to edit the makefiles from SDL+DS examples to compile Rockbot to Nintendo DS and test. But as holidays are near, for now I've work on intro and graphics.

In other news:
- you can skip intro by pressing enter
- started to work on a tileset to build a scenary
- made a build to test PS2, works OK but still have bugs with delay/waiters
- PS2 needs adjustments to load necessary drivers according to the unity is is running from, also, set the FILEPATH with it.
- needs to re-work the animation frame delay - for some reason I've lost part of code
- must implement staircase and map "teleport" to another map
- implement sound using SDL_mixer and doomsdl_mixer (PS2)

Nenhum comentário: