Log In  

Cart #tjlr01-0 | 2021-06-16 | Code ▽ | Embed ▽ | No License

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.

P#93586 2021-06-16 02:30 ( Edited 2021-06-20 04:55)

This is amazing!
When I saw your tweet of this, I was wondering whether you really meant that all the gfx was generated, and clearly it is.
I can't say I fully understand the code, but I'm very impressed! 🤓👍

P#93647 2021-06-17 07:24


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.

P#93656 2021-06-17 14:55 ( Edited 2021-06-18 03:37)

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).

I believe I used similar - but much cruder - techniques in a couple of my TweetTweetJam entries (Prince of Pico and KEEN(ish))

Will deffo be looking to learn & improve from your crunch techniques, for sure.
Thanks again 🤓

P#93729 2021-06-19 10:54 ( Edited 2021-06-19 10:58)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-05-29 17:38:57 | 0.030s | Q:17