PDA

View Full Version : (Game) Server Architecture


AticAtac
09-13-2005, 04:52 AM
Hi,
i plan to code (just another) mmorpg-like game-server "just for fun".
I am wondering what kind of "techniques" have proven to be "good" for developing a server.
From browsing the web i found many game servers developed with PHP/MYSql.
What other "combinations" are there and worth to be tried ?
I prefer C++ as coding language. I know Other scriptable languages would be easier to start, but i dont mind/fear to start a c++ server using sockets, threads, etc.
Right now what i need are some ideas to start with.
One way came to my mind now is to use DirectPlay to code a server, but of course its not platform-independent. Platform-Independency isnt indeed a high priority here.

Any ideas, links, resources, sources, ... are Welcome !!!

awood
09-13-2005, 05:07 AM
It really depends on the protocol you wish to use: UDP or TCP. For a "just for fun" game-server, I recommend using (or at least starting out with) TCP. Since TCP is connection-oriented, meaning every user must establish a connection to the server before they begin sending the server all sorts of information. In the case of using TCP, you should look into the select() function, which will help manage multiple socket connections on the server.

dave_
09-14-2005, 02:29 AM
The choice to use TCP or UDP is not the biggest decision to be made for an MMO engine.
You have many layers, with the network transport being just one. You have big decisions to make about, persistence, scripting, patching, message routing, scalability, versioning, prediction etc.

Here's a few suggestions:

Perhaps you should look at ACE for the network framework. Not for beginners but very powerful.
http://www.cs.wustl.edu/~schmidt/ACE.html

There are a few game networking libraries out there of professional standard. I cant find the links but I vaguely remember names like net Z or something like that.

Edit: Heres a comparison http://www.gamedev.net/features/reviews/productreview.asp?productid=240


To make development easier I recommend a modular, run-time reloadable approach whether that be through scripting or dll's or similar. Trust me it will make things loads easier in the long term.


For persistence use some object-relational mapping library, you dont want to have to do it all yourself.

I recommend keeping your game objects as simple as possible on the engine side and then putting the weight in script.

Anyway thats enough of a rant

AticAtac
09-14-2005, 03:01 AM
Thx for the answers.

I guess one can break up the server in 2 main components:

1. network communications
2. persistent data management

From what i have found out, for network-communications there are these aletrnatives:

Low-Level: lots of programming
- use Sockets (TCP and UDP)
Hihg-Level: less programming
- DirectPlay (reliable and not reliable communication) -> platform-dependency
- Network-Libraries

as for persistent data manangement, i see more and more game-server using a SQL-Server (my sql, ms sql, ...). I am not sure if even all the object properties are stored in the db or not.

If i also understood correctly, its the server job do all the game-calculations (damage, moving, ...). I am not sure if the server is also responsible for collision-detection, if yes, that means that the server has to do 100x collision detections for e.g. 100 players (if they are all moving). I am not sure if this can be a serious performance issue.

I thought we could "collect" some information in this thread (even if many these issues have been discussed elsewhere).

roel
09-14-2005, 03:14 AM
It is just a trade-off where you decide to do things: server or client. The best thing would be doing everything server side, to prevent cheating, but this isn't really feasible because of server capactiy (bandwidth, computation power). Did you already read this: http://www.gamedev.net/reference/design/features/mmog/ ? Its title lacks the r and p of mmorpg, but that doesn't matter for now ;) it gives you at least a few items to consider.