CoOp Best Practice

Options
Zelek
Zelek
I'm looking into adding CoOp to my Physics-based game, and could use some advice. My initial approach was to treat the MasterClient like an authoritative server, and have the other players send their movement input to the master. This works, but even with a respectable 70ms ping and the interpolation included in NetworkRigidbody, the controls just don't feel quite responsive and crisp enough.

Am I going to run into problems if I allow each client to instantiate and own their own character object? I'm not concerned about cheating, I'm just trying to avoid out-of-sync issues where the clients disagree about player and enemy positions. For example, if all the enemies are instantiated and owned by the Master, but the other clients own their own character objects, I assume issues are going to arise when it comes time to resolve whether an attack hits or misses.

Any advice appreciated!

Comments

  • vadim
    Options
    To make local player maximum responsive to user input, you should control it directly. Its instances on others clients will be moving with some delay. Same is true for enemies which you probably want instantiate and control on master. With such even slightest movement mismatches hit detection will differ on different clients. So you should choose one client for each situation who detects hit and notifies about this event others. That may be master or attacker's or even attacked client (making hit more natural for that client). Other clients still may notice some hit mismatch, but you can't avoid that without authoritative master.
  • Zelek
    Options
    Thanks for the clarification, that helps a lot.