Prevent Cheating in a Photon Networked Unity Game

Hey everyone. I know one of the best ways to prevent cheating in a multiplayer game is to have an authoritative server. Does anyone know how to go about doing this with Photon?

Also, if I were to have a non-authoritative server, is there a way I could have players “check” each other through RPCs every once in awhile during the game to see if someone’s HP or speed is way too high? Then if the majority of players agree that one player’s stat isn’t feasible, that player is disconnected from the session.

Thanks, any insight or sample code would help!

With PUN you cannot make it 100% cheat proof.

However you already suggest some methods that will help, like letting players check each other. Also let the master client handle most stuff. That way “only one” player can cheat.

For example if the master client handles player collision with bullets and sets health accordingly. Then everyone else can alter their health but i won’t matter because its the health the master client “sees” that matters in the end.

Somedays: You could use the Photon Server SDK and customize the server to run your own logic and check parts or even everything.

This is usually quite some effort and we propose to go the easy route first.
I am not aware if there is some middleware that implements server-side cheat protection for most types of games. For shooters, there might be something but any most other genres will be difficult to check in a generic way.

The next step after making players check each other would be to have some login or account, so you can effectively pause user accounts or even ban them. This can be done with a simple to implement web service in Photon.

It’s a bit up to your requirements and the game, if it makes sense to be authoritative or not.
In doubt you can mail us a brief summary about your game and we can try to guide you.
Mail to: developer@exitgames.com

Sorry to necro this thread. But the concept of having players check one another intrigues me.
Say you have 2 players in a 1v1 game. 1 decides to cheat and modifies their movespeed, the other player detects this mismatch and sets their position back to where it should be if they were a normal speed. Now you have a desync between where the cheater thinks they are, and where the other player sees them. This doesn’t solve the issue because the cheater can still go wherever they want on their screen and potentially deal damage from the sky etc.

Would it be a completely horrible idea to have a dedicated “authoritator” client which automatically connects to every room and authenticates the players positions and attacks? It would essentially be a generated dummy player that does not appear in the game at all, it simply acts like an authoritative server.
I’m not exactly sure how you would get this “authoritator” to connect to each room, but it could be something worth considering?

I might have a play around with this and report my findings.

Well, yes, on paper your idea makes sense but it means you are running a lot of clients to check any game there is and this is expensive.

And yes, the “every clients checks everyone else” idea is not helping immediately against cheating. It’s working in a statistical way, where a lot of cheating-reports for any user will lead to a ban. This means, a cheater can of course ruin several games before the block gets in place. It’s just the cheapest way to do it.
Photon is always using a server as “advanced relay” (for various reasons). Those are usually ignoring the game but if you needed to, you can now build game logic into the server and check for cheating right there. This would be a middle-ground, where you’re not running the full game (headless on a server) but check some updates for cheats and you could internally detect and report those.