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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 04 May 2015 07:22 PM |
client->server->other clients
I appreciate your attempt at humor |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 04 May 2015 07:25 PM |
| Just updating the position won't stress the server. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 May 2015 07:45 PM |
Not necessarily, but it'll look pretty dang ugly
I appreciate your attempt at humor |
|
|
| Report Abuse |
|
|
jewelycat
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 17345 |
|
| |
|
|
| 04 May 2015 07:47 PM |
laggy/jittery animations
I appreciate your attempt at humor |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 May 2015 07:51 PM |
lito did it and it worked fine.
I appreciate your attempt at humor |
|
|
| Report Abuse |
|
|