Jump to content
  • Advertisement
Sign in to follow this  
Digitalemu

MORPG, Is bandwidth or CPU the biggest challange?

This topic is 4447 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm playing around with a MORPG (like Tibia), just for the fun of making it. (I aim at 250 players max. The philosophy is that ALL intelligence is on the server side to avoid hacking, which also means higher server CPU load.) My question is simply, what is most likely the limiting factor for how many players can be on a srver. Depending how I optimize the code between saving bandwidth and saving cpu cycles it will make a huge differance. But what is normally the bottleneck ? Example 1: A map might be 256x256 tiles. I can devide this into 32x32 sectors. Each player then get to know everything that happens with all other players within a 3x3 sector area. This area can then be more than 100% larger than the players actual viewing area. This way I don't need to constantly check who is nearby the player, I just send info to all players in these 9 sectors. This makes for easy and snappy code, but waste bandwidth. Example 2: I skip the sector variable and only send info to the players who are in the viewing area of a player. This will save a lot of bandwidth, but eat serious amounts of CPU cycles. For now, I lean towards going for minimum bandwidth. From my rough estimates, it would be possible to play even using modem if the map isn't too crowded or complicated. Any ideas? Someone who actually knows ? Tanks.

Share this post


Link to post
Share on other sites
Advertisement
This depends a lot on how much the server actually does stuff. If there's no graphics or 3d maths (like collisions) it's unlikely for you to run into any performance issues due to CPU.

When it comes to bandwidth, the big question is how fast connection you have at your server? If we assume it's a 100/100 meg ethernet, that can do perhaps 50% of the nominal capacity, we get 500kbit/s for all players together. That divided by the max number of players, we get 500/250 = 2 kbit/s = about 200 bytes per second for each client. That's modem speed. However, that is actually quite a lot. Let's say a player status packet is 20 bytes, we can pass 10 of those upstream and 10 down. It's very unlikely that the client would ever send 10 status packets a second, so that's probably not an issue. However, the downstream bandwidth is an issue, you will very carefully have to consider which packets need to be sended to which clients. Remember that the connection

When looking at some games and the bandwidths they use, they can be surprisingly low. For example Turbo Sliders, a multiplayer racing game, it actually uses about 2-5 kbit/s (if I remember correctly), and it is a fast paced real time game, while a MORPG might not be that time critical.

For the player it's more important to have a small lag than a big bandwidth.

So I'd say, any modern computer should do CPU-wise. For bandwidth, you need a 100meg ethernet connection and need to carefully optimize your network code and squeeze your data into as little as possible.

-Riku


Share this post


Link to post
Share on other sites
The connection or kind of server your game is gonna run on is unimportant in development time. Your game will probably start with a few players and will slowly expand, once your server is not capable to handle it anymore you will need consider a stronger server or connection. And if 1 server doesnt do it anymore you will need several machines to host your maps.

The question is hard to answer, it all depends how big your maps are going to be. If your maps grow really big you will probably want some space partitioning like a quadtree or oldstyle with a raster. They are not only interesting for deciding what info to send to which players but also for collision detection, texture loading and more.

Share this post


Link to post
Share on other sites
Assuming you are using standard hardware, sensible networking and a generic RPG game, 250 players will not come close to maxing out your connection or processing. If you are wondering about larger numbers you need to provide more details - what kind of data transfer per second / per player are you using? What gameplay features might require abnormally large processing time?

Share this post


Link to post
Share on other sites
You have a good idea of cutting the traffics that really a client don't need them.
What is your platform???
beside cpu and bandwidth put socket implementation, and platform resource management .If on windows, take a look at IOCP and if on *nix get lessons from apache implementation... how the guys managed the threads might help you.

Share this post


Link to post
Share on other sites
When you say "number of players on a server" do you mean "number of players in a world instance" or "number of players on a physical host machine"?

Most MMOs allow load to be balanced between multiple hosts, within a single shard. The easiest way to do that is to split the world into discrete zones, and put one zone into one server process, and then spread server processes across machines as necessary.

In general, you'll want to spend CPU to manage bandwidth; not so much for the servers' need, but for the client experience. If you have X bandwidth available to the client, then you want to give the best possible experience within that budget, rather than waste it all on inefficient networking. What "best experience" means is also something that is up for debate -- lots of objects, or high update rate, or high fidelity per object, or streaming background music, or dynamically updateable terrain, or something else? They all take bandwidth, and all improve some part of the user experience.

Finding entities within range X from a player should not take a whole lot of CPU, even if it's done often. If the problem is in 2D, then a simple quadtree should give you all you need. You probably want to manage each player connection in two steps: first, updating the objects that the player knows about Y times a second, and second, updating the set objects the player knows about, which can be done more seldom.

If you still want to scale your host up, then you can break visibility out from simulation, and run them on paired hosts. Our architecture does this -- in fact, it has some novel approaches to visiblity that makes it feasible to run events like a large concert or sports game, where there might be 40,000 spectators in a very small area. It's more work, of course.

If your project is a small hobby project, then I wouldn't worry so much about it. Send data within some distance of the user, and call it good.

Share this post


Link to post
Share on other sites
Anyone consider offloading traffic via V.A.S.T.? Seems to me you could have clients - server comm on major things (object interactions and coarse positions) and use V.A.S.T. for details (finer position updates, chatting, etc).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!