AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 24 May 2016 07:33 PM |
| I think I heard they do FireAllClients or something like that to replicate stuff. Anyone know? |
|
|
| Report Abuse |
|
|
|
| 24 May 2016 07:34 PM |
well if you want to replicate something to every client thats generally what you do
|
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 24 May 2016 07:36 PM |
(From a different post of mine) (Talking about my gun script) "Whenever you fire the gun, it clones a Billboard gui, and inserts it into the Handle of the gun, and deletes it after 0.05 seconds. This worked fine before [with the typical client-server setup], because the server does it, and it replicates to everyone else automatically.
With FireAllClients, each client has to individually clone the gui. With 20+ players, this will probably cause a ton of lag if your computer has to clone possibly 100+ billboards at one time, instead of the server just replicating it to you. (I know I could just do gui.visible = true and have a Billboard in the handle, but this is a much broader problem, because if I replicate anything it will have to work like this anyway and it won't be simple code)
How can I get around this?"
I think I'm doing this the wrong way. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 25 May 2016 01:25 PM |
If I understand right, PF doesn't really have any server involvement with their guns. Like, you locally run everything (so there's no remote event delay for anything that the server would have to do), and then they send every other client in the game functions to run, that also simulate what your client just did, like a muzzle flash when you fire a gun.
I see 2 problems with this setup: 1. Would having every client do all of these functions to simulate replication from the server cause a lot of lag? 2. If everything about the gun is local, how would you manage ammo? Usually you put an IntValue named "Ammo" into the tool, and then the server handles it. The only way I can see to get around this is to make the Ammo a variable in the local script that runs the gun, so it's not as easy to edit as Tool.Ammo.Value = 10000 or something like that. Although, exploiters could still reach the ammo variable in a script, so I guess you'd also have to do something like; while wait(10) do if Ammo > MagazineSize then fireserver:("KickMe") end end
Can anyone elaborate on what I brought up? |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
|
| 26 May 2016 12:06 AM |
| One advantage I thought of for the client to client system, is that it frees up a lot of processing power for the server. With client-server, the server would usually register the muzzle flash for a gunshot, but instead of client does the same thing. It takes up power on the client, but it could really help out the server. |
|
|
| Report Abuse |
|
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
AntiFiter
|
  |
| Joined: 14 May 2009 |
| Total Posts: 12290 |
|
| |
|
Eyerny
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 1554 |
|
|
| 26 May 2016 10:56 AM |
| This discussion suits more to be in the scripters forum. |
|
|
| Report Abuse |
|
|