Author Topic: OSx and Win7 difference  (Read 6324 times)

KJIB

  • Guest
OSx and Win7 difference
« on: February 28, 2013, 08:21:10 AM »
I have a simple test where I have a large static scene and I'm simply passing the camera position & orientation to the clients from the server, if the server camera moves. The clients simply move their relative camera when they are told about a change.

Using a PC as the server and a Mac as a client I get a fab' 8 or 9mS latency which is great.

Any other combination (i.e. PC->PC or Mac{server}->PC ) and I get a rubbish 200+mS latency.

The ping times on the machines (when checked not via Unity / TNet) are showing about 2mS. I have tried disconnecting the machines from our network (so they're just connected via an Ethernet switch) and I've tried changing the switch but the only good result is PC (as server) and Mac as a client. I've tried multiple PCs and they're all the same. I only have a single Mac to try so unable to test Mac->Mac.

Not sure if this is a TNet thing, a Unity thing, a Windows thing etc...

I'm using TNet 1.3.1 and would update to 1.6.1 but it does not seem I can simply "drop in" the new version. However, I am assuming that the differences between 1.3.1 and 1.6.1 are not likely to change this problem.

Mac is running "Mountain Lion" and PCs are Windows 7 (with the Unity build 64 bit stand alone). The window size makes no difference so it's not lack of spare CPU capacity, (in fact the Mac is the slowest of the machines but best as client). The machines are typically running at near 60 FPS but 200mS latency is equivalent to a 5 FPS update.

Any suggestions anyone?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OSx and Win7 difference
« Reply #1 on: February 28, 2013, 01:26:59 PM »
Are you sending frequent packets over TCP? Nat pagle's algorithm will cause packets to get bunched up using TCP, which will result in a whole lot of them being sent every so often (in groups). Use UDP for such packets instead, or disable nat pagle's (TNManager.noDelay = false).

KJIB

  • Guest
Re: OSx and Win7 difference
« Reply #2 on: March 01, 2013, 05:26:45 AM »
Thank you for the suggestion which I tried (with the parameter set as both true and false to make sure) but I made no difference. I still get:

PC (server) -> Mac ~9mS = great
Mac (server) -> PC 200+mS = bad
PC -> PC 200mS = bad.

In case it is significant we're still using the last version of Unity 3 Pro, (3.5.6f4).

Any further suggestions?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OSx and Win7 difference
« Reply #3 on: March 01, 2013, 09:44:26 AM »
TNManager.noDelay must be set after you've established a connection. Did you try sending via UDP instead? (use SendQuickly instead of Send).

Deozaan

  • Newbie
  • *
  • Thank You
  • -Given: 44
  • -Receive: 4
  • Posts: 42
    • View Profile
    • Deozaan.com
Re: OSx and Win7 difference
« Reply #4 on: March 01, 2013, 11:05:07 AM »
In case it is significant we're still using the last version of Unity 3 Pro, (3.5.6f4).

Just FYI, the last version of Unity 3.x is 3.5.7f6. Unless there's a difference in version numbers between Pro and Free/Indie versions.

KJIB

  • Guest
Re: OSx and Win7 difference
« Reply #5 on: March 04, 2013, 06:00:17 AM »
Just FYI, the last version of Unity 3.x is 3.5.7f6. Unless there's a difference in version numbers between Pro and Free/Indie versions.

Thanks, I'd not spotted that version but I have it now. There were no network related changes so I still have the same problem.

Anyone else found the issue I mentioned, where using PC (as a server) to Mac (as a client) is good (< 10mS latency) but anything else is dire (200+ mS latency)?
And did you find the solution?