Log In  

I wonder, once the highscores feature comes into play, will it be possible to do some extremely limited networking using it? Say for example, instead of using the highscore number as a highscore number, but instead as data. I imagine it wouldn't allow for any real-time networking, but I think it's worth keeping in mind that the highscore number could be used for other things than scores. Maybe showing what decisions other players took, like a Telltale game. Or gravestones of players who have passed away and where.

P#39997 2017-04-28 15:34 ( Edited 2018-09-22 18:33)

I could see using it for asynchronous play such as Animal Crossing, where each player's "high score" is just a seed/data for their little village. So you can go visit other people's villages for different items than you might have in your own personal seed.

P#40102 2017-05-01 10:44 ( Edited 2017-05-01 14:44)

Maybe you could use it as some sort of achievements service, too

P#40115 2017-05-01 21:19 ( Edited 2017-05-02 01:19)
:: bekey

Great ideas!

The quality of those depends greatly whether or not a user only has one slot in the highscores or not.

I guess we'll see when the time comes.

P#40124 2017-05-02 10:27 ( Edited 2017-05-02 14:27)

A keyboard API would be great too, so people can search for other player's scores

P#40125 2017-05-02 11:21 ( Edited 2017-05-02 15:21)
:: zep

The current score api looks like this (but might change before it is released during 0.2.?):

scoresub(cart_id, table[, score[, extra]])

cart_idis a string identifying the cart, so that score tables can optionally be kept between versions and also while testing during development. A hash of the cart's content is also stored with each entry to help detect cheating or carts clobbering each other's tables.

table indexes the high score table -- often a level number, but could be some combination of bits set whenever a separate table should be used: game mode, difficultly level or character selection etc.

score Higher is taken to be better, so for racing or golf game where smaller is better, -score, or 0x7fff-score could be stored instead.

extra is also a number that can mean anything the programmer wants, to provide some context to the score. level reached, items collected, or bits set for achievements.

scoresub() returns the top 50 scores, including the username for each entry (the user must be logged in to post a score) and the value of extra. Scores can be fetched without submitting anything by dropping the 3rd and 4th parameters.

It is my hope that this api can be potentially abused in interesting ways :) A simple example would be playing a turn-based game like chess -- the cart_id could be set to something like "zep_vs_bekey_0", with score and extra encoding the last move (with previous / current game state cstore'd locally on each machine).

It's tempting to formalize all of this as something more general: Being able to fetch score by user name or list offset (for more than 50 scores) starts to look like running queries against a per-cart DB table, for which high scores is just a particular case. I still have to weigh this against things like server requirements & potential effect on cart design, but I am very fond of the idea of allowing for reasonably complex door game interactions between users.

P#40131 2017-05-02 15:03 ( Edited 2017-05-02 19:24)
:: Godzil

Silly question; but are the highscore stored online? If yes how are you going to prevent "cart_id" clashes?

P#40132 2017-05-02 15:18 ( Edited 2017-05-02 19:18)
:: zep

Yes -- these will be stored on the BBS! (and also viewable from within the cart post)

There won't be a way to automatically prevent clashes apart from choosing a good unique label (similar to cartdata()). But there will be a way to resolve intentional or unintentional clashes should they be a problem -- a hash of the cart's content is also stored with each entry, which can could be used to split the data if needed. But I can't imagine it would come to that.

P#40133 2017-05-02 15:28 ( Edited 2017-05-02 19:28)

Anyone who tries to use this as a legitimate high-score system will soon discover that their top fifty players are all so elite that they all scored a perfect MAX_INT.

(And heaven help you if the server can store a value that will crash the client.)

P#40134 2017-05-02 15:33 ( Edited 2017-05-02 19:33)
:: Offler

It would be really cool with a function for asynchronous network requests (with json support):

function callback(response)
 printh(response.status_code)
 printh(response.text)
 d = response.json()
 printh(d)
 printh(d["base"])
 printh(d["rates"]["JPY"])
end

request('http://api.fixer.io/latest?symbols=JPY&base=USD', callback)

Assuming access to the internet, this would be the output:

200
{"base":"USD","date":"2017-05-05","rates":{"JPY":112.48}}
TABLE
USD
112.48

Then people could build their own highscore functionality, network multiplayer features as well as interacting with existing restful webservices. I guess it wouldn't work in the browser, except for services hosted at the same site (one of which could be the high score service at lexaloffle.com).

This is partly inspired by pythons' requests api, which I think is a very clean way of doing http requests, (it is not asynchronous though).

P#40310 2017-05-08 04:43 ( Edited 2017-05-08 10:34)
:: dw817

A DOOR game set of commands would be GREATLY appreciated, ZEP.

It should then be possible to have games where multiple players can send INPUT and OUTPUT, I.E. a simple adventure game where players can choose what color from 1-15 they want to appear on the board as.

for i=1 in all (_players) do
  pset(i._dataw[0]+camx,i._dataw[2]+camy,i._datab[3])
end

For instance, just for the output. Maybe allow no more than 16-bytes per Online player. If referred to from _dataw[] then it is a 16-bit number read or written to. _datab[] would retrieve and set a single byte.

P#56807 2018-09-17 17:54 ( Edited 2018-09-17 21:54)

how would the players find each other and connect?

you could probably create a library that could do this with a simple REST API on a server using the GPIO method I used to save user-generated maps in Wildfire

P#56812 2018-09-17 19:54 ( Edited 2018-09-17 23:54)
:: dw817

I don't know that part, Dollarone.

If it was simple though, I could probably learn it.

Something like:

[b]_total_players ... total number of users playing this cart now

_player_data[] ... 16-bytes of data per player, read only

_user_data[] ... name & password,  cannot be viewed or written to

_system_player_data[] ... additional system data, cannot be viewed or written to

_cart_game_data[] ... identification of this cartridge for multi-player usage
[/b]

Your maps in Wildfire are user generated ? How can I enter my own map in there ?

P#56853 2018-09-18 12:47 ( Edited 2018-09-18 16:49)

At that point, why not use PICO8 as a client to an actual bbs server?

With some clever javascript, you could use the GPIO pins to connect.

P#56864 2018-09-18 17:09 ( Edited 2018-09-18 21:09)

yeah that's what I meant by building a library. I assume the GPIO support wasn't really meant to open PICO-8 up to the internet, though :)

@dw817 - there's a level editor in the game. just make a level and save it, and it'll be available for everyone! more info at https://www.lexaloffle.com/bbs/?tid=31849

P#56926 2018-09-20 08:21 ( Edited 2018-09-20 12:21)
:: dw817

Hi Dollarone:

Wait ... I see it. You have to press the RIGHT arrow key to show more options.

Gonna try this out. Created a simple room.

Okay, this is astounding !!

How are you reading and writing user data files and ... does it require a personal domain server to do this ? Can you run this, say, from SPLORE ?

Did you post source code to this version as I'm not finding ?

P#56932 2018-09-20 11:18 ( Edited 2018-09-20 16:01)

There's been at least one pico8 game that used the GPIO pins to make agar.io style MMO.

https://www.lexaloffle.com/bbs/?tid=30059

Sadly it now appears to be offline.

P#56938 2018-09-20 16:50 ( Edited 2018-09-20 20:50)

@dw817 - the server runs on my VPS, yes, but it's just a simple REST reader, storing the data in a json file.

In order to run it, you need a customised HTML5 wrapper, hence hosting it on my VPS. IF you could customise the wrapper (like itch allows) on the forum, I could add it and thus it would be available from splore.

The source is at https://github.com/dollarone/wildfire

P#56964 2018-09-21 03:45 ( Edited 2018-09-21 07:45)
:: Scathe

There are definitely a lot of ways already to do networking, even real-time! You can hook into the GPIO pins with JavaScript and use WebSockets or AJAX to do networking between players (like Picar (unfortunately now offline)), add an achievement system that integrates with a web application, or even get Twitter tweets!

P#56986 2018-09-21 23:09 ( Edited 2018-09-22 03:09)
:: dw817

I'll be honest. I'm avoiding this because it sounds like I need to know or understand Javascript. Now about 2-years ago I was fighting learning it, making moot progress ... but ultimately decided I didn't like it - and went back to BlitzMAX.

I guess what I'm hoping for is the PICO OS itself to present options for multi-user play without requiring the intervention of Javascript and/or requirement to upload to a server that is required for such activity.

I'm pretty sure it could be done solely in PICO (as programs written in it really are just advanced Javascript), and NEO, no, ZEP, could be the first person to claim to have written a programming language that simplifies the use and engagement of multi-player incoming and outgoing Online data.

P#56998 2018-09-22 14:33 ( Edited 2018-09-22 18:33)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2019-12-08 10:42 | 0.031s | 4194k | Q:49