servers

Started by
6 comments, last by djsteffey 23 years, 8 months ago
Lets say I want to use my computer as the server for my small MMORPG (no more than 40 - 100 connections at one time). How fast of a CPU would I need for this ? I know my connection is good enough (T3 with speeds ranging from 300 kbps to 1mbps), but how fast of a processor would you need. All I do in the server is.....if a player moves then it sends a message to the server, then the server sends the position of the moved player to each client. Right now the message size is 8 bytes. There are no graphics on the server so the server doesnt have to worry about rendering graphics to the screen. I have a 366 mghz and was wondering if this would be fast enough to handle it. "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail themGames Productions
Advertisement
I''m not an expert on using servers in practice, but if you don''t don''t do any special processing with the received packet, before sending it to all clients...the network speed will probably the slowest factor here (even on a 486)

But hey, I''m not an expert, and I have a slow modem myself, so please correct me if I''m wrong...

Yes the network is often the slowest factor. Also what is your outgoing speed vs. your in coming speed? Very often outgoing is slower than incoming so watch out.
Umm in terms of just transfering 8bytes per user to all the other users would that not be 8*(100^2) or 80,000 bytes? Or 80kb well let''s say that is WAY less than a full screen blit down in software. I can blit a 640x480 16bpp surface 60fps on a PIII 533mhz machine which is 614400 bytes! Or 615kb! So you should be able to "process" those commands between players hundreds of times per second, however you''ll have to take into account a couple more things...

With that simple of a command structure your asking for hackers, so people will intercept and change packets going back and forth for their advantage so you may want some sort of basic encription. Which will slow you down a bit, now at 300 kbps you can move 300,000 bits (not bytes) per second or 37.5kb so yes your network connection is the one holding you back. You should always assume worst case scenarios so even though you *can* transfer triple this, with 100 people on there''s bound to be some trouble...

Good luck! And I hope it turns out!
See ya,
Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
cyberbean.......why do you quare the 100 in your calculation ?
also take into consideration that I only expect 40 - 100 people online in the entire world at once
player positions are only sent to other players on the same map....and no messages are sent if the player isnt moving, or interacting with another player, like if they are interacting with a merchant/villager or in battle versus a monster.



"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

I''m doing pretty much exactly what you''re doing. Except I''m going for 1500 allowed expecting only 200 to be playing at any given time.

For security I have it set so that important information can only be changed by the server. The client has copies of information locally however the server bases it''s actions on it''s information which can never be directly changed by a client. A client sends a small packet usually 4 bytes saying what the client wants to do and then the server verifies it can be done and sends an update to all clients affected.

In order to allow alot of people on you just have to keep all packets small. My client/server allows me to change precisly how many bytes are sent and what they are. That''s your first goal. Then you have to figure out what you really need to send. Most of the time you''ll just be sending player positions out. I have those at 14bytes each but can cut them down two more bytes by putting values together in a single byte.

Ben




NCSU, optimize your outgoing data so you only send the new player coords to people who are remotely close to the guy.
ie if someone is 50 rooms away dont send them useless info, store the last position and then if two come close, start transmitting data between the 2.
Also when 2 people are in the same room, try sending the ip of eachother and have eachother send the packets to eachother also that way there is no real teleportation effect due to server lag. ie. I have to shoot ahead of him so the bullets hits him with this horrible server lag.

Hope this helps =)

-TipTup
TipTup.Com
If 1 person moves, 100 people are informed about it. If two move, under your scheme, 100 people are notified about #1 moving, then 100 people are notified about #2 move.... So, up to 100 people moving, each one of them causes notification to 100 other people you get 100 * 100, or 100 ^ 2.
TipTup, you may have given me the most useful information I have got off of these message boards since I have been a member.
Thank you very much


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

This topic is closed to new replies.

Advertisement