This is the full level 1-1 from Super Mario Bros., graphics and all, contained in 3 tweets, or 840 bytes. The first 280 bytes contains the actual level data (including level-specific graphics), and the next two contain the rendering engine and the main tileset. I'm thinking about making some more add-on levels, which should each fit in a single tweet.
I've made a number of Tweetcarts, and also worked on systems to efficiently compress graphics and level data to fit more on a PICO-8 cart, so this is kind of the logical combination of both. I'm not going to try and fit a full NES game in tweet form, but it's a neat demo that helped me learn some new optimization strategies.
I don't blame you for not understanding the code, it's pretty crammed. Basically, besides the data strings, which are optimized to use the most possible characters that Twitter won't count as two chars, there are two different core systems.
The first system draws shapes using one of several drawing commands whose names are contained in a table. It's based on the same principle as @TheRoboZ's Picodraw (https://www.lexaloffle.com/bbs/?tid=41225) ,though I'm using a more minimalist approach.
Here's a couple screenshots of my Work-in-progress editor to give you a better idea, the first is the collection of shapes used to draw the sprite graphics which are copied to the spritesheet, the second is the shapes used to draw tile patterns, which are copied to the map area.
The second system is a series of commands that map specified chunks of the map area to the screen. Using some tricky math I managed to condense each mapping function's inputs down to just 4 characters. Functionally it's an ultra-simple version of the system that I'm using in my Metatile Map Editor. https://www.lexaloffle.com/bbs/?tid=42848.
Thanks for the detailed explanation, @JadeLombax - much appreciated.
That's kinda what I figured, from when I was "decompiling" your code
(e.g. I could see flashes of the first couple of systems).
Will deffo be looking to learn & improve from your crunch techniques, for sure.
Thanks again 🤓
[Please log in to post a comment]