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 » Scripters
Home Search
 

Re: Ugh... Complex Server-Client relations

Previous Thread :: Next Thread 
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:11 PM
Ok so I have a shooter with FE=true. The guns are created and managed locally, so only the local player can see his/her real gun. The server creates a static gun and welds it to the player so others can see it.

The shooting is sent to the server via a RemoteFunction, which then plays the sound and displays the effects for the other players.

Problem is, I want the other clients to be able to see things like:
- whether other players are aiming
- how high up/down the players are looking
- if the players are sprinting
- if the players are reloading
- etc.

I don't want to absolutely destroy the server with excessive RemoteFunction spam calls, so what would be the most efficient way to accomplish this?

Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:14 PM
you can play the sounds from a localscript and they'll replicate.
send character states to the other clients so they can animate locally

I appreciate your attempt at humor
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
04 May 2015 07:16 PM
copy the code over to the server and fire it tehre
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
04 May 2015 07:19 PM
Create a remoteevent that sends where the player is aiming, then update that information on the server.
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:19 PM
And how would I send client-->client?
I feel like editing values in ReplicatedStorage would have the same effect as a RemoteFunction spam?

Also, the idea of having each client change every other player in workspace seems kind of redundant. The only advantage would be possibly only updating characters on screen, but the data is still being replicated every time a value changes.



And how are sounds replicated? (I know for a fact sounds played in a localized model are not)
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
04 May 2015 07:21 PM
What do you mean client->client. This is a server-client system, you can't send directly from client-to-client.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:22 PM
client->server->other clients

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:23 PM
That was in response to Devious "send character states to the other clients so they can animate locally"

And I'm still worried about putting stress on the server with a constant spam of RemoteEvents/RemoteFunctions, say 10 times per second per client.
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:24 PM
Going client -> server -> client makes no sense. If the server was already given the data, then the server should simply edit the static models, which would apply the change to all clients anyway.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:24 PM
Only fire the remote when the state changes

I've got a game that's got clients firing a remote every tenth of a second and I've seen no network lag whatsoever, despite my terrible internet connection.

I appreciate your attempt at humor
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
04 May 2015 07:25 PM
Just updating the position won't stress the server.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:25 PM
"Going client -> server -> client makes no sense. If the server was already given the data, then the server should simply edit the static models, which would apply the change to all clients anyway."

Animating and doing effects on the server is ugly and you should never do that.
That's what'll give you more network lag.

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:30 PM
I disagree @Devious...

I'm going to try using RemoteEvents and see how it is in terms of lag/appearence

But, anyway, what about the local sounds being replicated?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:32 PM
do it like this

client:
omg i reloaded
play sounds
do animation
'hey server i reloaded'

server:
omg this lame client reloaded
'hey other clients, ur friend reloaded'

other clients:
lol the server said some noob reloaded
kay lets animate and play sounds locally

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:37 PM
client:
omg i reloaded
play sounds
do animation
'hey server i reloaded'

server:
omg this lame client reloaded
'hey let me just edit those static gun models that I created which will automatically replicate to other clients'


:u
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
04 May 2015 07:38 PM
if you are going to make the server handle those animations OP, that's gonna create server-side lag

you're best off doing it the way deviation suggested
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:39 PM
think of it this way:

say you have a custom explosion that uses ten parts
every time an explosion is created, you get ten more packets of data to be sent to every client every step
this clogs the network and gives you a jittery explosion

or

you fire a remoteevent to tell the clients to create a local explosion
you only send one packet of data to each client once
you get smooth explosions because locally calculated physics

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:43 PM
Er it would literally just be setting the C0 / C1 of a weld...

That's really going to cause server lag?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:45 PM
Not necessarily, but it'll look pretty dang ugly

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:46 PM
Ugly how?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:47 PM
laggy/jittery animations

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:47 PM
How would that differ if sent to the client...?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:48 PM
You could do proper tweening and smoothing on the client, which would give you animations that actually look nice.

I appreciate your attempt at humor
Report Abuse
jewelycat is not online. jewelycat
Joined: 10 Sep 2008
Total Posts: 17345
04 May 2015 07:49 PM
That sounds like far too much processing for the client to handle, especially when added to 11 players and all the effects of the local gun.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
04 May 2015 07:51 PM
lito did it and it worked fine.

I appreciate your attempt at humor
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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