Log In  


Hello
Just curious, are there any plans to integrate functionality for handling sockets to pico8? I can't seem to find anything on it so I'm assuming there is no support at this moment anyway.



I do not expect support for sockets in PICO-8 directly. However, you can already realize socket communication via GPIO. I recently used this to create the online multi-player game Martian Dice. In my write-up at itch.io you can find some more details. For full details see the source code on GitHub.


Thats very cool eriban, although that might be to overkill for most people from a "gaming" perspective.

Hm, haven't really looked at how the source is built for html exports. I noticed the registration form had a captcha made with pico8 (also pretty cool imo) so I'm assuming there are ways to allow for some kind of communication when running the export on a web server- or may be it only allows for reading data?
If you or anyone else has any references on this, I'd love to have a look at it.


Look for GPIO in the official manual. On raspberry pi, it’s a memory area used to interact with the pins and sensors or actuators connected to them. In HTML exports, that memory area is mapped to a javascript array and you can use that to communicate data between js and the cart. (There are some libs around to make that easier, but rolling your own works too.)

For pico-8 1.0, we will get a few functions to save and retrieve online scores. 'login(...)' may prompt the player to accept connecting to the bbs, then 'scoresub(level, score)' will save score for current game and current player, and another function will let us get the scores. It should be possible to use that data storage to implement some turn-by-turn games.


Thank you merwork!



[Please log in to post a comment]