About Store Forum Documentation Contact



Post Reply 
Few noob questions about large world, precision, worldToArea and multiplayer
Author Message
Glebastik Offline
Member

Post: #1
Few noob questions about large world, precision, worldToArea and multiplayer
Hello there!

I've been playing around the EE for a couple of days. So far, I like everything, but some questions have appeared. I will inform in advance that I'm not strong at programming generally and at C++ in particular, so please don't kick me too hard and better help to develop smile (seriously, with active participation, royalties are guaranteed)

I'm trying to develop a kind of train simulator. No game engine is suitable for this (except Unigine but it is very expensive). The biggest advantage of EE is world streaming support "from the box", so here I am. I need a really huge world to be able to travel hundreds of kilometers by train. I know about the floating point pricision problem and trying to solve it. In other engines I would do a nested coordinates system, where the whole world is divided by tiles which have its own coordinate system. So the position of any object in the world could be represented as "tileX, tileY, x, y, z". Is EE capable of it?

I would also like to know more about areaToWorld and worldToArea conversions. Is this a kind of world origin shifting? Will it cause any issues in multiplayer?

Thanks in advance.
01-28-2020 11:41 AM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #2
RE: Few noob questions about large world, precision, worldToArea and multiplayer
Heya and welcome to the engine !

So to answer your question about world origin shifting, no, it is not included out of the box in EE and the worldtoarea and areatoworld is just a helper function that gives you back a translation from area pos to world pos and vice versa, meaning if you want your area pos you can do wolrdtoarea(wolrdpos) and it will give you your area pos. ( This just uses the area size ).

The world streaming is a good way to load and unload part of the map automatically, you also have the possibility to do it manually, but streaming might work for you out of the box.

One of the issue i believe lies with physX that doesn't do well after with floating point precision and you might find the same issue as the other engines.
That said there is no map limitation as long as you can load it pfft

I hope i answered correctly, im sure greg will correct me if im wrong smile
(This post was last modified: 01-29-2020 04:05 AM by RedcrowProd.)
01-29-2020 12:04 AM
Find all posts by this user Quote this message in a reply
Glebastik Offline
Member

Post: #3
RE: Few noob questions about large world, precision, worldToArea and multiplayer
But is there any way to "explain" to the engine to count (or how it should be called correctly) coordinates not from the world origin, but relatively to current area, given the location of that area?

Don't know how to accessibly explain...
For example, I have an object located at the area 4576 -12984 and its coordinates relatively to this area are, let's say, -32.19, 4.85, 86.03. And the engine should get its coordinates as "4576, -12984; -32.19, 4.85, 86.03" but not as "585695.81‬, 4.85, -1661865.97‬". I researched an Open Rails' (another train simulator) source code, as far as my knowledge allowed, and looks like it divides the world coordinates by the size of a tile (it is 2048 in OR) and get tile position with object position relatively to this tile. As far as I understand, Open Rails is not experiencing any floating point precision problem without using doubles, it stores tile position in integers and operates with small floats.

I've attached the .cs file here (Open Rails is written on C#) to make my explanation even clearer. I can try to insert this into the EE but I'm afraid to break something smile As I already said, I'm not very strong in programming.


Attached File(s)
.zip  Coordinates.zip (Size: 3.02 KB / Downloads: 2)
01-29-2020 05:58 PM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #4
RE: Few noob questions about large world, precision, worldToArea and multiplayer
It comes down to architecture design
-that one might be very well designed, using smaller scale to avoid crossing area too fast and lowering the information per tiles ( thus possibly lowering detail a bit )
-they could run without physics there for limiting greatly the outside the engine issue that could arose and because physics is somewhat more demanding than other things, and if you follow only a designed path you might not need any
-they could do some smooth looping of world to avoid issue ( therefor doing some smooth loading and placement in the background )
They might do all of the above
You will find many problem when doing projects outside of the box, the way i look at it when something come up is finding the ways to go around that issue and pick the one that has the least drawbacks

Like zervox mentioned, try it and see where it takes you, this engine is as good as any, the community tho is rather small compared to other engine out there, but we all try to help when times allows, tho we dont do work for others and you have to come up with the cases smile

Hope that helped
01-29-2020 09:19 PM
Find all posts by this user Quote this message in a reply
Post Reply