Lag, bad development or maybe a bad computer?
Today I packaged my multiplayer test game (something like a pong) and then I tried it in two instances in my laptop. All goes perfect, fluently and without lag.
When I have tried on another computer in my home and in my laptop, I see that exists a lot of lag. The things I noticed:
-In the other computer, not a very good computer, the games ran slower than in my laptop (I mean, the ball goes slower, the player moves slower and in my laptop all goes at the right velocity)
-The server side goes perfect (if not take into account the previous problem) but the client has a terrible lag (for example the ball moves quickly beetwen two positions (the next and the new one) or my player moves similar as the ball)
Do you think that maybe is a lag problem? Or perhaps if the other computer is worse than the laptop is normal this behaviour? Can be a code problem, for example too mucha variable or actor replicatons o inaccurate methods? (I dont think that can be that because only exist about 4 or 5 replicated variables (to the position, velocity etc...) and 3 replicated actor (the two players and the ball).
If anyone knows something or have an idea, I will be very pleased to hear it.
Thanks for your time!
EDIT: Oh, and all of this problems are on LAN.
Most likely it is because you are not using a component that takes care of network prediction and interpolation like the CharacterMovementComponent does. Without that you need to handle what happens instantly client-side when the client apply input (prediction) and what the other client see while waiting for the next signal (Interpolation) for it to appear instant and smooth.
answered Apr 21 '18 at 11:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here