Distributed server architecture for load balancing

Started by
50 comments, last by _winterdyne_ 18 years, 6 months ago
Quote:Original post by _winterdyne_
True, you end up with slower behaviour in both threads, but at least file access won't stall your app. That said, you can end up with synchronisation issues unless your prefetching algorithm is good.


The file thread sleeps much of the time (waiting for file completions - wakeup by system). My current version has a queue of read/write requests from the game server process and is only doing one read/write at a time (I may change this to simultaneous requests if on seperate disks). I also have to investigate how well OSs handles queueing requests (winchester controllers were supposed to optimize head seeks on multiple requests, but Im not sure that the OSs do this effectively these days.....)



Quote:
Therefore all listening objects are transmitted to directly by the areas that are relevant to them. This presents an issue when you have a large number of mobile listening objects. Crossing each boundary causes a minimum of 3 releases and 3 acquisitions for LOD3 definitions alone. The mobile listener then has to be packed and transferred to the appropriate new area 'owning' server.


There are many areas (world grid is upto 4k x 4k areas) but most transitions happen with the destination area being loaded into the same server (this isnt a MORPG is for a much lower expected client count simulation). The handoff to a different area server passes a minimal token (proxy) that references the AInode(Active NPC) or Client(Player) ---- most simplex NPCs (proecssed on server iteself) dont move around alot and rarely would cross server machines.
Also with the size of the areas, transitions happen only about every 30 seconds.



Quote:
I'm starting to think about network capacity with all this - bearing in mind the streaming terrain data as well - you might need more than one network thread and a dual-network setup a local network on a fast switch and an external network (behind fast, smart router) with a high capacity pipe. You're going to need some big bucks to build and host this I think.


Again this isnt a commercial game, rather a low seat count simulation intended for LAN. Im counting on 1000Mbps LAN cards (cheap now -- possibly 2 for the serevr boxes if needed). A typical 'area' is a 64kB block, sent only once. All moving objects will have a stream of position updates (I pack multiple events in the packets and do delta compression). Scenery deformation is patches to te mesh.

The most critical resource will be the CPU for the AI and the mutli core CPUs will help a bit, but they wont keep increasing (unless Intels planned 16 core Chips happen).



Quote:
I guess this would depend on your world design. If certain objects have a low 'activity radius' for want of a better term, if they're centred in an area, you're effectively culling them from the rest of your world.


Im going for high detail (Im sick of these games with 'pretty' mesh terrain, but are deserts otherwise) so there will be alot of local objects with simple behavior which dont react to things too far away from themselves (thus wont need to react to events outside of their own area).



Quote:
With your structure as above, a heavy load in an area will drag down everything that's visible to it - simply by virtue that each area is responsible for streaming its terrain. This could get really choppy - you might want to start cutting down frequency of updates for remote terrains.




Again, the terrain is generally sent once and modifications are sent as events (and mods usually dont happen continuously). All transfers are via the 1000Mbps
LAN pipe. All update events are piped out to the heavyweight AI on seperate machines all the time.



Quote:
Batching off A* processing is quite a good idea. The process in question can be made highly specialised. Might not cope too well with an environment that can potentially change moveable paths though. If a terrain gets a steep-sided crater in it, would the routefinders update their maps (and in-progress route calculations) accordingly? I have this problem with nodemaps being rotated as a result of rotation of a mobile POR, subject to external gravity - a ship listing at 50' has a very different set of moveable routes to the ship when it's level. Fun!


The A* server would have to get streamed the terrain mods and object position update events the same way the clients/AI nodes, and be maintain the same area surrounding the object it serves (sounds like a good use for the second core on a CPU which could share the same area data in memory). My simulation is more 2D oriented for pathfinding , but if you have a need for 3D navigation (and for octtree rebuilding) then the A* will probably require a seperate CPU.



Quote:
Yikes. I have to say I salute your bravery in attempting to implement this at all, never mind in an online game. A reactive, planning AI is still something that's missing from a lot of single player FPS games. I'd love to hear how you get on with this.



It was my original reason for the 3D and terrain simulation in the first place -- a proper problem space where the behavioral AI can operate AND visualization of whats happening.
Complex AI like this will probably not be possible for MMORPGs (its requires the power of a CPU for each player on the server end), but I am exploreing mechanisms that could still be used as half measures to improve the current games (more reactive objects, semi-intelligent NPCs with more general behavior, better tools to allow player creation of behaviors, template mechanisms to simplify script writing)





Advertisement
Quote:
The file thread sleeps much of the time (waiting for file completions - wakeup by system). My current version has a queue of read/write requests from the game server process and is only doing one read/write at a time (I may change this to simultaneous requests if on seperate disks). I also have to investigate how well OSs handles queueing requests (winchester controllers were supposed to optimize head seeks on multiple requests, but Im not sure that the OSs do this effectively these days.....)


I meant slower behaviour during an access (obviously). I've not heard of any head-seek optimisations in any mainstream modern OSs to be honest, not that I've dug for the information. Perhaps some of the heavyweight server-designed *nix OSs do this - might be worth looking into.

Quote:
There are many areas (world grid is upto 4k x 4k areas) but most transitions happen with the destination area being loaded into the same server (this isnt a MORPG is for a much lower expected client count simulation). The handoff to a different area server passes a minimal token (proxy) that references the AInode(Active NPC) or Client(Player) ---- most simplex NPCs (proecssed on server iteself) dont move around alot and rarely would cross server machines.
Also with the size of the areas, transitions happen only about every 30 seconds.


I see, so a server holds many areas, and you have a number of servers. I take it your master server to governs distribution of grid members (server machines) to all server processes (AI and area simulation) in the grid. Not that dissimilar (sp?) to my hierarchy where a given server can have slave server processes under it.

Quote:
Again this isnt a commercial game, rather a low seat count simulation intended for LAN. Im counting on 1000Mbps LAN cards (cheap now -- possibly 2 for the serevr boxes if needed). A typical 'area' is a 64kB block, sent only once. All moving objects will have a stream of position updates (I pack multiple events in the packets and do delta compression). Scenery deformation is patches to te mesh.


I was going to suggest distribution of the deforming event. It's required for deformations that occur over an area boundary and thus need to be distributed to other area servers.

Quote:
Im going for high detail (Im sick of these games with 'pretty' mesh terrain, but are deserts otherwise) so there will be alot of local objects with simple behavior which dont react to things too far away from themselves (thus wont need to react to events outside of their own area).


Yeah, I'm thinking on including certain client-side simulations to make things a little more lively- non-critical critters like birds that play no part in the server simulation but should react to the passing of a 'real' entity by flapping away a distance can be offloaded to the clients.

Quote:
The A* server would have to get streamed the terrain mods and object position update events the same way the clients/AI nodes, and be maintain the same area surrounding the object it serves (sounds like a good use for the second core on a CPU which could share the same area data in memory). My simulation is more 2D oriented for pathfinding , but if you have a need for 3D navigation (and for octtree rebuilding) then the A* will probably require a seperate CPU.


Given the deformable terrain- you're not going to allow 'tunnelling' then? Could it be possible that entities could get trapped in deep pits? Tunelling in terms of both a scenegraph and relevance graph would require dynamic calculation of appropriate 'portals' to assist in culling. An interesting problem.

Quote:
It was my original reason for the 3D and terrain simulation in the first place -- a proper problem space where the behavioral AI can operate AND visualization of whats happening.
Complex AI like this will probably not be possible for MMORPGs (its requires the power of a CPU for each player on the server end), but I am exploreing mechanisms that could still be used as half measures to improve the current games (more reactive objects, semi-intelligent NPCs with more general behavior, better tools to allow player creation of behaviors, template mechanisms to simplify script writing)


I'd love to hear how you get on with this - reactive MMOs are really the next step for the genre in my opinion.


Winterdyne Solutions Ltd is recruiting - this thread for details!

This topic is closed to new replies.

Advertisement