Sign in to follow this  

Coordinates in online games (big landscapes)

This topic is 3580 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 interested what coordinate systems are used in modern online games (WoW, LineAge2, SecondLife etc). I'm not interested in how objects are processed... I want to understand what technique those games use: 1. A big world where every position is a float vector. But if the object has coords like (50000, 50000) I lose accuracy (objects begin to jump). 2. A big world with the fixed point (4-byte integer), where I have an accuracy 1mm. 3. A big world where everything is splitted by locations. I don't get it: a. Maybe the server sends all the bounding locations and their coords, and then every position looks like (unsigned short location, float x, float y, float z), where x, y, z is in "location's" space. b. Or maybe server transform every position to every client to it's location frame... So I need your help - what techniques are being used in online games, and I need to now which one uses what (like "Wow uses the following technique") - because I listed the techniques I know...

Share this post


Link to post
Share on other sites
Its not an MMOPG but it was one of the first games to have a large seamless world. You can move from the starting area to the end without a single loading screen, therefore they had a big problem of accuracy. I suggest you read the article, it's probably the best ive read with regards to your problem.

Share this post


Link to post
Share on other sites
Your 2. and 3. are both viable solutions. The sector approach does however have a couple of disadvantages though:

- by definition of course it means having to divide your world up somehow into arbitrary zones
- depending on how you do this, some operations become more difficult, for example calculating the distance between objects in different sectors, adding offsets onto positions that move to another sector, and so on

I like the simplicity and predictability of using fixed point integers. Tom Forsyth discusses this in his blog too.

Share this post


Link to post
Share on other sites
Well the sector approach is a pretty common one since you usually have some kind of spatial hierarchy so it seems logical to use the same thing for positioning. As Tom mentions in his blog it causes problems with long distances, instead of just having a single number with precision errors you have multiple numbers with the same errors multiplied together and the end result is cumulative error, it gets bad.

We have an octree like system for world sectors to simplify loading parts of the world as the player moves. Since it already exists my friend wanted to use it for world positioning (rendering/physics/ai/etc use their own hierarchies anyways, I don't like scene graphs). The way I see it is to use fixed precision for world positions and convert to relative (camera/area) for rendering/audio/physics as needed. With 0.1mm precision it's still far more than we're ever going to need (~3.4e+24km^2).

Share this post


Link to post
Share on other sites
He means what kind of hardware you plan to run the project on.

Double precision floats should work nicely, unless you have serious performance concerns and want to use hardware that can only do single precision floats efficiently. But then you might be better off with 32 bit integers anyways.

I've once been working on a space flight simulation and there double precision can be insufficient if you want both, precision of less than a meter for rendezvous maneuvers and at the same time have distances across half the solar system. But for a single world double precision should be good enough.

Others have suggested this also, fixed point integers. If your programming language supports 64 bit integers, they should give you a big range and precision, and if not you can have 32 bit for the integer part and another 32 bit fractional part in two variables, this should still work nicely.

Soon there will be 64 bit hardware used more widespread, so I'd set my bet on 64 bit integers if I need a big world that cannot be sectored for the one reason or other.

Why is double precision double headache for you?

Share this post


Link to post
Share on other sites
I don't want to run any project... I just want to know what game uses what technique...

Yes, for the single player double floats are ok. But in every MMO we have big landscapes, where I can move to 500 kilometers from origin, and get a very small acuracy.

I don't want to hear any advice for project - I don't have any project and only want to hear sentances: "Wow uses bla-bla-bla, LineAge uses bla-bla-bla"...

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
I don't want to hear any advice for project - I don't have any project and only want to hear sentances: "Wow uses bla-bla-bla, LineAge uses bla-bla-bla"...
You segment the world and a location that has 4 variables.

Zone,X,Y,Z

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
I just want to write my graduate work... And I need correct examples...

I asked about real examples about WoW, LineAge... But "You segment the world and a location that has 4 variables." - did the author read something in this topic?
Lineage 2 maps are large blocks so I'd assume 3a type solution and as for WoW:
Quote:
Original post by marius1930
Well in the case of wow your position should be in the houndreds at most, everything is split into preloaded zones.
That's as real as you're going to get (aside from the dungeon siege article) because we don't know (and those that do probably won't/can't tell you). If you're writing your graduate work on "how <insert mmorpg> here" you're in the wrong place, the only thing we can give you are ideas/assumptions how they might work.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
Ok, where can I get this information if it's a wrong place?
Reverse engineer the games? That's a sure way to get information on how the client handles the world, if you want to know how the server handles them you need to ask the developers who most likely won't tell you jack shit. You could also take a look at l2jserver for how Lineage 2 handles it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
Ok, where can I get this information if it's a wrong place?
You can't get the information from anywhere. The source code to these games is private, and no one can tell you for sure, no matter WHERE you go.

You can try e-mailing Blizzard and NCSoft and asking them. But I doubt you will get very far. You shouldn't try to write a paper about other people's trade secrets.

Second Life is one giant land mass too. They released their code a long time ago. You will mostl likley find that the 1 giant land mass is only a graphical illusion and that the world is split up into tiny zones. Each zone has their own local x,y,z coordinate system, and you switch over seamlessly into the next one as you pass the boundaries. If they expand to 5000 in each axis, then x,y-5000 becomes x,y,+5000. No biggy.

When dealing with coordinates of the world as a whole, you just need a zone,x,y,z coordinate.

Share this post


Link to post
Share on other sites
Ever heard about the existence of private Servers?

Just search for "mangos wow" if you're looking for a WoW server.

BTW: WoW is split up in different maps, isn't it?
So it will most likely use something like: map, x, y, z

Share this post


Link to post
Share on other sites
The trick is to place the camera or player at 0,0 at all times, and move the world around him.

Thus, things that are far away may appear to pop, but because they are so far away you shouldn't see the popping (as in 1-2 pixels on the screen of popping).

floats are 32 bit, double floats are 64 and long double is 96.

It really depends on how big of a world you are making, and how far you can see.

But the trick is keep player at 0,0, for 2 reasons:

1)Prevents popping of objects
2)Prevents you from popping when trying to move. Having your coords at 2 mill x and 2 mill y will make your movements eratic (using float), and anything around you, but if your always at 0,0, it's very precise and so is everything around you.

3) IF floats are not sufficient (far away objects are still popping and noticeable, move to doubles) but you could have a performance hit.





Share this post


Link to post
Share on other sites
Quote:
Original post by ViperG
The trick is to place the camera or player at 0,0 at all times, and move the world around him.

Thus, things that are far away may appear to pop, but because they are so far away you shouldn't see the popping (as in 1-2 pixels on the screen of popping).


That's no good for multi player games where you need to store position precisely over a large area. The damage is already done before you transform everything to 0,0.

Share this post


Link to post
Share on other sites

This topic is 3580 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this