Author |
The new zone system.... |
Faustus Marshal Palestar
Joined: May 29, 2001 Posts: 2748 From: Austin, Texas
| Posted: 2003-02-05 12:55  
I'm going to start trying to post more information on what I'm doing, the design, and the thought process behind some of the more technical programming issues that I've been dealing with. I figured the "Zone" system is a good place to start, hope you enjoy.
The new UniverseServer required adding the concept of zones to the game.
A zone, in a nutshell, is a boxed area of space, which is used to sub-divide the entire universe into managable chunks. Firstly, we generate the zones by creating a box for the entire universe (5,000,000 gu accross for example), then we subdivide until we reach a reasonable size for a zone (100,000 gu). This is all going to be configurable in the map editor FYI.
Zones provide several benefits...
- Collision can only occure between objects in the same zone, also each zone is handled by only 1 process who is considering the authority for that zone when it is locked. This all basically ammounts to distributed computing, which is just seperating the work out over several machines/processes.
- All objects in a zone, are relative to the zones position... which helps to fix the current floating poinit percision issues in the game. If you have noticed the jittering of your ship when you are far out from the center of a star system, thats the floating point percision problem. Zones are going to be somewhere around 100,000 gu accross normally, ofcourse this size is configurable and can change, but it should never go so large as to cause jitter in the math, around 250,000.0f we start seeing the jitter.
- LOAD BALANCING... this is the holy grail of MMOG programming... basically, the new system will split a zone in half when the number of objects exceeds a configured number. Once a zone is split, and the number in that zone and the zone it was split from (it's parent) decrease below 1/2 the configured number, then we merge the zones back into one zone again. This system is nice and simple, which I love as a programmer. However, I think I still need to place limits on the number of splits that can occur... I don't want zones that are only 500gu in size, that might cause more problems.
Known issues....
I've only got one known issue that I'm not sure needs to be addressed or not, beta testing will determine the next step. The issue, is when very large objects are half-way in one zone, but since their center-point still resides in a different zone, collision detection only occurs in that zone. This means, a gas giant, that mostly resides in zone X for example... but almost half of the planet is in zone Y.... a ship in zone Y could fly through the planet without crashing, so long as they are careful and don't cross the boundary into zone X
Zone splitting could make this bug even worse
Anyway, I've got a couple of ideals on how to fix the above issue... but I'm going to wait for the code to go beta and see just how bad this issue turns out to be before making any code changes... as I think they are going to be complex.
-Richard
_________________
|