Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: Road Data - XML?  (Read 6264 times)

NooDleS

  • Newbie
  • Posts: 4
  • newbie
Road Data - XML?
« on: January 24, 2014, 04:38:21 pm »

I don't really know what section to put this, but this one seems the most accurate at present.

I've been playing around with the engine and it is for lack of a more apt word, epic. It is what every simulation game should start with. As a massive Arma and Op Flash fan, this is what I thought Bohemia Interactive were always wanting to develop.

Amazement aside, it is time I post on the forums.

I have seen a request for vehicle models thread on the forums and this one is along the same lines, but different  ;)

Is there a method at all or is there somebody with more intelligence in the matter than myself to be able to utilize kml data or an overlay of google maps or openstreetview etc to be able to accurately draw/paint roads onto the world?

My thought process is, for the UK at first but the principle stands across the globe:

Produce textures for country style of motorway/dual carriageway/single carriageways & lanes
Draw KML routes with attributes for road type, i.e. dual carriageway or lane
Import routes into Outerra and assign relevant textures based on attributes.

This way you could get the bulk of the major routes mapped ready and all you would have to do is fast forward through the scenes to check.

You could then, to borrow a phrase, 'rinse and repeat' it with regards to railways, power lines and rivers.

Then the infrastructure is taken care of.

Smack me if you want to, I dream big.
« Last Edit: February 13, 2014, 01:40:28 pm by NooDleS »
Logged

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #1 on: January 24, 2014, 06:43:22 pm »

I looked into it, this might be possible. So nobody slap him yet.

As a disclaimer, I just want to say that I don't know how to script in Outerra yet. If someone can point me to some references, I'll be more than happy to learn though.

Now, what I found out is that OpenStreetMap.org does let you download road data directly from their site. They also include data for buildings and ATMs and other such things. On the first pass through, we probably won't use that stuff. So, when you get data from OSM, they give it to you in the form of an XML file. The file includes data such as latitude and longitude. It also includes street names and the types of street the street actually is (highway, living streets, walkways). OSM also includes footpaths and trails that seem like they would be really cool to import alongside the other roads. I'm not sure how bridges work though... although I guess we can figure that out later.

So all in all, if Outerra has a way in which you can generate roads from scripts, this is definitely possible. 

Also, OSM lets you download every single road in the world. Which equates to about 32 GB. So compression or servers of some sort are going to be needed. Unless of course you don't mind downloading 32 GB of road data.
Logged
Oh boy!

GodotWaits

  • Member
  • **
  • Posts: 57
  • What say you?
Re: Road Data - KML?
« Reply #2 on: January 24, 2014, 08:31:33 pm »

This would be a great feature! I'm oblivious to scripting and modelling, but I'l love to give it a go and learn, help develop as I can. I'd also be grateful if anyone can point me the direction to gathering this knowledge!

Paid for the alpha earlier, absolutely amazing stuff.  ;D
Logged
Well then, until our next meeting.

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #3 on: January 25, 2014, 12:52:10 am »

Does anybody know if we can create roads from scripts yet, and is it possible to read a file from a script?
Logged
Oh boy!

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Road Data - KML?
« Reply #4 on: January 25, 2014, 01:04:14 am »

Here's another thread with discussion about how it works currently & plans: http://forum.outerra.com/index.php?topic=1163.0
Logged

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #5 on: January 25, 2014, 12:56:09 pm »

Okay, I just read the thread. Two questions. Is there any way that I can access the road API by just having the game, or do I need to have a decompiled version to access it, then recompile? Which would probably be a bit more of a pain then we'd want to mess with.

Question 2. What is the binary data's format? I was looking at it last night but couldn't really make much sense of it. The way I was thinking it would work, would be taking all of OSM's road data from their planet build and converting it all into road data that's readable for the game. That way we don't have to query OSM every single time someone wants data. If we do that and they get too many queries, they could tell us to stop. Then, every so often we could download their planet data again to update the planet's road system, or we could just take their change data every time they come out with a new planet build and update it for the game. Either way would work, but taking the changes and deleting certain roads from the game seems like it could be problematic. So rebuilding the whole planet for the game would probably work better.

I might not be understanding everything correctly though. So just tell me if I'm not up to speed.
Logged
Oh boy!

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #6 on: January 26, 2014, 01:01:25 am »

okay, I'm not completely done. However, I've been screwing around with the roads.bix filetype and this is everything that I have decoded thus far. I converted it to binary first...

Quote
red = road type

yellow = road markings

pink = road width

green = boarder width

orange = location data

purple = transitional data

blue = elevation

teal = slant

Brown = width interpolation / tangents

01100101 00100001 01001010 00000110 10101100 01010000 01100111 00001010 00111000 00000110 00000101 00001000 00000000 00000000 00001101 10000000
01100101 00100001 01001010 00000110 10101100 01010000 01100111 00001010 00111000 00000110 00000101 00001000 00000000 00000000 00001000 10000000
01110010 00100110 01001010 00000110 10000101 01010010 01100111 00001010 00111111 00000110 00000101 00001000 01111110 00000000 00001100 10000000
01110010 00100110 01001010 00000110 10000101 01010010 01100111 00001010 00111111 00000110 00000101 00001000 01111110 00000000 00001101 10000000
10110001 00000000 00000000 00000000 01010010 01000110 00110000 00110010

I have also seemed to uncover the fact that there are 32 bytes to a waypoint. after 32 bytes, the next waypoint data starts. There are no delimiters. However, data seems to repeat itself. I'm not sure why that is. I haven't yet found out where the location data is stored yet either. Another thing, the elevation byte is overall elevation. So if you wanted to make a road that was at the same elevation as the land, you would have to somehow retrieve the elevation for that part of the road. I'm not sure how this would be done for a large scale operation like this. I guess we could take the raw elevation data the world was created from. This also means that we only have 8 bits of resolution for road elevation. Which doesn't seem like it would be enough if you used it in the Himalayas, what do I know though? I have also only done a road that has only 2 waypoints for testing. I'm assuming the next 32 bytes just gets added on though.
Logged
Oh boy!

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Road Data - KML?
« Reply #7 on: January 26, 2014, 01:58:45 am »

There's little point in trying to disassemble the format. First, it's going to change once in a while. Second, it depends on other local parameters of the terrain, as you noticed. The elevation, for example, is relative to the base height of terrain block where it resides, so to import a road you have to know it.

These data are accessed directly by the GPU, and there are several assumptions about it, for example the roads are cut to blocks that are in our internal projection. The neighbor blocks repeat road segments in a way that allows for seamless spline interpolation, etc.

The import API will work like this: for given layer you define its geographic tiling scheme, for example that it tiles the longitude/latitude to 1° chunks. Then as the compiler traverses the tiles, it queries the plugin to give it data for a given tile. The plugin calls back the API functions that will the roads by adding individual way points with all their parameters. These are cached, and the vector data compiler adds road segments to all internal terrain blocks that are affected by the provided roads.

The reason why the API isn't there yet is that the internal format isn't flexible enough yet, and needs to change first and support custom road profiles and marking schemes.
Logged

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #8 on: January 26, 2014, 02:26:49 am »

Quote
Second, it depends on other local parameters of the terrain, as you noticed.

Yup, that's where I pretty much lost all hope and decided to at least show what I did.

Quote
These are cached, and the vector data compiler adds road segments to all internal terrain blocks that are affected by the provided roads.

Does this mean the roads will be put straight onto the terrain, or will the terrain still be unaffected as it is now and the roads will simply act as they do now? If that makes any sense.
Logged
Oh boy!

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Road Data - KML?
« Reply #9 on: January 26, 2014, 02:47:09 am »

The roads will be always in separate files, applied as a vector data. There will be also multiple independent layers, OSM data usually cannot be mixed with other data for legal reasons.
Logged

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #10 on: January 26, 2014, 03:40:04 am »

Ah, okay then. Also, one more question. Will the API be for standalone programs, or in game scripting. So, for example, if I wanted to start importing all of the road data from my town into the game, would I have to start up Outerra and use some sort of in game scripting system or would I have a standalone program that can just churn through files?
Logged
Oh boy!

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Road Data - KML?
« Reply #11 on: January 26, 2014, 05:10:08 am »

Current importer is built-in into OT because it uses GPU for remapping and compression, and shares lots of code with the engine. It requires terrain block data to be generated too, for proper referencing. Also, with vector data you should be able to get a preview after the import.
Logged

XNiiNJA

  • Newbie
  • Posts: 7
  • Master Commander
Re: Road Data - KML?
« Reply #12 on: January 26, 2014, 10:20:12 pm »

Okay, that all sounds well and dandy. Do you possibly know around when the API is going to be available for use in the importer?
Logged
Oh boy!