This is a replacement for print() that draws a customizable 5x6 font. It encodes each character as one number, and then loops through each pixel checking to see if that bit is set. So it's not very fast, but is handy if you just want a quick solution for some text larger than 3x5.
Cartridge for generating and testing font:
The spritesheet and the convert() function is not needed in the release version of a cart. Paste the following snippet into your code (and optionally replace fdat with your own data):
fdat = [[ 0000.0000! 739c.e038" 5280.0000# 02be.afa8$ 23e8.e2f8% 0674.45cc& 6414.c934' 2100.0000( 3318.c618) 618c.6330* 012a.ea90+ 0109.f210, 0000.0230- 0000.e000. 0000.0030/ 3198.cc600 fef7.bdfc1 f18c.637c2 f8ff.8c7c3 f8de.31fc4 defe.318c5 fe3e.31fc6 fe3f.bdfc7 f8cc.c6308 feff.bdfc9 fefe.31fc: 0300.0600; 0300.0660< 0199.8618= 001c.0700> 030c.3330? f0c6.e030@ 746f.783ca 76f7.fdecb f6fd.bdf8c 76f1.8db8d f6f7.bdf8e 7e3d.8c3cf 7e3d.8c60g 7e31.bdbch deff.bdeci f318.c678j f98c.6370k def9.bdecl c631.8c7cm dfff.bdecn f6f7.bdeco 76f7.bdb8p f6f7.ec60q 76f7.bf3cr f6f7.cdecs 7e1c.31f8t fb18.c630u def7.bdb8v def7.b710w def7.ffecx dec9.bdecy defe.31f8z f8cc.cc7c[ 7318.c638\ 630c.618c] 718c.6338^ 2280.0000_ 0000.007c``4100.0000`a001f.bdf4`bc63d.bdfc`c001f.8c3c`d18df.bdbc`e001d.be3c`f3b19.f630`g7ef6.f1fa`hc63d.bdec`i6018.c618`j318c.6372`kc6f5.cd6c`l6318.c618`m0015.fdec`n003d.bdec`o001f.bdf8`pf6f7.ec62`q7ef6.f18e`r001d.bc60`s001f.c3f8`t633c.c618`u0037.bdbc`v0037.b510`w0037.bfa8`x0036.edec`ydef6.f1ba`z003e.667c{ 0188.c218| 0108.4210} 0184.3118~ 02a8.0000`*013e.e500]] [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=60769#p) |
Hey look, it's a Voxatron update!
Builds are live on lexaloffle and Humble. If you have trouble accessing your account, see this page. If you own only PICO-8, you can now update to the Voxatron + PICO-8 bundle for the difference of $5 here.
This update folds in a lot of fantasy console work, and is the first time you can see Voxatron in something similar to its final form. It has the usual trappings of a fantasy console: carts with labels (and matching .vx.png file format), a boot sequence, a SPLORE-like interface, virtual cpu limitations, and most notably, a Lua scripting API. The API is a superset of PICO-8's one and can be used to write PICO-8 style programs from scratch, or mixed with built-in engine features.
[A note for returning Voxatron users, including "Humble Voxatron Debut" customers: you can also download PICO-8 with the key that you originally purchased with. And if you don't know what PICO-8 is -- have a quick look here because it is very relevant for this update! PICO-8 started as a playground for Voxatron's scripting system, but grew into the fantasy console concept that this update is based on.]
Ring all of the bells in each level to progress -- but be careful not to stand too close!
This cart is my contribution to the Advent Calendar 2018. I think it turned out well as a wee concept game, but it's really the equivalent of a hastily wrapped box of chocolates purchased at 3am on Christmas morning from the closest gas station, compared with the amazing work that can be found in the calendar. Try out the other 24 games here if you haven't already:
I never imagined I'd be excited about releasing a website update, but here it is! This update addresses many ancient bugs and issues, but also aims to support the PICO-8 / Voxatron fantasy console ecosystem. There are new features to make collaboration, sharing, teaching and exploring carts a little easier.
lexaloffle.com is now also running on a new server, on top of a leaner stack that should be much more responsive. Along with a lot of new code running underneath it all, there will still be some new bugs to deal with (apologies to those who were around earlier this week for the bumpy migration process!) -- feel free to report any issues in the comments here, or in the PICO-8 bugs sub-forum.
New Features
Superblog
View a feed of everything going on using the Superblog. You can also follow other users to create a tailored feed.
Featured Carts
The list of featured carts (same as in SPLORE) is now sorted by the time each cart was added to the list, so that it's possible to come back periodically and see what's new without digging too much for notable releases. Selection will be based on a combination of user interaction, manual curation, and the phase of the moon. To kick things off, the first few pages of the old featured lists will be fed through a few carts per day.
Hey Everyone! PICO-8 0.1.11d builds are now live on Lexaloffle and Humble! We are still working on CHIP / Pocket CHIP builds -- I'll update this thread when they are live. [Edit: they're live now with 0.1.11g]
Welcome to the Core
Despite the unassuming version number of 0.1.11, this update marks something of a milestone: The core of PICO-8 is now feature-complete, with API and specifications that are likely to remain fixed. Before it becomes entombed as a read-only blob of C code however, there is still some time before beta to address any issues that crop up. Let's see how 0.1.11 works out and what points of friction emerge.
One of the goals of PICO-8 is to create a stable, familiar medium in contrast to the shifting sands of modern software development. Instead of growing by changing the core of PICO-8 over time, I'm aiming to settle on a minimal, eternal component that can be built on top of (improved tools and bbs integration), extended sideways (extra ports / host platform support), built out from the inside (making useful snippets and carts!), and around (nicer BBS, cartverse, documentation, resources and community events).
v0.1.11 is also the point after which PICO-8 and Voxatron co-development start to part ways -- Voxatron's API and specification is a superset of PICO-8 v0.1.11's. The upcoming Voxatron update looks basically like a 3D PICO-8, with its own version of splore, png cart format, labels, and bbs integration. I messed up the Voxatron release plan partly because of committing to this -- but more on this later in a separate post. o(_ _)o
Many thanks to the numerous PICO-8 users who helped iron out bugs in the 0.1.11 release candidates. I snuck 0.1.11 out via twitter thinking it was pretty solid, but it took 3 more builds to get right. If you find any old carts that don't run or behave strangely, please ping me on twitter, or better still, post a bug report in the support forum. There will be another follow-up (0.1.12) to catch any left-over issues. After that it will be onwards to beta (0.2.0) \o/
A heads up for Voxatron users -- the first version of the Lua api will be out next week in 0.3.5!
Pictured above is the result of drawing voxels directly into a room's map. The 0.3.5 api also provides access to actor attributes and state, spawning, camera control, and direct access to the display. The entire PICO-8 api is in there with some 3D counterparts (line3d, box, sphere), and it's possible to import a pico-8 cart into the resource tree, place it in a room, and run the cart on a single slice of the display. The .p8 cart shows up in the resource navigator, and is placeable in the room like this:
The code can also be edited to make slight adjustments for the 3d display:
In other news, I've updated the website with mobile-friendly cart listings and touch controls for the carts. It's still a work in progress -- the sound in particular is very choppy or missing altogether. But apart from that it is quite useable. If you have a modern phone or touch device please try it out!
Hey All -- PICO-8 0.1.10 builds are now live on Lexaloffle and Humble!
Update: 0.1.10b is up with bugfixes for the html exporter. (Changes)
Update2: 0.1.10c is up with fixed atan2()
Multicart Exporter
The EXPORT command can now be used to create a single .js (and .html) file that contains more than one cart. All of the carts can read, write, and run each other as if they were local files loaded from PICO-8. To do this, add the names of up to 15 extra cartridges you'd like to include in the export: (.p8 format only in 0.1.10)
> LOAD MENU.P8 > EXPORT MEGACART.HTML JELPI.P8 DRIPPY.P8 CAST.P8 |
Inside the program, you can then use RELOAD() to grab data from other carts:
-- GRAB JELPI'S SPRITESHEET RELOAD(0,0,0x2000,"JELPI.P8") |
PICO-8 0.1.9b builds are now live on Lexaloffle and Humble.
This is a bug-fixing update, mostly for crashes related to switching between widowed mode, full-screen and minimized windows. I've also included the dynamically linked pico8_dyn versions in the linux archives, that were missing from 0.1.9.
The Windows installer & .zip file include a more recent sdl2.dll, although there weren't any known issues relating to that.
I've switched back to shift-a..z for glyph entry in the code editor, as alt-a..z is sometimes reserved by the host operating system. If you find yourself accidentally entering the extended characters by accident, you can turn this off in config.txt (near the bottom). To enter glyphs without shift-a..z, press ctrl-k to toggle glyph mode.
Changelog:
v0.1.9b Added: Alternative function key mapping: ctrl-6..9 for F6..F9 Added: Alternative glyph entry method: (ctrl-k) to toggle glyph mode Changed: Enter glyphs with shift a..z, but can be disabled in config.txt Changed: Increased emscripten ram to 128MB (some carts at risk of running out) Fixed: Crash when window size is tiny or minified Fixed: Crash on toggling fullscreen mode Fixed: printh can write files outside filetree (security issue) Fixed: show_fps (can also now be toggled with ctrl-1) Fixed: Shorthand if/then syntax error when using the form: (functionname)(param) Fixed: log.txt not saved in path specified by -home switch Fixed: Default application data folder created even when -home specified Fixed: Missing dynamic builds (pico8_dyn) from linux archives Fixed: Removed unneeded RPATH from linux binaries Fixed: export foo%d.wav fails to write multiple files |
Hey All -- PICO-8 0.1.9 builds are now live on Lexaloffle and Humble!
Posting Carts via Clipboard
The handiest new feature is being able to post cartridges to the bbs via the clipboard, without ever saving it as a png. Use "SAVE @CLIP" to copy to the clipboard as text, and then paste it into a post (hit Preview to make sure it worked and to get rid of the wall of text). You can also copy carts from the BBS (look for 'Copy' under each cart) and paste it back into PICO-8 with "LOAD @CLIP")Posting GFX via Clipboard
You can also do the same thing with sprites. Using CTRL-C in the sprite editor also stores a copy of the sprites as text in the clipboard, and can be pasted back and forth to BBS posts. Here's an example: (click the 40x8 and then CTRL-C the text to copy&paste it back into a cart)Here's a 7500 word dictionary cart for making word games and whatnot. It contains the most common 3-6 letter words according to wiktionary.com, including proper names. The loader is 264 tokens, and the data is 11317, stored over the full map (including shared gfx), plus the last 44 SFX. So there are just 128 sprites and 20 SFX spare. The 5 most common and 10 least common words on the list are:
THE AND THAT WAS HIS RADIUM BAWL LINTEL WAFER WELTER AUNTY OPTICS SIKH LIL BARB |
Technical details..
The data is generated using a convoluted toolchain process, that I'll post later on if I find time to organize it into something useful.
The compression works by enumerating every possible word in order of word size first, and then alphabetical order. So, A is 0, B is 1, AA is 26, and so on. This means that to store the whole dictionary, only the distances between each word's index is needed. There are many clusters of close words (e.g the distance between CAN and CAP is only 2), so the distances are sorted into range categories depending on how many bits are needed to store each range. Repeated categories are common and so can be encoded with a single bit -- otherwise a 3-bit value is used to store the category for each distance. The encoding utility greedy-searches sets of 5 category bit-lengths and a roman cypher to try to optimize the encoded size, which saved around 1k compared with hand-optimizing the parameter set.
UPDATE!
PX8 has been replaced by PX9: https://www.lexaloffle.com/bbs/?tid=34058
But I'll leave this here for reference, and for existing projects using PX8.
This is a library mostly for compressing graphics and maps, but can also be adapted to compress sfx. It is designed for data-heavy carts and requires around 450 tokens for decompression, although this can be reduced if needed by removing remap(), hard-coding parameters, and/or removing predicted spans at the cost of compression performance. If someone wants a smaller/weaker version, let me know!
To use it, compress a 2D rectangle to an address in memory, and supply a function for fetching the source values (normally SGET or MGET). For map data, you probably want to set p.cbits to something like 4 first.
Hey All -- PICO-8 0.1.8 builds are now live on Lexaloffle and Humble! Note that there was no 0.1.7 release for Desktop; there were in-development versions of 0.1.7 released early for web and Pocket C.H.I.P. to resolve pressing issues, so I'm calling this 0.1.8 to keep version numbers in sync across platforms. New stuff:
60 FPS support
This breaks the 'every cart runs the same on all PICO-8s' rule of PICO-8's design philosophy a little bit, but I think it's worth it! On all of the desktop host platforms, it is now possible to make cartridges that display and update at 60 frames per second instead of 30. You don't get any more CPU though, so that means half the usual CPU allowance per frame. From the manual:
:: Running PICO-8 at 60fps If _update60() is defined instead of _update(), PICO-8 will run in 60fps mode: - both _update60() and _draw() are called at 60fps - half the PICO-8 CPU is available per frame before dropping down to 30fps ** please note that not all PICO-8s support 60fps. On machines that do not support it, _update60() will instead be called twice per frame and _draw() at 30fps. You can check the behaviour of your program running at 30fps by adding the following snippet to the bottom of your code: u60=_update60 _update60=nil function _update() u60() u60() end |
The theme for the second PICO-8 Jam was Chain Reaction, and there were 35 entries. Thanks to everyone who contributed and made this jam a another splendid event. I hope you'll join me in congratulating the winning entry, which received a whopping 7.3 PICO-8 star average.. theatrically opens invisible envelope
NuSan! With Combo Pool.
As a token of gratitude for laying down this most excellent cartridge, NuSan will be receiving a commemorative cross-stitch based on the cart.
Also highly rated by participants was another disarming production by JTE: Nora's Mouse Chase, and the beautifully chaotic SPACETANK 9000 by arnodick.
If you'd like to take part in P8JAM2, please select one or more themes by clicking on the PICO-8 star next to it (you need to be logged in). You can change it anytime before the 24h voting phase ends -- at 00:00 PST on Saturday the 21st. Check out the jam thread for more details.
Edit: times's up! The winning theme is Chain Reaction. You have 9 days! Good luck!
Hey All
I'm in the process of simplifying the website a little. In particular, I wanted to improve the experience of playing cartridges in threads by removing clutter. They now look more like a page dedicated to the cart:
- The player starts open
- There's a big obvious play button and large thumbnail
- There's no banner at the top of each page
I removed the PLAY buttons from the thread previews, and autoplay, as I think they're no longer needed -- the whole playable region of a cart is now visible without scrolling after opening the cart's thread, and it's more obvious to new visitors what to do next.
There are still a few small things to finish, but let me know what you think of the new layout, and if there's anything that bugs you.
Time for another jam! EDIT: The theme is Chain Reaction.
EDIT2:
and... that's time! Thanks everyone who contributed a cartridge! If you submitted something with the p8jam2 tag, you can now rate other p8jam2-tagged carts at the top of the cart's thread.
If you'd like to continue working on your cartridges, feel free -- but please leave the compo version at the top of the p8jam2-tagged threads until voting finishes in one week (June 5, 24:00 PST). Good luck!
Same deal as last time, except with some limited theme voting:
Duration: The Jam will take place from 00:00 PST on Saturday the 21st of May 2016 and will finish at 24:00 PST on Sunday the 29th. So, it spans 2 weekends and 5 weekdays. You can spend as much or little time on your carts as you like. Tiny silly cartridges are more than welcome.
If you're looking for a complete portable PICO-8 solution, good news! PICO-8 is going to ship pre-installed on Next Thing Co.'s upcoming PocketC.H.I.P. -- a complete portable mini-computer with built-in storage, wifi, keyboard, battery, touchscreen and everything else PICO-8 needs! The last few months, I've been working closely with the team at Next Thing Co. to create "PICO-8 C" -- a fully functioning and compatible edition designed to integrate nicely with NTC's hardware and software. It will be available to Kickstarter backers, or you can also pre-order one for just $49 bucks.
You can read more about the PocketC.H.I.P. over at getchip.com
Here's 0.1.6! You can download it from your updates page while you're logged in, or from your Humble Store Library. Just a reminder, that if you're a Voxatron alpha customer, you also own PICO-8! (it should show up automatically in both places).
By far the biggest change is the addition of SPLORE, a complete bbs and local cartridge explorer. You can run it by typing SPLORE, or start PICO-8 with "pico-8 -splore". If you plug a joystick in and auto-boot into splore, it's possible to navigate everything using only the 6 buttons + menu button.
This version also has a lot of new data storage functionality. Cartridges can cstore() to themselves in order to save extra data, and this is now officially supported on the web, so don't feel like it's a weird hack that's going to break! (actually it might break, but it's supported, so I'll fix it :p). Here's a demo:
This is a demo of the new cartridge storing in 0.1.6. (you'll need to update to 0.1.6 if you load this in PICO-8)
Press O (mapped to Z or C) to save the screen, and X to restore it. The cursor position is not saved.
To save, the screen is copied to the sprite sheet and then stored for clarity -- but it could have just been a straight cstore(0x0, 0x6000, 0x2000), and same again in reverse when restoring.
if (btn(4)) then memcpy(0x0,0x6000,0x2000) cstore() end if (btn(5)) then len = reload() memcpy(0x6000,0x0,0x2000) end |
This should also work in your browser, even if you close it and run the cartridge again. Please let me know if it doesn't!
Note that in 0.1.6 you can also cstore to separate cartridge files, meaning we can have quite large save games, and also saved data shared between carts on the bbs.
A build of PICO-8 0.1.5 is now available for Raspberry Pi! Check your updates page or look in your Humble library under the Linux downloads section.
It works in fullscreen under either X Windows or directly from the terminal (using directfb). For speed, the default resolution is 280,280; you can set this with the -width and -height switches:
pico8 -width 720 -height 480
Known issues:
- After quitting, keypresses during the session are sometimes dumped to terminal (annoying if you quit by typing shutdown instead of CTRL-Q!)
- Freeze on exit (observed on a zero)
- Some math-heavy cartridges (e.g. /demos/cast.p8) don't run at full speed on first generation models.
There are two builds included in the archive. pico8 is compiled statically (so no need to install SDL2), and pico8_dyn dynamically loads libraries, in case you'd like to supply your own SDL2.
Have fun, and please post pictures if you get pico-8 running on any cute displays!