what equipment do i need to host an online card game?

Started by
6 comments, last by transformation 18 years, 7 months ago
Hey guys, I need help in determining what kind of equipment and resources I'll need to hold an online tunr based game. The game is exclusively a multiplayer game, it will involve finding people to play against online (you're not pitted against random challengers in this) and then playing against them. I'm a bit confused as to what kind of model to use for this. Should I put all the information on the server, as in all the cards that each player has or all the player statistics. Or should I keep information that is specific to a player on his local machine? Will that cause troubles with cheating? What do you reckon the load would be for a card game? Assuming a few thousand users (I hope that's not too much to hope for??), what kind of equipment would I need to run this this thing? Thanks for any advice.
Advertisement
Quote:Original post by transformation
I'm a bit confused as to what kind of model to use for this. Should I put all the information on the server, as in all the cards that each player has or all the player statistics. Or should I keep information that is specific to a player on his local machine? Will that cause troubles with cheating?

What do you reckon the load would be for a card game? Assuming a few thousand users (I hope that's not too much to hope for??), what kind of equipment would I need to run this this thing?

Thanks for any advice.


Sigh, another complete noob to network programming.

For under 1000 players in around 150 games, reasonable server hardware would be a 486DX/4, 32MB ram, FreeDOS, and a 9600 modem with a reliable ISP connection.

Assuming each client can get their program from some other source like a real web server, the game server won't matter.

Keep it all on the game server so you don't have to worry about cheaters, and limit the rate that people can send commands. A game where a player takes 200ms in their turn is probably a cheater. ;)

Quite honestly a 486DX/4 100Mhz or 133Mhz would be able to handle the processing load for a few hundred games. You need less than 52 bytes of memory to store the cards and who has them, where they are in the deck, and other odds and ends. You'll need just a tiny bit more than that for information about the players. Even a mediocre programmer could program the game rules for poker to run in under a microsecond on a 100Mhz machine. It would saturate out after a few hundred players and probably around 20MB of memory, if you aren't too careful about memory management. Assuming small commands, 1000 players at one command per second is going to need a 9600 baud modem over a clear phone line.

frob.
In all practicality, though, I'd go for one of the Celeron based self-managed hosting solutions. Typically, they're between $60 and $80 per month, bandwidth included. Trying to keep that 486 running would be more trouble than it's worth ;-)

The calculus is really simple:

Amount of bytes per player command * player command rate * number of players == bandwidth in.

Amount of bytes per player command * player command rate * number of players per game * number of players == bandwidth out (assuming command echoing).

(Amount of processing time per command + amount of processing time per message) * number of players * player command rate == processing time needed
enum Bool { True, False, FileNotFound };
A 100MHz machine? Really? Thanks for you guys' comments. Especially for those formulas, let's see according to my estimates that would be:

bandwidth in = 256max * 1/30secs * 10000 (hypothetically speaking)
= 85333 (bps?) => 85K per sec.

bandwidth out = 256max * 1/30secs * 2 * 10000 (hypothetically speaking)
= 170666 => 179K per sec.

processing = (1/1000secs + 1/1000secs)highly overestimating * 10000 * 1/30secs
= 0.6 seconds? Does that sound right? What does this mean? 0.6 seconds to process all users? On a 100 MHz machine?

Thanks a lot guys.
0.6 is the CPU load factor of that machine.

Whether the time to process the game on a 100 MHz machine is 1 millisecond per player, only a profiler can tell you.

Whether the player command rate will be one every 30 seconds, only measurement will tell (my guess is it'll be higher).

enum Bool { True, False, FileNotFound };
Also: if you have 10,000 people connected with TCP, a not insignificant amount of CPU will be used to service those sockets. You should run some measurements to see what the overhead is on your system, with your preferred socket methodology (IOCP, select(), kpoll, etc).
enum Bool { True, False, FileNotFound };
Actually, the configuation I gave above (486DX4, 33.6K modem) was a MUD server that we had, it supported just over a hundred users at its peak with the bottleneck at the modem. ;-)

I'm sure a card game server would be less of a load, and send far less data than the text-based MUD, which is why I caluclated a 9600 modem would probably suffice for 1000 human card players.

The point is that pretty much any hardware these days should be able to handle the OP's server requirements.

frob.
Thanks guys.

Quote:The point is that pretty much any hardware these days should be able to handle the OP's server requirements.


Point noted :)

This topic is closed to new replies.

Advertisement