Few Questions

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.

Thats an over simplification. Is this an Internet or LAN game? Over LAN TCP is fine. Over Internet TCP may be fine too depending on your game. if this is a traditional twitch platformer then no matter which way you go you have major latency issues to overcome over the net,.

You might just get away with this on a LAN, maybe. Yould never get away with it on the net. In general for latency reasons you want to handle player response locally. If you need to do cheat-checking then Id run a parallel game on the server that “double checks” the results. (or let other players double check ech other is is more typical for a lock-step type game.

I believe Kev Glass just completed an internet lockstep based RPG that would have similar characteristics. He might be willing to share his techniques (or even some code) with you.

This is only for open loop asynchronous games. It sounds to me like youve got a lock-step design.

You don’t. Open loop games show only an approximation of the other players’ actions.

Every game has some critical data. You either need to send this by TCP or effectively re-invent TCP on top of your UDP with redundancy and re-trasmit frames.

All my code for everything I’ve done recently is at:

http://www.cokeandcode.com/feck

I’d hardly call the RPG complete :wink: but the networking model worked pretty well. I generally referred to it as distributed simulation - but thats just because of some old background :slight_smile:

HTH

Kev