0
\$\begingroup\$

I need to code a little game for a school project.

The type of the game is like the Warcraft 3 map "Warlock", if anyone doesnt know it, here is a short description: up to ten players spawn into an arena filled with lava, the goal of each player is to push the other players into the lava with spells (basically variations of missiles, aoe nukes, moba spells etc)
http://www.youtube.com/watch?v=c3PoO-gcJik&feature=related

we need to provide multiplayer-support over the internet, for that reason I am looking for the best network protocol for this type of game (udp, tcp, lock step, client-server...)

what the requirements are:
- same/stable simulation on all clients
- up to ten players
- up to ~100 missiles on the field
- very low latency since its reaction based (i dont know the method wc3 used, but it was playable with the old servers)

what would be nice (if even possible, since the traffic might be too big):
- support for soft bodies over the network (with bullet physics), but this is no real requirement

I read several articles about the lock step method used for RTS games, this seems to be great, but does it fit for real-time action games too (ping-related)?

If anyone has run into the same problems/questions like me, I would be very happy about any help

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The protocol (TCP or UDP) is independent from the used network model (P2P or S/C) \$\endgroup\$
    – API-Beast
    Oct 5, 2012 at 17:45

1 Answer 1

2
\$\begingroup\$

The TCP vs UDP debate is full of subjective arguments, speculation, and flawed benchmarks. "Is the TCP protocol good enough for real-time multiplayer games?" has some answers. Browse through our networking tag to see more questions that might have answers to further help you. This is really a case where you need to do your research, understand what each protocol gives you and what its potential negatives are, hypothesize on which one is better for your purpose and execute on it, and then either live with the decision, or experiment/backpedal to decide if the other protocol would have been better. Then write a postmortem and post it on the internet, so that we can have a bit more quantitative data to feed into the TCP vs. UDP debate.

In other words, do some research, and then just pick one.

The same applies to client/server vs peer-to-peer network architectures. They have pros and cons which are a little too much to list in an answer, and you could quickly do some searching and find this information to make your decision. A game could be made either way, and you should decide which one you think is best for your purpose. I think I can safely say, though, that client-server will be much easier to enforce a "same/stable simulation on all clients" situation than peer-to-peer.

For the sake of decisiveness, I would recommend using TCP so that you don't need to go through the trouble of implementing TCP's reliability and ordering on top of UDP, and client-server so that you don't need to figure out how to synchronize the peers, deal with bad data, etc. Alternatively, you could look into game-oriented network libraries that are out there and choose one of them to use, if you're comfortable with that.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .