aduros / wasm4

Build retro games using WebAssembly for a fantasy console.
https://wasm4.org
ISC License
1.1k stars 162 forks source link

API for global leaderboard #102

Open MaxGraey opened 2 years ago

MaxGraey commented 2 years ago

It would be great to have the ability to save scores in the global leaderboard, which would be available for all cartridges. Such a table could then be accessed either from the game itself or/and as a link on the cartridge web page. You could even add GitHub account registration as an option.

wdyt?

aduros commented 2 years ago

It sounds interesting, is there an existing backend service that we could leverage for this?

MaxGraey commented 2 years ago

I'm honestly not familiar with free online storages. Here's a list of the ones I've heard of

1) firebase (firestore) https://firebase.google.com/docs/firestore/quotas

2) heroku https://www.heroku.com/free

3) back4app https://www.back4app.com/parse-pricing

peterhellberg commented 2 years ago

This would require all runtimes to have access to a network connection, maybe something that is not desirable? (Let's say this becomes wildly popular and a hardware device is produced which is able to run WASM-4 carts)

Limvot commented 2 years ago

If it was setup as just a leaderboards API, you could have different sections with progressive fallback from global (internet connected) to just local high score, depending on the runtime. On the other hand, given the open nature of these games and runtime, I'm not sure if there would be any way to prevent rampant cheating / faking of leaderboard scores :/

aduros commented 2 years ago

@peterhellberg @Limvot These are good points.

Speaking for me personally, I'm most interested in working on the "retro-computer" side of WASM-4 :nerd_face: I'm not opposed to going in a direction that adds social features, but someone motivated to work on that would need to drive it, since it would be a non-trivial amount of work.

I would suggest maybe waiting until we have more games that would use such features.

JerwuQu commented 2 years ago

Since RetroAchievements now supports WASM-4, maybe that should be the go-to for this, rather than WASM-4 itself supporting it?