save-export
save
save gamename
The save command is used to save your game as a text file with the filetype .p8. The game data is saved within the file and can be read by PICO-8 (including Education Edition). Once saved in this format, you may use the ctrl+s shortcut. Any subsequent saves will overwrite this same .p8 file.
A .p8 file can be loaded into PICO-8 by load
command, or by dragging and dropping the .p8 file into PICO-8.
Carts Folder
To easily find your .p8 files (in the "carts" folder), use the Folder Command.
The default directories for the "carts" folder are:
Windows: | C:/Users/Yourname/AppData/Roaming/pico-8/carts |
Mac OSX: | /Users/Yourname/Library/Application Support/pico-8/carts |
Linux: | ~/.lexaloffle/pico-8/carts |
To change the location of your saved carts, navigate to the .../pico-8/ root folder (the parent folder of .../carts), and find the config.txt file. Open this in any text editor and scroll down until you see:
// Location of pico-8's root folder
root_path C:/Users/Yourname/AppData/Roaming/pico-8/carts/
// Location of cartridge save data
cdata_path C:/Users/Yourname/AppData/Roaming/pico-8/cdata/
Edit the path to your desired paths and save. You'll have to restart PICO-8 for this to take effect.
Tip: You can save your PICO-8 root and carts folder to the cloud (using Google Drive, Dropbox, etc.) to have your games available and saved across multiple devices.
Education Edition
You can save using this command in the Free Education Edition of PICO-8 and it will create the .p8 file and automatically download it to your default downloads folder.
A .p8 file can then be loaded back into PICO-8 Education Edition by load
command, or by dragging and dropping the .p8 file onto the PICO-8 screen in the browser.
External Text Editor
You can open .p8 files in any text editor or your favorite coding program (IDE), such as Visual Studio Code, Notepad++, Sublime Text, etc. This is good for people who want to avoid the PICO-8 font, have more visual space to read and write code, and use specific code editor features such as syntax highlighting in their preferred theme, debugging, and code completion.
Important: Be careful when editing your .p8 files using both PICO-8 editors and external editors because you can overwrite one with the other and lose unsaved changes. Be sure to always save before switching between PICO-8 editing and external editing.
All .p8 game files must begin with:
pico-8 cartridge // http://www.pico-8.com
version ##
Note: The version ## is an integer, for example version 0.2.5g
is actually version 41
when viewing the .p8 file in a text editor.
There are some designated strings that are used to properly separate code, tabs, graphics, map, sfx, music, and label data. These are:
__lua__ |
Designates the start of the game code. |
-->8 |
Designates the start of a new tab. |
__gfx__ |
Designates the start of the sprite graphics data. |
__map__ |
Designates the start of the map graphics data. |
__sfx__ |
Designates the start of sound effects data. |
__music__ |
Designates the start of music data. |
__label__ |
Designates the start of the 128x128 cartridge label data. |
85
8 May 2023
.png
export filename.png
The export .png command is used to save your sprite sheet as a 128x128 image of all 4 tabs of the sprite sheet arranged vertically. For example, here are the four sprite sheet tabs exported, and for comparison is the Jelpi demo game's exported spritesheet.


It is important to know that the lower half of the sprite sheet and the lower half of the map share the same data space. This is why Jelpi's sprite sheet looks strange. Tab #2 and #3 are not being used by the sprite graphics data and instead, they are being used by the map graphics data.
50
16 Apr 2023
.png
import filename.png
You can import a .png of any size and PICO-8 will write it onto the spritesheet, doing its best to convert to the PICO-8 palette and taking only the 128x128 pixels from the top left corner of your image.
Importing multiple spritesheets will overwrite the previous one.
Drawing a spritesheet in an external tool (Aseprite)
using the import command

imported spritesheet

Importing by Drag and Drop
You can also drag and dop .png image files directly into the sprite editor. This will import the image file the same as using the import command but will use the currently selected position on the sprite sheet to be the top left corner of where to begin importing the file.
270
6 May 2023
export -l filename.png
The -l
switch is used with the export .png command to export the cart label as a 128x128 image, instead of the sprite sheet.
38
6 May 2023
import -l filename.png
The -l
switch is used with the import .png command to import the cart label.
If you ever saw some great looking cover art for game carts and wondered how they did it, an easy way is to capture a screenshot label of your game using F7 (or ctrl/cmd + 7), then export the label as a 128x128 png image, then edit in an external program, then import your new label.
Edit Labels in an External Editor
38
6 May 2023
.wav
export filename.wav
The export .wav command is used to save a single sfx or music pattern as a wav file. Which you save depends on the currently selected editor.
To export a single SFX pattern:
Navigate to the SFX Editor and select the SFX you want to export. Next, press ESC to return to the command line and type the above command. Your .wav file will be saved in the currently opened folder.
export filename%d.wav
To export all SFX patterns:
Use the %d
control at the end of the filename to export all 64 SFX patterns as separate wav files, whether they are filled or empty. You must select the SFX editor first. If you have the Music Editor open before using this export command, it will include the %d in the filename and export the selected music pattern with that full filename.
39
12 May 2023
.wav
export filename.wav
The export .wav command is used to save a single sfx or full music pattern as a wav file. Which you save depends on the currently selected editor.
To export an entire MUSIC pattern:
Navigate to the Music Editor and select the pattern you want to export. Next, press ESC to return to the command line and type the above command. Your .wav file will be saved in the currently opened folder.
If your music pattern loops infinitely, then it will save as a repeating loop until it reaches 4 minutes and 30 seconds.
43
12 May 2023
.map.png
export filename.map.png
The export .map.png command is used to save a single large image of the entire map of your game as it is saved in the map editor.
Map Image Dimensions | |
---|---|
1024 x 512 | pixels |
128 x 32 | tiles |
For example:
( Exported Map of "Jelpi" Demo Cart )
Remember that the bottom half of the map is shared with the bottom half of the spritesheet. So while Jelpi's map looks nice above, that same data appears in Jelpi's spritesheet as:
38
15 May 2023
.p8.png
save gamename.p8.png
The .p8.png or simply .png command is used to save your game as a special image format. The game data is saved within the image and can be read by PICO-8 (including Education Edition). Once saved in this format, ctrl+s and subsequent saves will overwrite this same .png file. (See export below to avoid this.)
A .png file can be loaded into PICO-8 by load
command, or by dragging and dropping the .p8, .p8.png, or .p8.rom file into PICO-8 (this also works in the Education Edition).
Cartridge Label
To create a good looking PICO-8 game cartridge, you will want to include an image of your game that will go in the center of the cartridge image.
Press CTRL+7 or F7 to capture what is currently displayed on the PICO-8 screen as your catridges label. This saves a 128x128 image as PICO-8 graphics code and is only used when saving a .png cartridge.
If you do not capture a label before saving as .png, then your cartridge will be blank and PICO-8 will display: "Warning: Label is blank", however it will still save correctly and look like this:
See Save Label for more information.
Title and Author
It is possible to save text to the catridge image in the dark gray box below the label. This is customarily used to first write the title, then write the author (developer) name.
To do this, simply add two comments as the very first two lines of your game's code.
--[game title]
--by [author name]
For example, to create the game cartridge for one of our bite-size games like this, we used:
--fishy
--by nerdy teachers
export gamename.p8.png
When you use export
to save a cartridge to a .png format, it is the same as using save
but without changing the active file you're currently working on. This is helpful when you want to create a copy of your work in a different format, like .p8.rom, to share with others without accidentally overwriting it later as you continue to work on the original .p8 file.
59
15 Apr 2023
.html
45
22 Jan 2023
.bin
43
22 Jan 2023
35
22 Jan 2023
53
22 Jan 2023
@url
save @url
This command is used to save your game as an encoded link, not as a file. Once saved in this format, any subsequent saves will not update the url, and instead will overwrite the active file (.p8, .p8.png, or .p8.rom).
When using this command in PICO-8, the URL link is copied directly into your clipboard, ready for pasting. When using the Education Edition, the URL is updated in the browser address bar and not copied into your clipboard automatically.
Here is an example link, try it out:
First introduced in changelog for version 0.2.4c.
- Can only hold up to 2040 characters.
- Only the code and graphics data are encoded into the URL, not the sfx nor music.
23
12 May 2023
.rom
save gamename.p8.rom
The .p8.rom or simply .rom command is used to save your game as a raw 32k binary format, not as an image. Once saved in this format, ctrl+s and subsequent saves will overwrite this same .rom file. (See export below to avoid this.)
A .rom file can be loaded into PICO-8 (by load command). So far, these does not load into the Education Edition.
The changelog for version 0.2.3 zep introduces the .p8.rom format with this:
This isn't a very useful feature unless you are manipulating PICO-8 cartridges with external tools, but it has always irked me that it is not possible to write 32k of PICO-8 cartridge to a file that is 32k!
save -t gamename.p8.rom
Adding the -t to the command saves your game as a tiny cartridge with only the code data and not as an image.
The changelog for version 0.2.4c zep introduces the .p8.rom format with this:
You should get a file that is exactly as large as the compressed code size reported by INFO. When using LOAD, that file will be loaded into the code section, and the other sections reset to their default states.
There isn't much practical use for tiny .P8.ROM files, but I think it is nice to be able to store a tiny program in its true tiny form on disk.
export gamename.p8.rom
When you use export
to save a cartridge to a .rom format, it is the same as using save
but without making the cartridge you're currently working on the one that's being saved. This is helpful when you want to create a copy of your work in a different format, like .p8.rom, to share with others without accidentally overwriting it later as you continue to work on the original .p8 file.
42
15 Apr 2023
.lua.png
export filename.lua.png
The export .lua.png command is used to save the entire code of your game as a single large image of all tabs in the code editor.
Any code that trails off the right beyond 192 pixels will be cropped out. That is 64 pixels beyond the single visible PICO-8 screen of 128 pixels. It will fit about 48 characters wide in a single line.
Tabs will be reduced to single character width spaces regardless of your tab_width config setting. However if you have the draw_tabs config setting turned on, then the tab lines will be included in the export.
Example of a full size code image (shrunk to fit webpage, real size: 1920x1314 pixels):
( Exported Code of "Jelpi" Demo Cart by Zep )
Example of how having a small amount code will auto crop the image (displayed as real size: 192x66 pixels):
The height of the image is adjusted to break into columns of code. The breakpoint is not a fixed pixel nor line number. And as you can see below, the export will respect the whitespace (spaces, tabs, new lines) of multi-line strings.
Why would you want this?
Certainly not to share your code with others! Oh, no, no no. But what if you are quite proud of the very first game you ever make in PICO-8, or the largest or most popular game project you have made? Well imagine exporting the full code as an image, printing it out, framing it, and hanging it on your wall! Now that is a beautifully nerdy trophy if we do say so ourselves!
Speaking of art hanging on your wall, just imagine the ascii art you could create inside of the code editor and export it at a resolution much larger than the PICO-8 screen!
31
17 May 2023