Hello, I am developing a multiplayer game where multiple players can control (have different roles i.e. driving, firing the mounted gun…) a vehicle. Player characters can enter and exit the vehicle.
So far I thought of 2 ways of doing it:
-
Split the vehicle into multiple parts (each of them are different pawns) and attach them together in a main class via child actor components. So players can possess different parts of the vehicle and control their respective pawns while being attached to the main pawn (driver for instance). In this way each player would own their part and replication of those would be handled in their pawns with replication system.
-
Keep the vehicle as one class and implement a seat system in which, seats are added to the vehicle class as child actor components and players possess them instead. In this way each seat would have to send their actions to the server via RPC’s and they would be replicated to clients from there.
To me, second option seems cleaner to implement but I am worried about network performance of it.
Is there another solution which I couldn’t think of? What is the best way to go about it?