Download

Question about network replication on procedural objects

I’m thinking of adding a multiplayer experience in my project, but I have some doubts about replication.

In my project I work a lot with the UProceduralMeshComponent to create meshes at runtime. I’m not sure what happens if I connect 2 players together and they interact with these objects.

Assuming that there is ONE procedural object in the map, and it’s the same “shape” for all clients, what happens if a user moves around the procedural object? Will the other clients see it moving too?

I don’t know about the specific implementation of ProceduralMeshComponent, but if you make its generation deterministic then you can at the very least replicate whatever seed or process is used to generate the mesh so that clients can produce the same mesh. As for it moving, if the mesh is attached to a pawn and the player moves that pawn then yes they’ll see it moving on all clients. If its not attached, you’d need to have the client tell the server how they want to move the actor that is parent to the mesh, and then the server would move said actor with bReplicateMovement being true and clients would see the actor moved.

Thanks for the clarification (and sorry for the late reply)!