Original Post
[font="verdana, geneva, lucida,"]I'm planning on making a fighting game in C++ which multiple people can play over a network. I've never done any programming involving a network, so I have some questions.
1) What protocol should be used? I don't know the differences between TCP and UDP.
2) What changes would I have to make to play this over a LAN network, as opposed to the Internet?
3) How should I make sure that all versions of the game world are synced properly? I'm thinking of initializing one copy per computer, then only sending events like 'move up' or 'attack' between the computers, so not as much data needs to be sent. Is there a better way, or is this good enough?
4) If I do that, how do I make sure that I don't have timing issues? For example, A receives two events from C and D simultaneously, but B receives C's later, which could alter the internal state of the world. Butterfly effect and all that.
5) How should I make sure that random numbers are the same between all computers? Should I just send requests to one computer and have it send out a random number? Seems inefficient...[/font]
[font="verdana, geneva, lucida,"]
[/font]
[font="verdana, geneva, lucida,"]6) I have no clue which 2D graphics library to pick. I've looked at SDL, wxWidgets, Qt, and GTK+, but I don't know enough about any of them to decide. Also, [/font][font="verdana, geneva, lucida,"]I'm assuming I'll need a third party library for sockets and whatnot, so, do any of these handle that too?[/font]
1) What protocol should be used? I don't know the differences between TCP and UDP.
2) What changes would I have to make to play this over a LAN network, as opposed to the Internet?
3) How should I make sure that all versions of the game world are synced properly? I'm thinking of initializing one copy per computer, then only sending events like 'move up' or 'attack' between the computers, so not as much data needs to be sent. Is there a better way, or is this good enough?
4) If I do that, how do I make sure that I don't have timing issues? For example, A receives two events from C and D simultaneously, but B receives C's later, which could alter the internal state of the world. Butterfly effect and all that.
5) How should I make sure that random numbers are the same between all computers? Should I just send requests to one computer and have it send out a random number? Seems inefficient...[/font]
[font="verdana, geneva, lucida,"]
[/font]
[font="verdana, geneva, lucida,"]6) I have no clue which 2D graphics library to pick. I've looked at SDL, wxWidgets, Qt, and GTK+, but I don't know enough about any of them to decide. Also, [/font][font="verdana, geneva, lucida,"]I'm assuming I'll need a third party library for sockets and whatnot, so, do any of these handle that too?[/font]