Here's a cart I threw together for myself to use with the new custom font feature.
When run it will read the spritesheet into memory as a custom font, then copy a code snippet to your clipboard that will import that font into another cart. It doesn't include the values from 0x5f60->0x5f64, that define the overall font attributes. Those must be set manually in the cart you are importing to.
The import has several optimisations. Instead of always copying the entire custom font memory block it starts from the first non-zero memory value in the block and continue to the last. To save characters it will construct two exports: one that uses poke and one that uses poke4 and export whichever is smaller. It will leave out unnecessary zeroes and also trim leading and trailing zeroes in the hex values for the poke4 export. It also stores all the values as a big string that's split and unpacked at runtime to save tokens.
When defining the custom font on the spritesheet each 8x8 tile is one character and any non-zero colour value in the sheet will be interpreted as part of the glyph. The character set included by default is a Irish Gaelic typeface I made myself including character variants with síneadh fada and ponc séimhithe for the appropriate letters.
A little Conway's Game of Life simulation with some slight interactivity laid on top of it. Code is 280 characters. Arrow keys to move about and X to reset.
Simple little cart that tries to load random IDs from the BBS. Try something new. When you've had enough of a cart just select "new cart" from the pause menu. The number in brackets is the ID of the current post it has loaded.
Sadly though I'm seeing weird behaviour with that when I run through the BBS. It doesn't seem to display the correct number when you run this in browser, but it's correct when I run it locally. Sorry about that I have no idea what's going on there. But if you run it locally and want to find the thread the cart you're on is posted to just plug the number in here:
This is an animation editor I've made to help me with my current project. It's made for a very specific use case and I don't expect it to be particularly useful for other people, but might as well post it. In particular it's designed to help compress animations that have lots of repeated elements. e.g. In the example data in this cart the head layer is used across almost every animation, but only appears once in the spritesheet.
To this end it is very much optimised to favour saving space in the sprite sheet, and not optimised for CPU or RAM usage. It also assumes the data outputted is going to be handled in a very object-oriented fashion (see example implementation further down).
I've example animations in the cart (they're for the game I'm currently working on) that should load when the cart is viewed on the BBS, but won't load when run in the normal Pico-8 environment. Feel free to play around with it, but you won't be able to export or save anything from the BBS.
The editor defines characters, which have a set of animations, which have a number of frames, which each have a duration and ten layers to draw on. General usage is just to create animations, which can be exported via the "export" button. This will create four files:
- spritesheet.png - the exported sprite sheet to be used in your game
- metadata.p8l - lua table structure containing all the animation information needed to draw animations from the above spritesheet
- metasheet.png - the same information, but stored in a different format as image data so that the animation editor is able to re-import it
- debug.p8l - the exact data as in metasheet.png but in text format, just for debugging purposes
On startup the editor will import any data from metasheet.png and spritesheet.png back in so that you can continue editing where you left off.
- the window on the left is for drawing, the ten windows on the right are ten layers each frame can use
- you can't rearrange or add more layers but the 'c' and 'v' keys can be used to copy and paste the selected layer
- you need to create at least one character, animation and frame and select a layer before you start editing
- when entering names only english alphabet characters are accepted. Use enter to submit and / or \ to cancel. Backspace works as you would expect.
- use the arrows keys to move layers around (no wrapping - going off the edge will just erase data)
- use the wasd keys to move the origin point
- use - and + to navigate through characters quickly
- use [ and ] to navigate through animations quickly
- use ' and \ to navigate through frames quickly
- p/f toggles the paint or fill tool. Be warned there's no undo button so be very careful with the fill tool
- 'oni' toggles onion skinning
- the 'w' next to it toggles wrapping for the onion skinning. When enabled and viewing the first frame in an animation, the onion skin layer will show the last frame from that animation.
- 'orig' toggles showing the origin point for the current frame
Implementing animations in your cart
when you have your animations finished you should import the spritesheet into your own cart and copy the contents of metadata.p8l into an initialisation function in your game. You will then obviously need some special draw functions to do something with that data. Here is an implementation I have done as an example, taking a very object-oriented approach.
- rewrote large parts of the editor
- optimised processor and memory usage a tonne
- fixed detection of identical layers so that they sprites don't have to be in the same position
- increased number of working layers to 10
- added processor and memory monitors
- added example data
- fixed bug causing data loss on import for large frames
- fixed bug with duplicate frames being assigned the wrong spritesheet y-coordinate on export
- changed import process slightly to make each frame try to use the same origin point as the previous frame in the same animation
- added fill tool
- added optional wrapping behaviour to onion skinning
- export process will now notice duplicate layers and only export them once
- fixed various bugs related to import and export, works much more reliably now
- fixed play button crashing the editor when there are imported animations
- editor will now import previously exported data on startup
- functioning delete buttons
- layout changes
- misc crashes fixed
- fixed right clicking on most elements crashing the cart
- changed input code so enter and backspace now work when inputing names
I wanted to make a little compilation of tweetcarts for a while and The Pippin Barr Game Idea Jam #2: The Museums Jam gave me an excuse to throw something together. Please enjoy this museum of tweets.
I know Zep has said the API is pretty much finalised so I'm guessing he's not planning on adding characters to the font but I think it'd be nice for the purpose of displaying controls/tutorials to have symbols to represent the start button (for posting carts to BBS) and the return key (for posting elsewhere where people aren't familiar with PICO-8 controls).
I made a quick mock up for them sticking to the 7x5 limit other glyphs use.
A month ago I posted a thread on reddit/r/me_irl promising to make a game based off whatever the top comment was - this was the top comment:
"a SSB esque fighting game between all the frog memes (Wednesday, Dat Boi, Pepe, Kermit, etc.) and name it "Me too thanks""
Ok with a bunch of help from LRP I have an entry that works in 139 characters! I'm so happy I managed this. I didn't think I'd actually be able to compress it this small. It was a lot of fun to do.
k=2^13::s::for a=0,k do n=0 for x=0,8 do n+=peek(k*3+a+x/3+x%3*64-65) end poke(a,n==12 and 4 or n==16 and peek(a))end memcpy(k*3,0,k)goto s
Was trying to make Conway's Game of Life into a #tweetjam entry but wasn't able to get it below 175 characters. It reads the screen to do the simulation so while it will always display the same simulation from the BBS you can do whatever input data you want if you download the cart by having whatever you like on screen when you hit run.
If anyone can spot a way to compress it more please share!
I entered a game jam a couple of weeks ago with the theme of "punch nazis". This is the result of my efforts - Super Fash Bash runner up for the "Best Nazi Punch" award for the jam.
Final Edit: ultrabrite has pointed out that zep's official word on it is
"Multicart exports offer a way to package and distribute what you can already do with local files (e.g. zipping up a group of carts), but isn't supported on the BBS and probably never will be. I think feeling invited to design for single 32k carts is an important aspect of PICO-8, so separating multicarts to the exporter is a way to preserve that to some degree while still broadening the scope of what can be made with PICO-8."
From the 0.1.10 release thread: https://www.lexaloffle.com/bbs/?tid=28168
Hey I looking into the idea of using the reload() function in the game I'm working on to possibly store data for extra levels on a separate cart and load them in as you progress. I understand that the HTML5 export explicitly supports multiple carts but I'm not clear on if it's possible to upload multiple carts to the BBS and be able to access data from each other?
Edit: Testing with a simple two-cartridge system I made
Edit2: Looks like it doesn't work when referencing them by their filenames when I post them to the same thread anyway
My first submission, I hope I have this correct!
A classic game of Snake. Start it up with the tab key then use the arrow keys to guide your snake to the food that appears, just don't crash into yourself!
Eat 15 fruits in each level to advance to the next. With each level the speed increases.
- Removed screen shaking on input
- Rewrote input code to hopefully feel more responsive
- Reduced the level of shaking on input
- Stopped certain input combinations allowing you to turn backwards into yourself