How to collect "Best Lap" values from all devices, compare them, then update the "Record" value back to all devices?

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

Each player stores the local “Best Lap” value, but then I want to compare each of it to the “Record” value and update “Record” value in all of the devices if one of the individual “Best Lap” values < “Record” value.

Example:

Player A:
Best Lap: 1:28.548
Record: 1:26.784

Player B:
Best Lap: 1:25.487
Record: 1:26.784

As Player B beats the Record time of all, “Record” must be updated in all devices to be “1:25.487”.

What is the way of collecting “Best Lap” values from all devices, compare them to “Record” value and share it back to devices if it was updated?

Thank you for your time!

To make things easier, instead of collecting values from all devices, I’d rather be interested in comparing Best Lap value to Record value locally in each device, and if Best Lap < Record then update Record value in all devices.

Q: How to update a value in all devices?

Suleymanov | 2020-12-28 11:24

:bust_in_silhouette: Reply From: 1shevelov

The only way to solve this problem is to have a central storage for user data. So you need a server…
There are many ways to have a server with Godot game. One of the easiest player’s data storage solution is https://silentwolf.com/ - it’s a free server & data hosting.
More advanced server is Nakama, but you’ll need a VPS to host it somewhere. You can create server with Godot AFAIK, but you’ll also will need a VPS.