Sign In Register

How can we help you today?

Start a new topic
Answered

Unity - Calculating Game-Score on the server

 Hi,


So I know gamesparks does not support real-time updates, I can however make multiple calls through out. So I will post my issue and maybe someone can shine-in and help me find a solution with what gamesparks can in fact do. (Cloud code etc).


We will focus on something simple such as GameScore which is calculated based on Distance/Time now I can simply record the starting player position on gamesparks/cloud-code but then the hacker can simply set the final position or the time. How do I go about recording player-position/ time in a realistic manner in this scenario?


Coming from UE4 we would simply calculate everything on the server, and call an RPC to get the final score etc, but from what I understand GameSparks can't actually host the game (hence we cant use basic UNITY Networking). Mind you this is a client game, but the scores are hosted on leaderboards when they log into facebook/gamesparks. The score is unique to each user (by retrieving data from gamesparks), else it will use player-prefs.


So what are my options here? even if I make multiple calls, the user can simply change the position at any time.

1. I can make a max traveled distance per second on cloud code, and do a final calculation at the end. But there are speed-boosts and blink-portals in the game so it can lead to miscalculations.


thoughts?


Thank you,


Best Answer
All data transmission is SSL secured. I wouldn't worry about the data being intercepted before you send it, most hackers will try to intercept the transmission from the server rather than when it is being sent.

I believe Steam and other platforms check this kind of interpolation on the client-side and just set an upper limit for how far a player a player can go at a time, and how fast they can go. Once the update is done they can check if there is anything fishy and then they know if someone has cheated.
If we are really talking about cheaters here (i.e. you arent worried about personal information being messed with), then i would recommend that your update also pushes the current player position in the same event-request you want to get the expected position from. This will allow you to check how far off the current position is from the expected position and therefore figure out if someone has been messing.

But really, you should do this will a real-time server otherwise you will get choppy movement. Even with a real-time server though, you should use some kind of interpolation, so you can figure it out now and be ready when the GameSparks real-time features are available.

-Sean

 


Hey Lawrence,

We are in the middle of unveiling real-time features (we are just preparing documentation and tutorials) so you might have a solution to this soon. In the meantime im a little confused as to how your game uses the speed and distance?
If you are using it to update positions, i.e like in a modern shooter, i would not suggest using GameSparks for this, but if  you just wan to submit distance and time for scores, you could use a leaderboard setup at the start of the game, and then just retrieve player ranks at the end.

Maybe you can explain the process for sending/receiving data for your game, and i'll see if i can help.

-Sean

 

Lets keep it simple and say I simply need an ending player position over the server. I know Start/End time can be calculated on the server with Cloud-Code, but how do I go about making this request and ensuring that a player can't simply hack the end position right before I update cloud code? if possible at all. (Start position will simply be 0, which is easy enough on cloud code).

That is why I was thinking of maybe limiting the amount a position can change in X period of time, but I think the new Real-Time feature might be what I need.

- Lawrence

 

Answer
All data transmission is SSL secured. I wouldn't worry about the data being intercepted before you send it, most hackers will try to intercept the transmission from the server rather than when it is being sent.

I believe Steam and other platforms check this kind of interpolation on the client-side and just set an upper limit for how far a player a player can go at a time, and how fast they can go. Once the update is done they can check if there is anything fishy and then they know if someone has cheated.
If we are really talking about cheaters here (i.e. you arent worried about personal information being messed with), then i would recommend that your update also pushes the current player position in the same event-request you want to get the expected position from. This will allow you to check how far off the current position is from the expected position and therefore figure out if someone has been messing.

But really, you should do this will a real-time server otherwise you will get choppy movement. Even with a real-time server though, you should use some kind of interpolation, so you can figure it out now and be ready when the GameSparks real-time features are available.

-Sean

 

Since its not a multiplayer game, I don't actually care so much about updating player position, as I am with the score (that's going on the leaderboard). For now I will do a client side and a cloud side calculations, on update I will check if the player is within a certain range of cloud code, if so then proceed as normal, else don't update to the leaderboard.

If that does not work for me, then I will check back for the real-time feature and see if that solves any discrepancies.

Thank you,

 

Login to post a comment