Author Topic: Target.All lags on host  (Read 2106 times)

Eskinto

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Target.All lags on host
« on: March 31, 2015, 09:13:44 AM »
Hello there,

I'm having a lag issue when calling RFC functions locally as a host, when connected to a remote server that has about 600ms ping.

I get the same issue on the TNet Example scenes, namely clicking on a cube to change it's color:

tno.Send("OnColor", Target.All, color);  -> This is the default line, and has about a 1 second delay locally

changing it to:

tno.Send("OnColor", Target.Host, color); -> This runs instantly as expected

is this intended? it makes sense that Target.All should run instantly locally

thanks a lot for your help,
Vic


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Target.All lags on host
« Reply #1 on: April 01, 2015, 11:42:46 PM »
Yes, it's intentional. Think of it like this... two players click on the color at the same time. There is 600 ms delay. Player 1's RFC says something should be red, Player 2's RFC says something should be green. If it was set immediately, then Player 1 would see it turn red immediately, then switch to green. Player 2 will see it turn green, then change to red (when the other player's delayed RFC comes in).

TNet forces the behaviour to be consistent -- RFCs are sent to the server, server then sends them out in order so that both players end up with the identical state.

Eskinto

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Target.All lags on host
« Reply #2 on: April 02, 2015, 06:27:07 AM »
Thank you Aren, when you put it that way it does make sense, I guess with less lag it won't be as noticeable!