Anyway to make all clients handle physics?

i dont care about exploiters on this game im trying to make, i dont expect it to be popular

im trying to make the server do the least amount of work it can do and made the clients do it themselves, for example a rocket hitting a part and all the parts flying would make the server do the physics calculations, and if too much parts flying and falling thats gonna lag the server

i thought to why not make the clients handle the physics themselves but each one would do the calculations different and it would all behave weird, like seeing a player standing on a invisible part because thats where it is on their end, while on yours there is no part

is there any way to do this

1 Like

I believe NetworkOwnership is the answer you are looking for.

Having networkownership means that client calculates the physics for a part.

You can read more about this on forums and the roblox site.

:SetNetworkOwner(owner) if I recall

1 Like

yeah i thought of this but this would require one client to do all the handling and then replicate it to the other clients, i was looking if all clients could do it individually.

nevertheless this is a good solution and ill try it out, if thats the only way i could do it

I mean you could, but clients have a mass of resources compared to the server’s diminishing resources.

Server is more powerful but slower because it has so much to do.

By assigning an entire game to one client, you are just creating your previous problem of the server doing everything but as a client.

Roblox already tries to implement your idea through networkownership, but if you manually adjust it yourself according to the most relevant player, you are making their solution better and more efficient.

ok say someone launched a rocket and a bunch of parts started flying, how would i find out what parts to set the network owner ship to?

i found out some time ago that the network owner ship gets set to the nearest player if its unanchored, but i seen games get laggy when theres alot of parts, im assuming cause of the server handling the physics?

also, the reason i want to do teh other way is because for example, if a player placed a block i just want the server to tell the other clients where the block was placed, rather than just the server placing the blocks, so since the blocks dont exist on the server but on the client they do, you cant do setnetworkowner

Id just set it to whoever launched the rocket; by technicality they wouldn’t be surprised if they got a little bit of lag after launching rocket right?

Also yes, it is automatically set but you override it when you change it.

  • The server lag is likely because a lot of server calculation yes. It doesn’t seem like roblox has published the exact method that it is determined automatically, so we can only assume.

If a part exists on the client its network owner is already the client. So when you tell the server to fire a FireAllClients and create it on each client, then each client will handle its own resources.

yes, but then each one would calculate the physics differently, making it weird.

Although it may be time consuming, if you want to have everything run individually by each client, i would look into making a custom replication system. I would look into networking tools like Blink or Zap.

are these like bytenet? but newer im guessing

Hey man, I just wanted to let you know that allowing clients to manage physics is very vulnerable to exploits.

Here is an example of what would happen:
Exploited NetworkOwnership Example (00:36)

Similar, but they have their own languages for defining events and functions that lets them optimize for your own use case. I would definitely look into them even if you choose not to use it for the project you’re working on.

Then you should avoid making parts on the client at all. Send the details in an event and set owner to the player it would have been made on’s client.

easiest way is to clone everything on the client and destroy the server instances