jumpy icon indicating copy to clipboard operation
jumpy copied to clipboard

Player profiles and match logs

Open erlend-sh opened this issue 4 years ago • 5 comments

Use case: After playing with a friend over the course of a month, you’d like to know what your total score is for the entire month.

Who actually won the most matches? Who took the most bo3 series? Which maps do we have the highest/lowest win percentage on?

Requirements:

  • Players are able to create profiles for themselves in game
  • Game data is stored for those profiles
  • Profile data can be viewed in game UI

Longterm this would also be integrated with Nakama or a similar multiplayer cloud. You should be able to log into your cloud profile by simply entering a short pin code, which gives you read-access to your profile and its item stash.

erlend-sh avatar Jul 29 '21 14:07 erlend-sh

Just a couple random implementation thoughts:

  • Nakama unfortunately doesn't scale for the community edition, which means that despite their great feature offering, we may want to find an alternative option.
  • Directus might be a good data backend for the multiplayer account cloud. It has a GraphQL API, which makes it very easy for other applications/languages to integrate with the API, and data modeling is very easy to do.
    • A dedicated Rust server might still be desirable: It'd take more development to produce the API, but it would avoid bringing another tech stack into the mix.
    • This needs lots of consideration, too, and includes things like how we want to do authentication.
  • Since we're using a simple p2p matchmaking protocol, for matches, it doesn't really have to be integrated with the cloud database, but we would need to consider the way that authoritative score is kept. This may involve running a spectator of the match on our servers, which could dramatically increase our server load. This just needs some consideration and weighing of the value to cost.
    • We might be able to avoid the cost by having the score only update if all participants agree on the outcome. That allows nasty players to avoid recording a loss if they hack the game, but we might be able to mitigate that by blocking players who contest too many matches or something.

zicklag avatar Nov 22 '22 21:11 zicklag

Hmm, the first service that comes to mind for me is https://supabase.com/

They are already quite game-oriented (see realtime) and full-service, including a free plan to start with.

Also some clear plans for GraphQL: https://github.com/supabase/pg_graphql

erlend-sh avatar Nov 22 '22 21:11 erlend-sh

Ah, yeah, that looks like a great option, too. Directus did have a realtime plugin, but not at all as mature as supabase as far as I can tell.

I'll have to try that out sometime and also do some more looking around.

zicklag avatar Nov 22 '22 21:11 zicklag

In discussion on Discord it sounds like we are pretty interesting in evaluating Rivet, hopefully provided by their hosting service. Rivet is open source and is a tool for matchmaking + server infra - for this issue their associated project Open Game Backend for user management and auth seems relevant.

Familiarizing with these APIs and looking into how we might use them if we move forward with evaluating this would be good first step, followed by how we can display relevant information in game about players, their profiles, and previous match outcomes.

Rivet does not (yet) have a rust API - but we can use their REST api and send http requests with some http client such as Reqwest.

MaxCWhitehead avatar Mar 23 '24 21:03 MaxCWhitehead

RE HTTP client: An increasingly popular small HTTP client is ureq. Might be handy to keep in mind.

zicklag avatar Mar 23 '24 21:03 zicklag