- Home /
Multiplayer reaction time game with no delay?
Hello guys.
The game logic here is simple. There are two players playing against each other. Whoever presses before the other wins. Aim: Plays winning/losing animations immediately when player input is detected from either end.
However, I am not sure if this idea is going to work when it comes to networking.
Method 1: One solution that I can think of is that, both players send their time to the server and their times will be compared, then the server will generate the result to both players. This causes some delay between player input and results.
Method 2: It won't work when I want to play animation immediately after the player has pressed. The reaction time from each player might only differs in 0.001 seconds, but the message might take longer time to travel over the network. Say Player1 pressed at 0.200s and Player2 pressed at 0.210s, so Player1 wins and it will play the winning animation. But for Player2, it still has no idea that he has lost the game when he pressed at 0.210s, he may still play the winning animation too at his end.
I need some advice on this. What is the best way to achieve this?
Thank you.
It's not an easy thing. Here is an excellent start place:
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
'NetworkTranformChild' problem 1 Answer
Network.isServer / isClient not working 1 Answer
[UNET] NetworkTransform - Synch Rotation - none - error 0 Answers