Flash Scroll Engine: Super
Tiles (Part 1)
This is based on Strille's
tile based tutorial.
I was quite impressed when I saw his Sonic
Demo in action, basically for 2 points:
Both properties were unreachable with the engine I've used
on my previous games Incoming Storm and Fall
of 21XX (wich actually don't use a tile based scroll engine of any
sort). In order to keep speed, I had to slice the map in multiple secions,
showing only one part at once (and usually with no way to return to a
previous section). That trick worked well inspired on the NES Mega Man
games (I'm guessing they had to do that also for perfomance problems),
but I wanted huge maps like in Mega Man X. So, I with the given documentation,
I adapted Strille's engine to extend the stuff I've developed. The problem
was that I use a different corrdinate system, but after solving some geometry
I was able to do it.
Here's the map of Fall of 21XX implemented to draw and remove
the tiles dinamically. To be fair, Fall of 21XX can be played at 256x224
here.
You need to upgrade your Flash Player
Please visit Flash Player's download page to upgrade. Then return here to try again.

The difference? Well, the whole map is avaliable. You can
reach the boss room and return to beginning of the map, with no major
perfomance impact. That in Flash games is very welcomed.
The fewer tiles visible at a given time, the faster the
engine moves. On slow system, there'll be slow motion on places were there
are many tiles. I've placed many in purpose here and there to test. Definetily
this engine (or more specific, Flash) can't handle screens filled of tiles,
let alone, screen filled of 16x16 tiles. The key in this engine is that
it uses Super Tiles, this is, 16x16 tiles grouped on larger sections.
These can be repeated to create the map. For more information check Strille's
tutorial.
Actually I found another advantage on the Super Tiles and
it was on the level editor.
The engine can actually be used to create more traditional
maps with only 16x16 tiles (in this case the Super Tiles contain
only a single 16x16 tile). Though it works, some perfomance is lost when
the map is drawn on the game. But the real problem comes when editing
the map. As the level editor, I use the Flash IDE. In another FLA file,
I create the Super Tiles, and start to layout the map. Then when pulbishing,
I write on the output window an array with the info of the map created.
Then this text is pasted on the actual FLA file of the game, where the
array is parsed and the map is created. XML can be used for this too,
but for testing purposes I used just simple arrays.
The Flash IDE performs well with huge maps consisting of
big super tiles, and writes the array fast. But on a huge map, with tiny
16x16 super tiles, the Flash IDE performs very bad, and runs the risk
to hang up on slow systems.
Now the question is, how big can be this map?
Part 2
|