Ok, i’ve done a lot of reading, here and on google, about networking. I’ve even went and coded most of it in TCP, but there are a few problems and i have to rewrite it from scrratch so i need to start over the right way.
Ok, my game is a platformer, and as i was reading UDP was reccomened for this type of game. My only question is… what data do i send/don’t send?
Should i send keypresses to the server and let the server handle it? Then i read you want to send last position and velocity etc, incase of packet loss and out of order packets. I’m not really sure how to keep the players synced on everyones screen, and then what if keypresses dont make it? Then what? The biggest problem would be shooting… how do you make sure that when a player shoot, and it hits, that everyone registers. Or do you just kinda let it fly by showing all the shots on the client, and if the server doesnt get the info, oh well.
Also, how big do you think the packets should ever get? It seems like alot of data to send from server to clients. Especially if there was only like 8 players, you need positions, velocitys, player state, etc.