Outerra forum
Outerra Engine => Ideas & Suggestions & Questions => Topic started by: James on May 12, 2015, 01:59:28 am
-
I'm unaware of the current method for storing and reading data, but I had an idea that could be effective.
Data could be stored relative to each coordinate, and could be structured to only read the data necessary for a particular area. Chunks directly nearby would call everything, further but nearby chunks would still render terrain data and maybe even static objects, and chunks which are on the other side of the world wouldn't be called whatsoever.
Maybe a structure similar to this:
- 0, 0 ( this would be 0 longitude and 0 latitude)
- terrain data
- static objects
- dynamic objects
- players
- 0, 1
- same as before
- 1, 0
- you get the point
If the player is at coordinates (0.5, 0.5), then it'd call chunks, for example: [(-3, -3), (5, 5)]
When an object moves, it can detect the coordinates change from 0.999 to 1, and transfer the data from one chunk to the next.
I wanted to share this thought for you to elaborate on, and sorry if the idea sucked. The only reason I don't believe something like this is being used now, is because spawning tons of objects on the complete opposite side of the planet seems to lag me still.
-
It's pretty much how the engine works, except these pieces of terrain are called tiles. If you want to see a bit more how they works, try this :
Go to your eng.cfg (./username/outerra/eng.cfg). Search for the "debug_keys" line and set the value to "true".
Now, press "n" (there are multiple modes of tiles display, you can press then again "n" to cycle between these or go back to normal mode. You can see that bigger tiles are replaced by more detailed one when you get closer to the ground. At some point, the detailed ae not generated by the dataset but procedurally, that's why you can see the details being refined at close distance to the ground :)
You can also freeze the rendering with Alt + f, and you will see that Outerra does a pretty good job here.
(http://i.imgur.com/qgpQV7a.jpg)
Now, for your lag problem with objects, it's really weird because if you are not in the close vicinity of a tile, objects located on it should not be rendered. What is happening exactly?
-
I have to spawn A LOT of vehicles for the lag to stick when I go to the other side of the world. Then again, this might just be the physics calculating and not actual rendering.
I thought, or it appears to me, Outerra is iterating through each object and chunk/tile (maybe not the chunks, because it is well optimized) and then determining if it should render and/or what level of detail to render. If this is the case, then it'd be much more practical to only queue the data necessary for how close it is to the player.
-
I have to spawn A LOT of vehicles for the lag to stick when I go to the other side of the world. Then again, this might just be the physics calculating and not actual rendering.
I thought, or it appears to me, Outerra is iterating through each object and chunk/tile (maybe not the chunks, because it is well optimized) and then determining if it should render and/or what level of detail to render. If this is the case, then it'd be much more practical to only queue the data necessary for how close it is to the player.
It's entirely possible that vehicles physics are still calculated no matter where you are, I've already noticed that if you go far away, they keep moving (but you get some errors pop in the console since then engine don't find terrain under the vehicle).
We need to summon Cameni or Angrypig for this question. It's pretty straightforward, we just need a lamb, an axe, a pool of lava, and a box of Pringles©.
Edit: You are right, after spawning a huge number of vehicles the framerate start to drop everywhere, in fact when you open the model tool (Alt+7), the packages were still loaded even if I was on the other side of the planet. I guess active vehicles (with physics calculated) are loaded no matter where you are.
-
One thing I noticed about the "Talkeetna stutter" was that once it starts, you can go to the other side of the planet and the slight hitching remains until you completely reboot the sim. Could that be related to this? Do large numbers of houses remain loaded even when you go someplace else?
-
Yes they remain loaded and traversed to check if they need be rendered, they aren't culled yet with terrain. That will be fixed, but active vehicles request terrain under them even if you are on the other side, to keep moving.
-
One thing I noticed about the "Talkeetna stutter" was that once it starts, you can go to the other side of the planet and the slight hitching remains until you completely reboot the sim. Could that be related to this? Do large numbers of houses remain loaded even when you go someplace else?
At one point, there was a bug and static vehicles (placed as objects) were loaded as normal vehicles. There were around 20-30 planes/cars around Talkeetna, so the framerate was hit as soon as all of these were loaded/simulated, no matter where you were. The bug was fixed since then.
From my experience static objects are only loaded when they are larger than the size of the parameter defined in you eng.cfg ("min_obj_size", in px). So if you choose a low value for this one (lower than 1), these will be loaded even extremely far away from you.