Jump to content

Server architecture for a space ORPG


fkrauthan

Recommended Posts

Hi,

I just looking for good ideas for a space ORPG server architecture. My plan is to create a 2D space game where you can control your spaceship in realtime like you can in freelancer. The problem is now how can i handle Sectors. Is there any good idea that a user can fly from one sector to another without a jump gate just flying (also handling ships from another sector and also fights on such border). Where every sector has its own Server. If it's possible how can i handle border fighst and stuff like that. Or is it not possible?

Thanks for your answers,

fkrauthan

Link to comment
Share on other sites

Inter-server communication most likely, if there's going to be fighting across the border. You'd have players connect to a proxy that abstracts away the sector servers. When they move to a new sector the proxy starts routing their packets to the new server. If there's a fight across the border the 2 game servers either communicate directly or through the proxy since the player's state would be stored on the sector server they are in.

Mangos is very monolithically designed with everything more or less in the same box, which makes it very easy to put in new features and play with it, but there's no support for multiple servers backing a single realm. If you want to design a well-planned, load-balanced server system, you shouldn't look at mangos as an example.

Link to comment
Share on other sites

Slicing zone in half, to be handled on more than one server is very tricky task.

In proxy based (1 routing node + N gameservers) solution you can set up general functions to do 'border-handling'

Object::MoveToServer(Server* newServer) function that allows 'moving' any ingame object (ship/planet/bullet) from server to server.

Servers should have continuing coordinate system (each coordinate is unique).

Server::SendPacketToField(x,y,radius,packet) shouldn't request all objects in some part of other server to send packets, it should call same function on remote server so that it can handle it as call from it's own object.

World (universe) should be planned or generated in such way, that sector borders are not close (closer than visibility/packet broadcast radius) to 'hotspots' in order to minimize cross-server events.

Bullets/lasers/rockets should have TTL (even in no-gravity environment) to reduce server jumps for each bullet that misses it's intended target.

Link to comment
Share on other sites

EVE Online has a good solution for this problem.

Player A at planet 1 has no way of interacting with a player B at planet 2 - they are much too far apart. Thus, they are placed in separate 'bubbles', a and b respectively.

A warps to within interaction distance of B, and A is removed from a added to b.

Now that they are in the same bubble, they can interact (within the limits of sensor/weapon range)

Your only issue with this system will be the real-time control aspect. In EVE Online, players can only warp to landmarks (planets, stations, other established structures) or players. In this way, they limit the possible number of bubbles.

For your purposes, I'm sure you can come up with a good way to allow a player to 'peel away' from a large bubble as they get further from it.

In EVE Online, multiple bubbles run on one server.

For larger fights (hundreds of players), a single bubble is placed by itself on a better/bigger server. In fact, CCP encourages players to inform CCP of their large-scale attack plans so that hardware can be allocated to the proper time/place in advance.

Overall, it's a simple and flexible space-partitioning scheme.

Link to comment
Share on other sites

I don't think you need to think of Sectors as a way to divide players into groups. They're just an arbitrary region of space, and the boundaries between them don't need to have any meaning to the combat/movement engine.

An example relating it to terms many people are familiar with:

In WoW, each map is split into zones. Zones affect the game design in a big way - each is themed (jungle vs desert etc), each has a level range, each has several quest hubs , etc.

But to the server core, a zone means nothing - it has no impact on combat or movement, isn't used to group players, etc.

I think your Sectors are roughly equivalent to WoW's zones - arbitrary regions of space which are useful to players, but nothing more.

You will have to figure out how to transfer a player from one bubble to another on the fly - maybe Patman's suggestion of a proxy would work, but it will bring its own challenges (there are a lot of architectures, each has good and bad aspects)

Also, maybe try asking/looking at other communities (like gamedev.net) - it won't hurt to get ideas from a broader audience than just us ;)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use