Custom Leaderboard

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Suleymanov

I decided to make a custom leaderboard for my racing game. Locally things look nice, no trace of problem. Now I need to know the easiest way of sending data to a server computer and getting data back from the server computer.

I have “track”, “name”, “best_lap” data saved separately per level in user directory. I need to send these data to the server computer and collect them in order (Under each track name/level, the name of the player and his/her best lap time - in ascending order).

I need top 10 best lap performers + 1 personal ranking (11 lines in total). No weekly, no daily, only all time best.

I have no prior experience working with server computers and interaction between them and devices, but it shouldn’t be that hard, is it?

A rookie question now - Do I need to keep my server computer on all the time, or is it possible to download/upload data from a web domain?

Any help appreciated.

:bust_in_silhouette: Reply From: sash-rc

Web domain, whatever it means is also a server, and you need it to be active 24/7 in any case.
Simple download/upload will not work, as a most recent uploader (not best one) will overwrite your data, so you’ll need a server-side logic (of storing best results when submitted).

Probably you don’t need a full-blown server, some http api hosting like AWS API Gateway will suffice.

Thank you for the reply!

I successfully store data of Circuit number, Lap time and Player name in local user directory:

data {
"Circuit" : #numeric value
"Lap Time" : #numeric value
"Player" : #string
}

The idea is to collect the data from each device into the server (or whatever it is called), compare them, sort them based on Circuit number, Player name and Lap results, then send them back to the devices the top 10 results (in an ascending order) + 1 personal ranking.

I can sort it out the comparing part, all I need to know is how to send data to the “central computer” and get data back when needed. I need to understand basics, the easiest Method possible.

Suleymanov | 2021-07-18 09:30

You should familiarize yourself with HTTP REST API server concept and implementations (not necessarily Godot). As for a client part (Godot) there’s a ‘HTTPRequest’.

Comparing part should be implemented on a server side: client sends its best result, but it’s up to server to decide who’s actually best.

sash-rc | 2021-07-18 11:23