Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
How to make sure that I get the same result in a multiplayer game if the server is not authoritative?

I am making a simple 2 player browser game, where there's a rotating entity which jumps from one square to another on mouse click. Server is on NodeJS.

To determine which square to jump into, I used 2D Ray-casting shown here

Now my problem is that sometimes, if the line points to the corner of the square, the resulting action into the another client is not the same. (e.g. In player 1's view, he can successfully jump to the next square, while in player 2's view, player 1 is not successful.)

The way I sync both player is that I only send the click action and the current angle of the action owner, then reverse it (since in the other player's view, the enemy is on the opposite side).

At first I thought that it's because of the reversing angle that the result is not the same so I tried rotating the canvas but I still got the same result.

I also tried increasing the line (ray) which detects which square to jump into, but I still got an inaccurate result.

Another attempt is to forcefully update the ray casted on action sync, but I still got an inaccurate result.

Is it possible to achieve the desired result without making the server authoritative? (e.g. recreate the environment and entity rects in the server, and get the result from there, problem here is I don't know how.)

Here's a visual representation of the problem

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda