generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How should I set up connections in a shooter?

Previous Thread :: Next Thread 
jewelycat is not online. 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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
29 Nov 2013 08:48 PM
Use only server-sided scripts
Report Abuse
jewelycat is not online. 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 is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
29 Nov 2013 09:07 PM
y u do dis
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
30 Nov 2013 01:59 AM
:u
Report Abuse
skyarex is not online. 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
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image