Multiplayer has turned out to mean at least three times the development time and problems I'd expect from making Sunderstar without it. Even a relatively simple space shooter gets complicated when the client and server disagree about where a ship or projectile should be.

The problems were visible in basic actions. Waiting for server updates delayed the response to movement input. Around collisions, differences between the client and server could pull the ship back into a corrected position. Late updates made remote movement harder to keep smooth.

Shooting had similar issues. Matching an immediate local shot with the server's projectile was unreliable with weapon spread. Correcting it toward an older server position could make it jump backward or appear to change speed. Impact effects also needed to appear on time without flashing again when the server's confirmation arrived.

I changed the local ship to predict movement immediately, using the same calculations as the server, then correct any differences when server updates arrive. Other ships move smoothly between received positions, with a limited estimate of their movement when updates arrive late.

Collisions need prediction too. The client now calculates how your ship responds to an asteroid or another ship using collision data from the server. Only your ship moves locally. Small position corrections are smoothed; large changes, such as teleports, happen immediately.

The visual projectile now adopts the server's direction without jumping backward, keeping a constant speed. Impact effects appear locally, and matching server effects are suppressed so the same hit doesn't flash twice. The server still decides hits and damage.

I also made projectile spawning, muzzle flashes, sound, and replay use the same position at the end of the gun barrel. Changing movement prediction even exposed a bot ownership bug in Host mode that needed fixing.

Automated checks have passed, and the metrics have already improved in Unity's network simulation. I still need to verify those improvements in a real gameplay session over the internet with a dedicated server.

If you've worked on multiplayer, which seemingly simple feature took the most time to get right?