I'm designing an online top down fighting game with the XNA C# framework. It uses the host/joiner architecture common in first person shooter games. It's supposed to support up to 16 players.
The game works fine up to ~6 players. After that, every player besides the host (all the joiners) starts getting bad latency issues for some reason. I've had my nose in server/client code for months, and I'm honestly at a loss. Is there a certain tool besides Visual Studio that specializes in analyzing server/client communication?
The fact that the host works completely fine despite everyone else lagging concerns me. I know the server isn't getting bottlenecked since the host has a client just like anyone else, and has to communicate with it, even if it is just through the loopback address. My packet sizes also tend to stay under 1kB so I dunno.
Logic is:
Game.Update:
- Client.Update;
- If you're the host: Server.Update;
Server.Update:
- Check for inputs;
- Assign inputs to players;
- Level.Update;
- Send level data unreliable sequenced to all clients;
Client.Update:
- Check for server messages
- Fill in level with message data
- Level.Update
- Send input unreliable sequenced to server