0 votes

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!

Godot version 3.2.3
in Engine by (307 points)

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?

1 Answer

0 votes

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.

by (126 points)
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 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.