Rigid bodies network synchronization

#1
Hi. So recently I decided to learn network system in 5.4, I looked into code, and I understand aspect and rmi systems. Although I am having this issue with rigid bodies. Basically I did not change anything within the code. I ran Rolling ball template, and immidiately noticed, that the boxes on the stage are not synchronized properly.

https://ibb.co/hwCSKQ

Both are connected to the same server. No changes. Now.. the question is.. Do I have to write my own rigid body component that will support network and send position via aspect, or there is some way to tell all rigids to actually sync their positions. (Yes I did check the Network Synced feature in the editor, no changes, anyways all this feature does is calls BindToNetwork()).
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Rigid bodies network synchronization

#4
Thanks. I know how to send data to and from client etc. I know how to achieve this synchronisation if i have to. The main question is.. do I have to create the special component then, that will handle those entities. I mean I can add rigid body component and send position over metwork, but I was just thinking, that crytek prepared comppnents for the networking, and there is just something i should enable
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Rigid bodies network synchronization

#5
Still struggling with this issue. How can I set up sync variable for rigid bodies and then serialize it, if I can't call rmis and aspects on entities other than player? I have my custom weapons or any other item, and their positions are not synchronized properly. Aspects and RMIs are not working with these items, because as you said, they have server authority only.

At that point, where rmi and aspects don't work on normal entities, the only possible way I see is iterating through all entities, on EACH player and sending their position and orientation to all clients. There is no way it would not overwhelm server. Performance would suck. I don't believe it is pro way of doing this. It's extremely unefficient.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Rigid bodies network synchronization

#6
just put all sync var in component, attach it to bullet which has rigid component, bind bullet to network, spawn bullet in server.

note, you will need set sync vars of component from rigid component attached in server every update, you will set rigid component property from sync vars of component in all clients.

you can use rmi.

if not working previous,
try below

just put all sync var in component, attach it to player, bind player to network, spawn player in server.

note, you will need set sync vars from rigid component of weapon in server every update, you will set rigid component property from sync vars of component in all clients.

Re: Rigid bodies network synchronization

#7
I don't understand what you're trying to say.

The first option. If I put sync variables into the bullet it won't synchronize anything. As I previously said I cant use rmi or aspects on non-player entities.

Second option is better. I could create component like for example CWorldSynchronizer and attach it to each player but then, how do I synchronize all of rigids ? Do I just iterate through all rigids every frame? It would be very bad for performance as well as sending values of each over the network on each frame would lag the game
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Re: Rigid bodies network synchronization

#8
do you bind bullet to network? networking must have player , enemy, background object.
every networking entity have netobjectid , those entity who dont have netobjectid do not have networking function.
player have client local authority, enemy have server authority, background dont have networking funtion who dont have netobjectid and does not bind to networking.

http://docs.cryengine.com/plugins/servl ... CAGuU1FI9B

netobjectid is eid , not entity id.
entity id is not unique over networking , but netobjectid is because it is assigned by server and synced.
https://www.cryengine.com/community_arc ... 83&t=49610

https://www.cryengine.com/community_arc ... nC3tXddtHQ

http://docs.cryengine.com/plugins/servl ... ew/1605719

Re: Rigid bodies network synchronization

#10
You talk about completely different things that I am asking about. Why do you talk about bullet? My bullets are pe_particle. Not rigid. And i am asking about more background elements. I create rigid body, just a simple cube. It is properly spawned on all clients, it's all good. I never forget binding it to network.

So one of the players approaches this cube and walks against it and he pushes this cube. So it moves obviously on all clients cause obviously player's movements are synchronized, but cube is not exactly serialized because it is more pushing cube separately from each other than synchronizing its position. It is bound to network!. But i still can't call rmi or aspect on it. No matter if i call it from server to client or opposite way. That's why the question is who should be sending this values ? Which player ? Should he iterate through all entities , it would be inefficient af
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Who is online

Users browsing this forum: No registered users and 1 guest