I am working on 3D multi-player shooter game in Unity using SmartFoxServer
Since I need to implement some destructible objects in the game I tried to use these assets:
Fracture https://www.assetstore.unity3d.com/en/#!/content/7193
CaronteFX https://www.assetstore.unity3d.com/en/#!/content/56698
things are working well for single player but I am not sure how to tell the server to do same destructions for other players
Destructible objects for multi-player game in Unity
Re: Destructible objects for multi-player game in Unity
Hi,
one of the two tools doesn't seem supported anymore (the 2nd one), anyways it depends how accurate the destruction must be in your game. A basic way to make it multiplayer would be to transmit only the triggers that initiate the damage/fracture of the objects to all clients. This way they are simulated on each client though it's not guaranteed that each client will end up in the same exact state. I.e. some of the debris might be positioned slightly differently on each client.
If this is not a problem it might work without too much effort. Otherwise if everything needs to be perfectly synchronized I don't think there's an easy answer. The problem with perfect synchronization is that the simulation must be run on the server, and therefore the whole fracturing component should run on the server side. This in turn means that the server should also be aware of all destructible objects in the map, among other things.
Hope it helps
one of the two tools doesn't seem supported anymore (the 2nd one), anyways it depends how accurate the destruction must be in your game. A basic way to make it multiplayer would be to transmit only the triggers that initiate the damage/fracture of the objects to all clients. This way they are simulated on each client though it's not guaranteed that each client will end up in the same exact state. I.e. some of the debris might be positioned slightly differently on each client.
If this is not a problem it might work without too much effort. Otherwise if everything needs to be perfectly synchronized I don't think there's an easy answer. The problem with perfect synchronization is that the simulation must be run on the server, and therefore the whole fracturing component should run on the server side. This in turn means that the server should also be aware of all destructible objects in the map, among other things.
Hope it helps
-
- Posts: 4
- Joined: 30 Nov 2019, 18:27
Re: Destructible objects for multi-player game in Unity
Thank you so much for that answer! I'm working on another game - a RTS one - and I'm using this destruction mechanic as well. Fortunately, the position of the "rubble" after said destruction isn't critical (it's used to destroy buildings and bridges, the rubble of the former falls around it and just creates a patch of rough terrain, and the latter's just falls into the water and prevents the crossing of the river) so it's not critical for it to be identical on all servers.
Who is online
Users browsing this forum: No registered users and 130 guests