Author Topic: The example is laggy  (Read 3239 times)

bitcrusher

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
The example is laggy
« on: September 27, 2013, 11:28:37 AM »
Hello I built the examples from that were provided and I started a lan example 3.  I then ran two instance of the exe.  The ping starts around 60 then jumps around 600 sometimes.  Also it looks very jittery.  Am I doing something wrong here?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The example is laggy
« Reply #1 on: September 27, 2013, 06:58:02 PM »
On which device, over which network, etc?

Sending data from a 5 Ghz wireless connection to a 2.4 Ghz wireless connection is often very laggy on some routers, for example -- even if devices are connected to the same exact router (just via different wireless bands).

bitcrusher

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: The example is laggy
« Reply #2 on: September 27, 2013, 09:56:47 PM »
It is wired connect to home router, comcast is the isp.  I built the example by adding all the scenes into the build menu and set the menu as the first scene.  Most of the time the box moves to the right spot but sometimes they end up a little bit off from one window to another.
Was it because I tested it by running two instance on the same computer?  On your youtube video about the example, it looked perfect and the movement seemed very smooth.  I ran a ping to google and I got about 10ms. 

I played multiplayer lan games before but I never seen this kind of lag.

Oh the device is a windows pc.
« Last Edit: September 27, 2013, 11:20:46 PM by bitcrusher »

bitcrusher

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: The example is laggy
« Reply #3 on: September 27, 2013, 10:48:10 PM »
Hmm instead of hosting the game via Unity built exe, I ran the standalone server.  The latency is much improved with a max of 80 but averaging 19, however it does sometimes place the cube on the other client at a the wrong place.  Does this have anything to do with unity 3d physics because when I twirl the box around and release/flick the cube, the other client's cube does not land on the same spot.  But if I were to set the cube down with minimal fuzz it seems to much better accurately place it.
« Last Edit: September 27, 2013, 10:56:50 PM by bitcrusher »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The example is laggy
« Reply #4 on: September 29, 2013, 09:14:47 PM »
No, that example doesn't use physics to move the boxes. The box positions are updated via frequent UDP packets, and set via TCP when you press/release on a cube. Which version of TNet are you using, and are there any further details you can provide? Did you mark "run in background" and all that?

bitcrusher

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: The example is laggy
« Reply #5 on: September 29, 2013, 09:29:50 PM »
Version 1.8.2
Marked as run in background, have both windows in windowed mode.

Not sure what else to provide, can you give me your build of the example or show a short video of what it normally looks like.  Is this behavior normal?  Do I need to increase packet frequency for pos?
« Last Edit: September 29, 2013, 10:00:17 PM by bitcrusher »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The example is laggy
« Reply #6 on: September 29, 2013, 09:34:23 PM »
I have a feeling something is wrong with your router's UDP support. My suggestion -- run the TNServer executable with only the TCP port specified and see how that behaves for you.

bitcrusher

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: The example is laggy
« Reply #7 on: September 29, 2013, 09:58:19 PM »
TCP works great, I will figure out what is wrong with my router, and try hosting the server somewhere else as I prefer to use udp. Thanks ArenMook.