Destructible objects for multi-player game in Unity

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Natalie6
Posts: 1
Joined: 14 Sep 2019, 08:25

Destructible objects for multi-player game in Unity

Postby Natalie6 » 23 Sep 2019, 05:14

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
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Destructible objects for multi-player game in Unity

Postby Lapo » 23 Sep 2019, 13:24

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
Lapo
--
gotoAndPlay()
...addicted to flash games
Tanker_5455
Posts: 4
Joined: 30 Nov 2019, 18:27

Re: Destructible objects for multi-player game in Unity

Postby Tanker_5455 » 30 Nov 2019, 18:43

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.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 73 guests