This is a demo for a system I developed that can store console-size game worlds on a Pico-8 cart. It contains every level and sublevel map from the original Super Mario Bros., and you can run and jump through all of them. There's no level progression, sound, or things to interact with besides platforms, but the map data includes placeholders for enemy spawn points and interactive objects, just uncomment a line in the init() function to make these visible. I'm not planning to release the finished game, as I don't want it to be taken down for copyright reasons, but I wanted to show some definitive proof that large-scale games are possible on Pico-8.
Cart Technical Info:
- Uses standard map() and sprite flag functions (w/special camera offsets)
- 60fps w/ CPU usage between 11-25%
- 1352 tokens, including streamlined platformer engine and graphics/map decompression systems
- 35% of compressed storage limit
- All maps contained in 3.9KB of binary data in map area
- No data stored in the 8KB spritesheet
The big thing is the last point on the list. Instead of storing the nearly-incompressible level data in strings, I instead store the spritesheet in a string because it compresses over 2:1, leaving a full 12KB of potential level storage space. This means that while leaving the majority of compressed data capacity and token count unused, 3 copies of every Super Mario Bros. level could fit on the cart! By my estimates, the worlds of mid-sized NES games like Megaman, Ninja Gaiden, Castlevania, Zelda, and even SMB2 (or original ones with similar scope and detail) could fit within that 12KB limit with some optimization. For instance, I estimate that Zelda 1's whole world could fit in around 6KB.
This demo was built entirely in Pico-8, using a graphical level editor that I plan to release in the near future. It's currently a bit limited due to being tailored to the quirks and limitations of SMB, but I intend to add some more features and make it easy for anyone to build their own large game worlds using a simple point-and-click interface. Here's a little preview =).
Oh hey, neat! I had this same exact idea a while back and I messed around for a bit trying to make something similar myself, yours seems a great deal more efficient, though, using the whole map I would've likely only just barely managed to cram everything in. It's messy and really only an experiment that I was messing around with, and I did everything by hand and etc etc etc, anyway, good job! I have a considerably more complex metatile system I use based off the Genesis/Megadrive Sonic games, I should definitely try and see if I can use your tricks to make that more efficient.
Feel free to use my tiles, not just you, but anyone who wants to. I feel I did a good job replicating the look of the originals. You've definitely got a nicer Mario sprite, though. It'd honestly be really cool to see someone port a full-length NES game, shame that doing so at least with SMB1 will likely incur the wrath of the big N. I may attempt to port one of the 8-bit Sonic games someday myself, though.
Thanks, (oh, and btw, I do really like your small Mario sprite =)
I know others have worked on metatile-type systems before, I just wanted to push things further with a really efficient system that lots of people can use. Hopefully people will like and use my editor once it's released, as I'd like to see more games that don't require devs to invent a new custom compression system or cut resolution or active screen area in half to fit much content on a cart.
I think my approach is simpler than others largely because I haven't learned to code using elaborate scripting and OOP, but very basic stuff (including tinkering a bit with actual BASIC). I actually got the core idea from watching a tutorial from Doc Robs on YouTube in which he used the map() function multiple times at once to make a scrolling background. I wondered if this could be used for individual objects in a level like trees and blocks. With some trial and error I figured out how to make levels this way, with the map data area serving as a sort of scratchpad, or palette of objects that can be mapped wherever I want.
Here's a super-compact version of the core idea that takes just 135 tokens and (besides the data strings) uses fewer characters than a single tweet. It only has a chunk of Level 1-1 which I repeated a few times because I had to code each object in by hand in hex, but it's capable of full levels. My current build has more storage-efficient level formatting, is way easier to make levels for, and makes game interactivity much easier, but the basic idea is very straightforward.
Metatiles and mirroring (simetric metatile so you store only half of it) has been a solid proven approach to increase map size reducing variation in map desing for ages, particularly in NES. There's even extremes like zelda that had full screen height 16px wide metatile columns and conformed the screens with very few bytes each. Nice to see some good implementations on that.
What do you mean, exactly?
Thanks, this took quite a while to get working how I wanted, but I just got annoyed that I was able to make a little tweetcart platformer in 280 characters that was 160 screens in size, but would be limited to a world 1/5 that size using the standard map system.
I'm working on ideas for the next version of the editor, hopefully making it versatile enough to handle a wide variety of games. At the moment I'm trying to see if the game world from Mega Man 2 could be made to fit into a cart, and how that might work ;).
Thanks. Don't put yourself down too much, though, I have absolutely no idea how to make a card game. =)
Oh, I know it's definitely not perfect (the little bugs in the collision detection bother me more than the imperfect physics), I just wanted to get a functional little platformer engine in there with relatively low token use, and for only 400 tokens I'd say it's pretty good. There is momentum, I guess it just doesn't work the same way as in the original game and I didn't figure out how to animate acceleration smoothly. If I were releasing the finished game I'd try and make the controls feel spot-on.
@JadeLombax I'm super proud of my card game! I play it every day, which is why I still find the occasional bug, haha. PICO-8 has been a fun creative outlet with lots to learn in a very satisfying way when it all comes together. Seeing what can be accomplished with some of the more advanced techniques like this one blows my mind, but it's great knowing I can study the code and work out what's going on . . . eventually :).
I've made some progress, it's just been slow developing the new systems required to make it more versatile, such as a realtime-rendered metatile thumbnail system and selectable icon menu, translation of 1D coordinates into 2D level maps for better compression, a compact autotiling system to allow for more complex level graphics than would otherwise be possible, and a palette-based system for tile animation. I'm basically trying to build an integrated graphical development environment for NES-scale game worlds from scratch, and learning as I go because I don't have that much programming experience. Other things are also demanding my attention more these days. I guess I could release it as a work in progress if there's enough interest, but it has some distinct limitations & rough edges and documenting and providing instructions for everything will still take a fair amount of work.
Well, it's not going to be really 'finished' for a little while, but I'm thinking about releasing it as a work-in-progress to get some feedback and make it better. I've had some difficulties, not so much from a technical perspective, but more from a design one, such as figuring out the format and feature set to make it both user-friendly and versatile enough for a wide variety of games. Things like how I'm categorizing the types of metatile objects, working on making properties of them user-configurable via in-editor switches and figuring out how configurable to make them, stuff like that.
I guess if I release it in-progress, though, I'll have to warn people that figuring things out could be a little tricky, and updated versions could make levels created with previous ones incompatible.
I guess that's true.
I'm pretty picky about my work, though, and wouldn't want to release something in a shoddy state that other people would have to remake into something useful. A big reason I started working on this in the first place was to provide a tool to people that would allow them to make larger-scale games without reinventing the wheel each and every time.
I think I'll try and pare back my ambitions a bit and not aim to make this a comprehensive package at first, but take what I have and fix it up enough to provide a functional system with baseline features and enough explanation that people can use it as-is, then see about expanding it in the future.
I've pretty much finalized the feature set of the initial version of the editor, and simplified things with a more straightforward and open-ended system than I was trying for. As merwok said, the people here should be capable of optimizing and adapting it for their needs, so I guess I don't have to plan for every possible use.
Some basic specs should include:
- Support for levels up to 256 screens in size(!), with user-definable width and height
- User definable object properties including size variability and repeating tile patterns
- Variable-length encoding of objects for minimized level size
(2-3 bytes per object, with room for optimization via lookup tables)
- Realtime-rendered object thumbnails
- Export function for converting strings directly into binary data to store in spritesheet or map area
- No editor graphics stored in the spritesheet, so entire area will be available to users
It should still take a little while to get things fully implemented, but at least I have a pretty solid plan now.
Edit: maybe (with crediting) I could use the editor to help with my game (here: https://www.lexaloffle.com/bbs/?tid=39432). (just saying I'm not picky and I'm pretty sure that not many people are so maybe you can release a demo version).
I've thought of that, but if word of it got around, Nintendo would swoop in and threaten legal action, and I'd have to take it down. =(
In better news, I've just about completed the initial version of the metatile level editor, just doing some tweaks and bug fixes. =)
[Please log in to post a comment]