I am looking forward to developing a 2D spaceship-fighting, brawler game and I have so many ideas about it. I am going to make a single-player component anyway, but the core of this game would certainly be its multiplayer. For this game, I was inspired by Brawlhalla and its dynamic play-style. In my game, there has to be real-time action features such as attack, dodge, getting hit, killed, so a reliable networking needs to exist. I have thought initially about a client/server architecture, but a peer-to-peer connection would be in my opinion more easily for me to implement. I have read this article and it proves encouraging for me to go on with this simulation solution.
Let me describe my concept:
A client initializes a room and using sockets, IP, port and the other players would after connect to him. Therefore, there is always a Master Client that handles the new connections and gives signal to other clients about a new existing player. Then, as the game is running, the byte data-packets would stream each player's input, his position, his ship rotation, his ship status and so on, so that each of the other clients could run a perfect simulation of the initial client. In other words, this data packets would trigger all the actions on each client. As network protocol, I am thinking about TCP/IP and should someone be willing explain to me in more practical terms the difference between this and UDP, I would be thankful.
I have even computed how much data it would take to transmit over a second: assuming a byte array that holds all the data at one time multiplied by the number of calls per second (about 32 times) multiplied by the number of clients the data should be broadcasted to (3-4) results in about 32 kb/s. It might be a dummy result, i might have left a lot of things out, but again, I am ready to learn.
As a note, I do not intend to make at this moment a professional multiplayer system, but rather, I would like to learn more about this programming part of applications and I think this is a very good project idea to enhance my skills. Of course, I am opened to any advanced tips, solutions, materials and should I add anything else about my concept, please let me know.
How is my theoretical model so far?