Original Post
I am currently attempting to make my first graphic multiplayer game, but have run into a bit of trouble concerning server design. Background: The game is a 2D top down shooter I originally was going to use TCP because that is what I knew, but then I learned about UDP and it seemed to make more sense for real time game data, so I began to design a system that would use TCP for reliable data (chat messages) and UDP for game states (object positions,rotations,etc.) but ran into a problem with UDP. Since it has no "connections" I found that when testing locally if the server and client were on the same machine they would steal each others messages. The server would send a message but it would be received by the server because it too was listening on that port, or the client receiving its own messages. Then I realized this would pose a similar problem if two people were playing from within a LAN and therefore have the same external IP, how would I send data to either of them individually? These problems make me want to switch to a TCP system but I worry that will cause a slow down in game FPS. Can anyone give me some advice? This is my first time trying this. Note: Currently using boost::asio library for networking on Windows