- Home /
Custom World Coordinate system? Changing Space.World?
Hi, Im making an mmo and would like the server to allow a very vast world while the clients will still use the single precision float.
Is it possible to create your own custom world coordinates? and if so how do you change from what I assume is Space.World. How do you change it into your own custom system, maybe using Decimal or a double?
Thanks.
Answer by Southgrove · Nov 29, 2012 at 04:31 PM
Maybe i'm not getting the point here.. but..
if you have a "chunk coordinate" and a "character coordinate" so a character has the position chunkCoordinate(1, 3) and charCoordinate(12.4, 123,1) it would be (in the world) at (1012.4, 3123.1).
If you did that, characters could be reeeally far off and still have really good float precision (0..999).
You could create a "local universe" where 0,0 is in the center of the active chunk and include all neighbouring chunks (and their characters) and that should do it, right?
Was wondering how you got this implemented. I can't seem to wrap my head around how this would work, unless i build my own custom networking. Thanks!!!
but how would you define that character coordinate, when all you have to work with is world space, how could you base it off of the active chunk? I mean, wouldn't the 'chunk coordinate' ultimately still come down to a world coordinate that approximates its location, if the chunk itself is distant from world origin.
Answer by Paulius-Liekis · Nov 28, 2012 at 04:11 PM
You can not change the precision. But you can shift center of the world to your desired place, this way you will need smaller precision.
So there is no way to change the base coordinate system and have everything direct to your system? Why not?
Also I knew about that, which is why I told you Im using it for an $$anonymous$$$$anonymous$$O server, where there is no perception of character because there are hundreds of them. So there is no way to change the world around the character... This is why I need to create my own coordinate system or it will be impossible to create a seamless $$anonymous$$$$anonymous$$O.
Shifting/offsetting the world around the current camera position should work for pretty much any world size. "Just" create the world in big chunks and offset those.
You could use a "Point2" struct (int x, y) for each chunk, make each chunk 1000x1000 units and have each integer in your offset point represent 1000 units. Voila.. Instant ginormous world.
Why cant anyone understand that a server has no perspective, so it has no point to shift the world around the person? What if someone is 2000 meters in the other direction from someone else?
it will not work, this i must change the precision of the world coordinates.
Does anyone know how to do this at all?