Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: World data - theory  (Read 9385 times)

James

  • Full Member
  • ***
  • Posts: 108
World data - theory
« 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.
Logged

Acetone

  • Hero Member
  • *****
  • Posts: 963
    • Youtube channel
Re: World data - theory
« Reply #1 on: May 12, 2015, 02:53:30 am »

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.



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?
Logged

James

  • Full Member
  • ***
  • Posts: 108
Re: World data - theory
« Reply #2 on: May 12, 2015, 02:38:22 pm »

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.
Logged

Acetone

  • Hero Member
  • *****
  • Posts: 963
    • Youtube channel
Re: World data - theory
« Reply #3 on: May 12, 2015, 03:34:34 pm »

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.
« Last Edit: May 12, 2015, 03:58:35 pm by Acetone »
Logged

HiFlyer

  • Hero Member
  • *****
  • Posts: 1788
  • newbie
Re: World data - theory
« Reply #4 on: May 12, 2015, 04:27:42 pm »

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?
Logged
Spex: Intel Core i7 6700K @ 4.6GHz / 32.0GB G.SKILL TridentZ Series Dual-Channel Ram / ASUS STRIX GeForce GTX 1080 / Sound Blaster Z / Oculus Rift VR Headset / Klipsch® Promedia 2.1 Computer Speakers / ASUS ROG SWIFT PG279Q ‑ 27" IPS LED Monitor ‑ QHD / 2x Samsung SSD 850 EVO 500GB / Windows 10 Pro

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: World data - theory
« Reply #5 on: May 13, 2015, 12:45:21 am »

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.
Logged

Acetone

  • Hero Member
  • *****
  • Posts: 963
    • Youtube channel
Re: World data - theory
« Reply #6 on: May 13, 2015, 03:33:46 am »

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.
Logged