jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 29 Nov 2013 08:46 PM |
So I tried Client fires bullet + Client deals damage, and got people killing others after they died because of connection lag
Then I tried Server fires bullet + Server deals damage, (using RemoteFunctions/RemoteEvents) and got a solid half second delay between when the client sends the bullet function and when the server actually fires it
I could try Client fires bullet + Server deals damage... but would that not have a massive delay between the client telling the server to damage someone?
tl;dr - How do I minimize Server --> Client / Client --> Server times and/or stop laggers |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Nov 2013 08:48 PM |
| Use only server-sided scripts |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
|
| 29 Nov 2013 08:50 PM |
I can't do that... I have a LocalGame script which does everything for the player locally...
I did _G.GameService.Fire:FireServer(. . .) from LocalGame and got a half-second delay
as I said in my first post |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
skyarex
|
  |
| Joined: 21 Mar 2010 |
| Total Posts: 12989 |
|
|
| 30 Nov 2013 02:12 AM |
Why would you make the bullets and damage clientside? You are going to have to deal damage to other people, and other people don't run on your client. It all needs to be server side.
"Don't Panic"- HHGTTG |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2013 05:22 AM |
You probably want the client to decide when it has hit someone when it comes to people with relatively low lag because otherwise it might be hard to hit enemies.
However, you dont want laggers to kill enemies whose actual position is 10 studs from what the lagger sees.
So:
1) The client shoots, and tells the server: *The trajectory of the bullet *Where the client THINKS it hit 2) The server takes the trajectory, and checks where the bullet would hit from the servers point of view 3) If the clients view is too far from what the server got as a result, use the result of the server. Otherwise apply the damage done by the client. A more user friendly approach might be to only limit the amount of damage done the farther the client and servers results are from each other. Eg. If the client thinks it hits the head of someone, but the server sees that the head is 10 studs away from the trajectory of the bullet, it would lets say halve the damage done. |
|
|
| Report Abuse |
|
|