question

sammy89 avatar image
sammy89 asked

How to stop cheaters

I am developing a simple 2d game and I want to stop cheaters from faking their high score. The way I understand it, correct me if I'm wrong, the best way to go about it is to track each players game to see if they survived long enough to achieve their (claimed) score.

Can I do this with playfab?

If yes, how do I go about it? (I would appreciate if you could give a detailed answer)

I would also like to contact the player with the highest score. I assume the best way is with push notifications. Is that possible with playfab?

Player DataPush Notificationsgame manager
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Made Wang avatar image
Made Wang answered

[Edited]Regarding tracking the total play time of the player, we do not recommend doing this, you can try to track the time of each game. You should send the current time at the beginning and end to Server-side store it in PLAYER READ ONLY DATA or PLAYER INTERNAL DATA, and when the player sends the score, the server or Azure Function will check whether the time matches the score. At the same time, you can store the data of each game of the player in PLAYER READ ONLY DATA or PLAYER INTERNAL DATA for you to view.

If you are using statistics to store scores, it is strongly recommended that you do not turn on Allow client to post player statistics (off by default) to ensure that only the server and Azure Function can modify the statistics. You can check if player has enough game time, if the score is in range (if set), and you can set up multiple checkpoints to check in segments to ensure player doesn't get lots of scores at once.

Regarding push notifications, if you use statistics to store scores, and the highest score is the highest score among all players, then you can set the prize table to push notifications when the leaderboard resets. The premise is that push notifications have been configured, refer to Push Notifications quickstart - PlayFab | Microsoft Docs. Of course, you can also push notifications manually, also refer to the quick start above.

If your players have set email addresses, it is more convenient to use email to send message. You can use GetPlayerProfile or GetUserAccountInfo to get the player's email.

Note: If you can identify a player as a cheater, you can ban the user in Game Manager or using BanUsers.

To be added is:

Good cheat prevention logic is complex and will be title specific. There are a huge number of possible things the developer could check. In the most robust systems, the title would submit the set of data about all the actions the player took during the game session, so that the cheat detection logic could walk through it and validate all the steps. In that model, the title would also emit an event with a hash signature for that dataset, so that the developer could check for duplicates – which could indicate someone cheating by simply recording (or artificially generating) a session and replaying it. But also, cheat protection should evolve over time, as any popular game will see cheaters adapting to the things that prevent them from posting scores.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sammy89 avatar image sammy89 commented ·

wow, thanks for that. Sounds like what I am looking for. Roughly how much would it cost to have such a system running, lets say per 100k players? I know you have a pricing page but can you give me a rough estimate?

Also, would it be a big job to set up? I'm quite new to this, is it difficult?

0 Likes 0 ·
Made Wang avatar image Made Wang sammy89 commented ·

Regarding the price, the above methods are mainly for reading and writing data. If you are in the free mode, please refer to Development Mode - PlayFab | Microsoft Docs to understand your usage limit. If you are already on a paid plan and the title is in live mode, refer to Pricing (playfab.com) to understand the price of planned and unplanned usage. Then refer to Pricing Meters - PlayFab | Microsoft Docs to learn about metering. The specific cost is related to your number of users, the frequency of reading and writing, and the data size of each read and write. You can use this calculation tool to estimate your cost.

In addition, configuring PlayFab's projects is simple, but the specific difficulty depends on your specific needs. And welcome to post a separate thread for each technical problem, so that we can deal with it better.

0 Likes 0 ·
sammy89 avatar image sammy89 Made Wang commented ·

Just noticed that you said in your original answer "we do not recommend doing this". Why not?

0 Likes 0 ·
Show more comments
sammy89 avatar image
sammy89 answered

@Made Wang It doesn't let me reply in the comments so i'm writing it here: Can I achieve my goal with plain old analytics? meaning i can manually check the analytics data to see if the player survived long enough to achieve the score they are claiming. I know that sounds time consuming but I am only intereseted in the top score, so I would start at the top and work down until I get to a legit score (and meanwhile ban the cheaters)

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Made Wang avatar image Made Wang commented ·

Are you talking about Insights provided by PlayFab? If so, it should be noted that the insights provide the analysis for PlayStream Events, so you can call WritePlayerEvent to output the data you record as PlayStream events, you can refer to Generating PlayStream events - PlayFab | Microsoft Docs, Data Explorer - PlayFab | Microsoft Docs to generate custom events and analyze them in the Data Explorer and you can also save them to third-party analysis tools for your processing.

0 Likes 0 ·
sammy89 avatar image sammy89 Made Wang commented ·

So which method would you advise is best?

0 Likes 0 ·
Made Wang avatar image Made Wang sammy89 commented ·

It depends on the features you need, the amount of data to analyze and whether it fits your budget. You can try to use the Data Explorer to query the data, refer to Data Explorer quickstart - PlayFab | Microsoft Docs. But by default the data can only be kept for 30 days, you can refer to Performance and retention - PlayFab | Microsoft Docs to understand the limitations of different performance levels, and refer to Insights Pricing - PlayFab | Microsoft Docs to understand its pricing. You can also connect Insights to other analysis tools, refer to Connecting external tools with Insights - PlayFab | Microsoft Docs.

Also, if you have a new issue, you can start a new thread for it so we can handle it better.

0 Likes 0 ·
Show more comments
Made Wang avatar image
Made Wang answered

I think performance level 1 will meet what you need, and it's free. You can use WritePlayerEvent to output the time and score of each game as PlayStream, and then filter out the data you want in the Data Explorer, refer to Getting started with Data Explorer basic mode - PlayFab | Microsoft Docs.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sammy89 avatar image sammy89 commented ·

i can't work out how to writeplayerevent. is there any type of tutorial other than the docs? The ones I have found online all have a playstream option in the left colum but I don't have that.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.