*.TER - Terrain Mesh File (Elevation Grid) Specifications

Learn to make aircraft, maps and more with all of the tools. All the tutorials you will ever need are located here!
NOTE THAT HACKING THE MAIN YSFLIGHT .EXE IS FORBIDDEN
Post Reply
User avatar
Flake
Staff
Staff
Posts: 4121
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR600RR. Shit I mean Boeing F/A-18A.
Location: Newcastle, Australia
OS: Windows 10 (x64)
Has thanked: 752 times
Been thanked: 1022 times

*.TER - Terrain Mesh File (Elevation Grid) Specifications

Post by Flake » Sat Jun 17, 2017 7:48 am

The lines of a TerrainMesh (ElevationGrid) file are structured like so:

TerrMesh * 1
  1. Initialise. Just like a Surf line initaliser.
NBL (X) (Y) * 1
  1. NumberOfNodesOn...
  2. XAxis
  3. YAxis
TMS (X) (Y) * 1
  1. TerrainLengthInMetersFor...
  2. XAxis
  3. YAxis
BLO 0 R 1 64 128 0 1 64 128 0 * TotalNumberOfNodes
  1. Block(Node?)...
  2. HeightInMeters
  3. R|N(R=Triangles Flipped, N=Triangles Normal)
  4. 0|1(0=Invisible Face, 1=Visible Face) Red Green Blue [PrimaryColor?]
  5. 0|1(0=Invisible Face, 1=Visible Face) Red Green Blue [SecondaryColor?]
Looks to me this is where the color gradation takes place, meaning one could do some nifty color gradation tricks with some notepad manipulation. I'm very sure a stock map (CRESCENT_ISLAND or MATSUSHIMA?) has some snow on the peaks of the grid and this should be how it is done.

END * 1
  1. Declare the terrain file closed and complete.
Forgive me if there is already a write up on this (did decaff do one?)

I plan to replace grigors grid tool over the coming week by adapting Png2Srf/LifesABeach, So I've written this up to help!

People are struggling with this programs compatability so it would be nice to have another option.
Image
(At this stage, I get more enjoyment coding for this game then playing it. Weird right?)

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: *.TER - Terrain Mesh File (Elevation Grid) Specifications

Post by u2fly » Sat Jun 17, 2017 8:14 pm

Thank you for this, @Flake! I will add this info in YSFlight Handbook, and hope that this specification could help me in development of YSFS 2.x add-on for Blender 2.78.
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“Spending #NewYearsEve w/ brave #Ukrainian Marines at a forward combat outpost - we stand w/ them in their fight against #Putin's aggression”
http://pic.twitter.com/vkz0gdozVV
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
waspe414
Veteran
Veteran
Posts: 1105
Joined: Thu Feb 10, 2011 9:35 pm
Favorite Aircraft: CH-136 Kiowa
Location: Canada
Has thanked: 88 times
Been thanked: 96 times

Re: *.TER - Terrain Mesh File (Elevation Grid) Specifications

Post by waspe414 » Sat Jun 17, 2017 10:02 pm

viewtopic.php?f=147&t=815&p=8367#p8367
I thought I did a more comprehensive writeup on the whole filetype somewhere, but I can't find it anymore. [Link is now below]
Last edited by waspe414 on Fri Jul 14, 2017 8:16 pm, edited 1 time in total.
I stole your turnip. Now you must come and defend your honour. ~ Hank Green
Image
"Talon is a giant flower. That is all."

User avatar
Flake
Staff
Staff
Posts: 4121
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR600RR. Shit I mean Boeing F/A-18A.
Location: Newcastle, Australia
OS: Windows 10 (x64)
Has thanked: 752 times
Been thanked: 1022 times

Re: *.TER - Terrain Mesh File (Elevation Grid) Specifications

Post by Flake » Sat Jun 17, 2017 11:36 pm

waspe414 wrote:
Sat Jun 17, 2017 10:02 pm
Awesome thanks for that I now know what the 1/0 before the colors does (0 Invisible Face, 1 Visible...)
Image
(At this stage, I get more enjoyment coding for this game then playing it. Weird right?)

User avatar
waspe414
Veteran
Veteran
Posts: 1105
Joined: Thu Feb 10, 2011 9:35 pm
Favorite Aircraft: CH-136 Kiowa
Location: Canada
Has thanked: 88 times
Been thanked: 96 times

Re: *.TER - Terrain Mesh File (Elevation Grid) Specifications

Post by waspe414 » Sun Jun 18, 2017 12:54 am

The colours in each BLO line are just for that specific triangle. Editing individual triangle colours will just make that triangle that colour. See the ship in Helgoland for an example. The gradient is calculated for each face when it's generated in Scenedit. Gradient colours are stored in the CBE line, after what I assume are the gradient extents (whatever they are, the first two numbers are 0 and 80% of the highest node) though changing them does nothing.

A point, it's possible to generate the gradient for a given node arrangement, then change the nodes. The gradient will stay the same until recalculated. You can put gradiated spots of colour in places other than mountain tops as a result.

EDIT: I found the comprehensive writeup: viewtopic.php?f=147&t=7758. viewtopic.php?f=285&t=7753 is also useful.
I stole your turnip. Now you must come and defend your honour. ~ Hank Green
Image
"Talon is a giant flower. That is all."

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest