Explain what to delegate in a multiplayer game feature

Judgment callMedium20 min

Your task

You are building a multiplayer feature in a C++ game and plan to use an AI agent for 3 parts. One smooths other players' movement on the client between network updates. One is the server's hit detection, which decides whether a shot landed, allowing for each player's lag. One packs game messages for the network.

A junior teammate asks why you would hand some of these to the agent and keep others, when "it's all just code".

Which parts do you hand the agent, which do you keep, and how do you explain the principle?

It covers

  • Delegation boundary
  • Ownership