This is an example of constructing and storing maps in a way that is efficient in terms of both bytes and tiles.
The map in this demo takes only 98 bytes and 26 tiles (not counting the player sprite). That's about 2.4% of the dedicated map space or 1.2% of the total map space. As implemented here, the decoding and map functions - the main things you'd actually need in a game - take 666 tokens. It's meant more as an example than a library, but it's usable as it is, and you're welcome to do so. There's plenty of room for optimization, but I didn't want to make it too hard to read.
The first points of interest are the encode() and decode() functions, which allow you to write and read arbitrary numbers of bits. These makes it trivial to serialize data with a minimum of waste.
Yep, that's what it's called. Sorry.
My first P8 game. Just a simple, straightforward platformer. Three worlds of three levels each. There's no story or anything (I barely managed an ending, and not just because of the token limit).
If anyone wants them, the unminified game, map editor, and other stuff are available here. They're pretty messy, but feel free to do whatever with them. Just be aware that most things "save" via printh. Not a great way to do things, but it worked out.