+1 vote

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.

in Engine by (327 points)

1 Answer

+1 vote

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.

by (1,634 points)

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.

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.