Tilemap Streamer

Creations

SiegfriedCroes

6 years ago

What is it?

This tech demo lets you move around a large map (size: 3840x3072 pixels, 480x384 tiles of 8x8 pixels each or 48x48 blocks of 80x64 pixels each) that gets streamed from the SD card in real time. It also lets you add/remove blocks and these changes will be saved to the SD card right away.

How does it work?

There are 4 buffers each the size of the screen (that's 10x8 tiles). As you move around the map these buffers get swapped around and filled with new parts of the map to make it seem like it's one big map.

Making changes to the map is as simple as translating the cursor position to the position in the SD card file and writing the new value to it.

Controls

D-pad: Move around

A button: Add/remove block

OPtimisations

Currently all 4 buffers get looped through to draw the tiles in them even when they are only partially visible or not visible at all. I'm sure it's possible to improve this to lower CPU load.

View full creation

Sorunome

NEW 6 years ago

To make reading these strips from the SD card faster, the tilemap data is stored in the SD card file twice: once for reading horizontal strips from left to right and again for reading vertical strips that same way.

Great idea!

Also, why not create a repo and link it instead of just inline-posting the source?

SiegfriedCroes

6 years ago

Thanks!

A repo has been created :)

SiegfriedCroes

NEW 6 years ago

Sorunome Sorunome

Thanks!

A repo has been created :)

SiegfriedCroes

NEW 5 years ago

Update 2018-07-14

I completely reworked the way the streaming works! see description of this creation for more info.