Archived

This topic is now archived and is closed to further replies.

Agemaniac

Client/Server vs Peer-Peer: DirectPlay

Recommended Posts

Agemaniac    104
Hi. I was reading some articles in MSDN and in the net to learn something about DirectPlay and how it works. I need it to implement the network in a turn-based RPG. My question is: if the max number of players is 12, using a dial-modem connection (5k/s) is it possible to use a Peer-Peer? Implementing a Peer-Peer network is easier than a Client/Server i think. Its because you dont have to bother with the host drop or something like transfering the host to other player. Any good links too articles, e-books will be great....thanks.

Share this post


Link to post
Share on other sites
Mastaba    761
Even with a peer to peer model, there is still a host, that is in charge of giving new peers the i.p. addresses of the other peers. Each model has its pros and cons. For a turn based rpg, I would agree that a peer to peer model is the best bet. A turn based game typically does not generate a large game state delta per turn so for dial-up, you could easily handle 12 players simultaneously (because they really aren''t simultaneous, i.e. the turn takes far more time than the latency).

As far as links to point you towards, I have no clue. The SDK tutorials walked me through it fairly easily.

Share this post


Link to post
Share on other sites
Agemaniac    104
Thanks Mastaba. I really apreciate your help. I was just looking for opinions before start coding. Im reading the tutorials in MSDN like you said, and alread start to code. Any other opnions are welcome.

Thanks....

Share this post


Link to post
Share on other sites
hplus0603    11347
You don't actually get 5 kB/s through on most 56k modems. When we do dial-up testing, ISPs around here (smack in Silicon Valley, California!) often give us modems with between 35,000 baud and 6,000 (!) baud. That translates to between 3.5 kB/s and 0.5 kB/s (once headers are accounted for etc).

Anyway, assuming you have 12 players, fully connected. That would have you send 11 packets, and receive 11 packets, per tick. Let's assume your PPP software and ISP use van Jacobsen header compression; that makes 13 bytes per packet in overhead, so your packet overhead is 11*13 == 143 bytes per tick. Let's assume you get 4 ticks per second, that's 572 bytes per second -- just in overhead.

If you're willing to assume good connections, you can cram about 15-20 bytes into each packet sending to each peer per tick, at 4 ticks a second. If you want bigger packets, use slower ticks, or fewer players. If you want to work on "most" modem connections, you have to accept both (i e, slow ticks, and few players).

Trying to make a RPG work well with 15-20 bytes per packet is somewhat of a challenge, though.

[edited by - hplus0603 on March 30, 2004 5:58:35 PM]

Share this post


Link to post
Share on other sites
Agemaniac    104
thanks for the explanation...yes..i know...5k/s is too much in dial connection. Each turn in my game have 30 seconds max. and i think 15 seconds min. (if the player is so good than he can make his move in 15 seconds). I dont know what kind of package i will have to send through the net because im a newbie in Directplay. Is there any way to verify if a client is still online...Like pinging every X seconds, using sockets programming??? is there a easy way to know it..? thanks.....

Share this post


Link to post
Share on other sites