x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Lag, bad development or maybe a bad computer?

Hello everybody.

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.

Product Version: UE 4.19
Tags:
more ▼

asked Apr 21 '18 at 05:40 PM in Packaging & Deployment

avatar image

Bahamut1892
27 3 5 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Apr 21 '18 at 11:14 PM

avatar image

GarnerP57
931 3 4 8

avatar image Bahamut1892 Apr 21 '18 at 11:20 PM

So, do you recommend me to change the type of movement to CharacterMovementComponent to avoid thats problem? Although the blueprints are pawn or actors instead of characters?

avatar image GarnerP57 Apr 21 '18 at 11:28 PM

Yes if you want to take advantage of all the code included in the CharacterMovementComponent then it has to be a character. ProjectileMovement works okay too but it doesn't have any prediction as far as I remember so it will have a bit of input-lag. Enabling physics is another workaround but it not very reliable and not intended to be used on networked gameplay elements.

avatar image Bahamut1892 Apr 21 '18 at 11:30 PM

In that case, the I will add a CharacterMovement to the players pawn and to the ball I will try to change it to a character to an put it another charactermovemet.

avatar image mightyenigma Apr 25 '18 at 11:38 PM

I would take this approach if my pawn was shaped like a character, but it's not, so using capsule component of the Character pawns causes problems for me. Is there a way to get Character movement without using a Character class?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question