Hello! I'm new to PICO-8, and loving it. I'm not new to programming or game dev.
I've collected a list of questions/thoughts, in no particular order...
-
Sharing: I've uploaded my first game to itch.io, rather than here, so I can customize the HTML around the player. Is it bad BBS etiquette to link to games on itch? It seems popular to directly share games here, not link to self-hosted or third-party.
-
Single-player: Is there a way to indicate a game is single-player? Maybe a register to Poke()? Ideally it would remove the "Player 2" controls from the Controls screen.
-
Exporting: I like that you can EXPORT the map, spritesheet, etc. "headlessly" via the commandline. Personally I love build scripts, and automatically exporting things. But is it impossible to export a cartridge (.p8.png) and music (.wav) by headless commandline? I must open the editor and type the commands?
-
Music: Does the Speed of a SFX correlate to a traditional BPM? Is there a formula? Or, is it not guaranteed to play back at one BPM depending on platform, etc. (I have seen this other thread, about roughly tracking the state of the music player https://www.lexaloffle.com/bbs/?pid=10719#p10719 )
-
HTML Export: When the p8 file contains a label image, and title (first comments in code), it would be neat to generate OpenGraph meta tags for the HTML (so you get a sleek preview card, when sharing your game)
-
Binaries: Is there a way in-code to know what platform you're playing on? Windows/Mac/HTML with touch controls, etc. Currently I detect HTML with/without touch by writing GPIO bytes from the HTML page.
-
Conventions: The "O" and "X" buttons... is the "O" conventionally Action/Confirm and the "X" is Secondary/Cancel? Like a Game Boy layout?
- Menus: When you add a custom menu item, such as "TOGGLE MUSIC", and the callback function is triggered, is the game supposed to update/advance one frame? It seems to happen to me, but not 100% of the time, inconsistently. Maybe a bug?
That's all for now. I left out some other questions I've mostly solved.
Thanks for any guidance!
> Binaries: Is there a way in-code to know what platform you're playing on? Windows/Mac/HTML with touch controls, etc. Currently I detect HTML with/without touch by writing GPIO bytes from the HTML page.
wah I would like to know this one as well xD scouring from the doc page I haven't found any clue (my guess is that it should be placed in stat function). What I do right now is simply passing the -p argument from command line then read from stat(6), since I'm using GPIO intensively for networking, don't want to waste it
1: It is very common to share on the bbs, which makes games playable in browsers (with up-to-date pico8 version), in splore and on custom off-line devices (by downloading the cart). The cartverse expands thanks to all game devs, and access to the source helps everyone learn things. A game that’s only on itch is not part of the cartverse; people do that to hide their code (although it’s not a perfect protection), or because the game requires something custom built with the javascript gpio interface. In that case, you could make a bbs post to show some pictures and give the address to the game! At least it can be played in the browser.
2: Not that I know of. I think maybe a majority of games are single-player, players just get that because there’s one character on screen, and nobody worries about the controls screen.
3: It should be possible to save a cart in headless mode, see https://www.lexaloffle.com/bbs/?tid=38271
4: A few people have made youtube videos that go in depth into pico8 music (gruber, algorhythmic), maybe you’ll find something. Or come on the discord server and ask in the music channel!
5: You can use your own HTML template for exports, but there are no variables available with game metadata to use. You can try making a feature request (with a bbs post in the right category), but I’m not sure zep would add it. There’s no command to export the cart image for now, also the first two lines being title and author are only conventions, not hard rules. I think you’re better off doing your own templating in a pre- or post-process step to fill in metadata. (A tip: after the initial 'export index.html', you only need 'export index.js' when you update your game, so you don’t lose your customized HTML page.)
6: We can detect bbs and other websites (https://pico-8.fandom.com/wiki/Stat#.7B100.E2.80.A6102.7D_BBS_information), but I think we can’t make a difference between binary exports and regular cart running with pico8.
7: There’s an old debate about whether the button layout is OX or XO, so no. Some games allow switching controls with a menu item.
8: I think that’s a known bug in the latest release and will be fixed in the next one.
Sound effect speed is a multiple of approximately 1/120th of a second per note. For example, a speed of 15 is 15/120 seconds per note, or 8 notes per second. If you write music with a beat every 4 notes, then it's 2 beats per second or 120 bpm.
Thanks dddaaannn for the sound info! (Also I now realized I could sequence some dummy music, export to WAV, and correlate the length/speed in the tracker to the exported WAV length...)
merwork, thanks for info about every bullet point!
-
For my first game, I did tweak the HTML skin and use JavaScript GPIO bytes, so I may just share the itch link.
-
Yeah it's harmless. But coming to PICO-8 with fresh eyes, it seemed silly that it always displays Player 2 controls regardless of the game!
-
You're right! I confirmed I can export a .p8.png by commandline. I assumed it wouldn't work since that's internally a SAVE command, not an EXPORT command.
-
Right, I created a template.html with OpenGraph metadata, color tweaks, GPIO calls, and when I EXPORT to HTML, I copy that template over.
-
I knew about some Stat() vars, but not all those! Clipboard contents, time of day... cool!
-
I know OX vs XO is a bit of a culture thing, in fact Sony just swapped them:
https://www.eurogamer.net/articles/2020-10-05-in-a-historic-move-playstation-5-swaps-x-and-circle-button-use-in-japan - OK about the menu bug. I could post a cartridge to demonstrate, if needed.
Thanks!
Oh! Something I noticed recently re: the whole "is O confirm or X" question: if you use the experimental devkit inputs, one of the flags you can set is to treat the mouse buttons as controller buttons ... and I believe it assigns the left mouse button to X.
It's a very weak implication of which button serves which purpose, but it is an implication.
SPLORE and the pause menu both treat both buttons as confirm, I hasten to note.
I'm experimenting with PICO-8 headless exports again, and I've run into a new problem. Can P8 not export wavs via headless/commandline? eg. EXPORT SND.WAV or EXPORT MUSIC.WAV which work within the virtual terminal.
I'm on Windows and if run something like: pico.exe myGame.p8 -export name.wav
then it runs - but crashes! - pico8.exe
I assumed I could pass a valid param like "-export snd%d.wav" to generate the 64 sound files.
The crash makes it unclear whether wav export is allowed but buggy, or is not allowed (but still shouldn't hard crash!)
I wonder if it's because the WAV exporter when you run it in PICO-8 relies on awareness of whether you're on the SFX or music tool to know what you mean to export and there's no command line switch (that I recall) to indicate which one you mean if you're running the export from the OS environment.
If it's of any use for debugging (does actually seem like a bug, so you might want to open a Bug thread for it), here's what the Linux command line gives me when I try the same thing:
EXPORT: sound.wav sfx 0 :: ticks 512 zsh: floating point exception (core dumped) ~/pico-8/pico8 ~/gamedev/pico8/musiccrap.p8 -export sound.wav |
It’s not 100% clear if headless export should work from the command line, but if it does, I think the format would be:
pico-8 -export "snd%d.wav" |
(not sure if -x
is needed too)
Ref https://www.lexaloffle.com/dl/docs/pico-8_manual.html#Running_EXPORT_from_the_host_operating_system
@merwok On Linux, it core dumps for me with or without the quotes, the %d in the export path, or a -x flag in any combination.
[Please log in to post a comment]