O'Reilly logo

Unity Multiplayer Games by Alan Stagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Server-side Hit Detection

There are many multiplayer games which involve shooting at their core, and there will be plenty more to come. These games all need some way to keep in sync who's shooting at who, and who gets hurt and dies. There are a number of ways to solve this problem.

The most obvious solution is simply to have player clients send a damage message. If the player hits someone, send a damage message to the server. The server deals damage to the appropriate player. There is a huge, glaring flaw in this design: players can, and will, cheat the game. It's truly staggering how many client-side hacking programs there are available—programs that send messages to the server, programs that directly modify variables on the client, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required