Log In  

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...

  1. 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.

  2. 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.

  3. 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?

  4. 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 )

  5. 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)

  6. 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.

  7. Conventions: The "O" and "X" buttons... is the "O" conventionally Action/Confirm and the "X" is Secondary/Cancel? Like a Game Boy layout?

  8. 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!

P#95372 2021-07-28 03:49

> 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

P#95375 2021-07-28 04:28
1

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.

P#95391 2021-07-28 16:14
2

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.

P#95415 2021-07-29 06:18

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!

  1. For my first game, I did tweak the HTML skin and use JavaScript GPIO bytes, so I may just share the itch link.

  2. 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!

  3. 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.

  4. Right, I created a template.html with OpenGraph metadata, color tweaks, GPIO calls, and when I EXPORT to HTML, I copy that template over.

  5. I knew about some Stat() vars, but not all those! Clipboard contents, time of day... cool!

  6. 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

  7. OK about the menu bug. I could post a cartridge to demonstrate, if needed.

Thanks!

P#95478 2021-07-30 03:04
1

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.

P#95536 2021-08-01 01:35

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!)

P#120143 2022-11-05 03:45

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
P#120150 2022-11-05 12:57

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

P#120153 2022-11-05 15:53

@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.

P#120154 2022-11-05 16:13

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 10:24:38 | 0.032s | Q:24