#How to avoid delay?

1 messages · Page 1 of 1 (latest)

final gorge
#

You can think of this game as a top view shooter game.
When the client shoots while moving, it hits the target on its own screen, but due to the delay, I see it as this was not hit on the server side and missed the target from the left or right.
How can I achieve client and server compatibility?

#

As you can see in Gif, the left side is the server side and the right side is the client side.

#

How to avoid delay?

frozen pond
#

It might be the interpolation. The server side enemy does not appear to be moving as much as on the client side. The shooting for example does not seem to be delayed at all

final gorge
#

Do you have any idea how to solve this problem?

frozen pond
#

I assume you are using NGO? And I guess a Client Network Transform? There are interpolation setting you can change or turn off. If you post your code we can have a better look

final gorge
#

Yes I am using NGO. When the player's Client Network Transform Interpolate is turned off, the movements are distorted. For example, when the client or server wants to go forward, it teleports forward and when it stops, it returns to its old position. Movements and turns are harder.

#

As you can see in this gif, the Interpolate setting in the player is turned off.

#

Player prefab

#

I do the character movement locally.

#

Script where the character looks at the mouse.

#

This also happens locally.

#

Is there anything else you want to review?

frozen pond
#

What version of NGO are you using? It will definitely be a little jerky with interpolation turned off but it shouldn't be doing all that especially on the same machine. Something else is going on. Also are you using the newest client network transform? Some changes were made to it in the last few updates

final gorge
#

I am using version 1.1.0 of NGO. And yes I am using Client Transform which I recently downloaded from the official GitHub repository.

frozen pond
#

Hrm, nothing in those scripts would be causing an issue. Can you test movement in an empty scene with just like capsule players?

final gorge
#

I did the tests. There is still the same problem. If you want to examine in detail, you can look at the project with the AnyDesk application.

final gorge
#

Hey

frozen pond
#

I can't really look into another project at the moment. I can only suggest to strip down everything until you just have input and movement. The character controller might be getting in the way. And I'm not sure what your serverRPC class is doing there