Here's my latest RPG demo. One of the biggest problems I see with creating
an RPG is that the maps can take up too much space, so I implemented a
compression format for the map data. The compression scheme is basically a
map descriptor language that can fill areas with tiles and generate
pseudo-random tree areas with one or two byte commands.
This map is a 70x70 tile map (Each of the four main Ultima maps was 64x64)
and the map data is only around 300 bytes. This is quite good considering
that if the map were stored in a simple packed format, it would take up
about 2.5K. Realistically, this map will probably be closer to 400 bytes
once the gameplay information is added, but that's still very good and
allows for an enormous world.
Scrolling the map while decompressing was quite difficult with the few
cycles between frames. I use two frames to completely render the new
screen. This causes a little bit a flicker on the edge sometimes, but I
have some ideas for how to reduce this. VBlank didn't offer quite enough
time to finish my processing, so I have my processing loop check to see if
the timer is about to expire, and go ahead and end VBlank if it is
close. This gave me a little extra time for processing during the blank
lines towards the top of the screen.
The joystick moves the character around the world in this demo. There is
currently "no collision detection".
-PaulAttachment:
rpg.bin
Description: Binary data
Attachment:
scrolling.zip
Description: Zip archive