I'm dabbling with making a local airport, and I am wondering about the terrain flattening needed to have the runway on the surface. Is there any guidance anywhere on how to do that?
Someone once asked me that question in private messages. So I'll just copy the little guide I wrote for that person here. Disclaimer: The question was about a moon base, so this guide use the moon. But it works the exact same way for the Earth. Just put the .flt file in the Earth textures folder and use Earth coordinates.
----------------
What I use to make the terrain flat in my bases is the Terrain Flattening available with D3D9. It's pro is that it is very easy and fast to use. The cons is that it only work on D3D9 (so anyone using the regular orbiter.exe won't be able to use it) AND it is very imprecise. Good to make a patch of terrain flat, but nothing else. Creating a crater or a chain of mountains would be very,
very hard or even impossible depending on the scale.
But anyway, how do we use it? Well, it is very simple.
#1: ou must ensure D3D9 Terrain Flattening is indeed enabled. If it is already, then you can skip this step.
To do this, open orbiter_ng.exe and go in the
Visual Effects tab. Ensure
"Surface elevation, using" is checked and set to
"linear interpolation".
![1716125907824.png 1716125907824.png](https://cdn.orbiter-forum.com/data/attachments/38/38185-26f25a22c0806ddc4edcc9f5aac2ad19.jpg)
Then, go to the
Video tab and click on the "Advanced" button.
![1716125925198.png 1716125925198.png](https://cdn.orbiter-forum.com/data/attachments/38/38186-f37768f328c014a683b1218be23cf858.jpg)
In the Advanced Setup menu, make sure "Enable terrain flattening" is checked. I think "Tile Archive" at the top need to be at "Cache & Archive". Both are already set up correctly by default, but in case it doesn't work, come check this and change it.
![1716125936633.png 1716125936633.png](https://cdn.orbiter-forum.com/data/attachments/38/38187-a1c7c7a5e6dbedc5a037c6fb0308498d.jpg)
#2: Okay, it is now setup. So, this time, you need to go in your
Textures folder. Then, you need to open the folder of the planet/moon where you want to flatten some terrain (in this case:
Textures/Moon).
Once that's done, you will end up with a window showing at least three folders:
Archive,
Elev_mod and
Surf. What you need to do is create a fourth folder named
Flat.
![1716125948257.png 1716125948257.png](https://cdn.orbiter-forum.com/data/attachments/38/38188-8cdc922f25f04a12779d4ea23941b67b.jpg)
It's in this folder that the magic is done. So, open it. Then, you need to create a new file inside. It can be named whatever you want, as long as it end up with the extension ".flt". For clarity's sake, name it "MoonbaseAlpha.flt" or something like that.
Once you created the file, open it with notepad, or any other program you can write code with.
#3: Now it is time to flatten the terrain. But first, what is inside a .flt file? Well, it is simply some basic lines of codes. Here is what's inside the Quebec.flt file I use for my Quebec City addon:
![1716125970280.png 1716125970280.png](https://cdn.orbiter-forum.com/data/attachments/38/38189-cf55141852eb620013f5c4da2c076e2d.jpg)
It look complex at first view, but it is very simple. What this file does is allow you to turn a section of terrain flat by creating a new shape in the terrain. Either a rectangle or an ellipse.
[Shape] [Altitude] [Longitude] [Latitude] [Length] [Width] [Angle] [Fusion]
- Shape: This is the shape of the area you want to flatten. It can either be a rectangle (RECT) or an ellipse (ELLIPSE).
- Altitude: This is the height/altitude the terrain will be.
- Longitude: Longitude of the centre point of the terrain.
- Latitude: Latitude of centre point the terrain.
- Length: This is the length of the shape of the flattened terrain.
- Width: This is the width of the shape of the flattened terrain.
- Angle: This is the angle the shape of the flattened terrain is pointed at. (It is not the heading, but something based on the equator, or something.)
- Fusion: This is essentially the "rate of fusion" of the edited terrain with the surrounding regular terrain. Or simply: how steep the blending of the terrain is.
Now that we know what value does exactly, it's time to write our first line! And, to do that, we need to know where our base will be, for it will be the centre point of our flattened terrain. Here I used the side of a cliff as an exaggerated example:
![1716126044133.png 1716126044133.png](https://cdn.orbiter-forum.com/data/attachments/38/38190-a80548e5d9972e93f73099b8bc0353ef.jpg)
With the scenario editor, we can see our exact coordinates. So, we put them in our line, making it this:
[Shape] [Altitude] -30.3299 48.8852 [Length] [Width] [Angle] [Fusion]
Then, the shape. That all depend on the terrain you are trying to turn flat. I will use an ellipse for this example.
ELLIPSE [Altitude] -30.3299 48.8852 [Length] [Width] [Angle] [Fusion]
The altitude is unknown. But that can be found by playing with the value a bit. But, for now, I will put a very exaggerated value of 5000, which should bring our flat terrain way higher than it should be. But, it will give us a good view of which sections of the terrain is affected by our .flt file.
ELLIPSE 5000 -30.3299 48.8852 [Length] [Width] [Angle] [Fusion]
The length and the width all depend on how big you want your base to be. For this one, I will put 1000 on both.
ELLIPSE 5000 -30.3299 48.8852 1000 1000 [Angle] [Fusion]
The angle is rarely used. I personally only used it to turn single runways flat. Since this isn't needed here, I will simply put 0.
ELLIPSE 5000 -30.3299 48.8852 1000 1000 0
[Fusion]
And, finally, the fusion value. This is another value that might need some playing with. But, usually, I put it at around 15.
And here, we have our completed line!
ELLIPSE 5000 -30.3299 48.8852 1000 1000 0
15
Let's put it in the file and load the game to see what it does.
![1716126068216.png 1716126068216.png](https://cdn.orbiter-forum.com/data/attachments/38/38191-627015beba1f6bd578596bf9efcd672f.jpg)
The terrain is flat! And it is way too high! But that's fine, as it was done on purpose. We can see which section of the terrain we turned flat that way. Now, it's time to bring it back down. Let's switch it the altitude value to 100.
![1716126086365.png 1716126086365.png](https://cdn.orbiter-forum.com/data/attachments/38/38192-ea07ae357185a8be80e1f67883fb8f2e.jpg)
Still a bit too high. But, I quite like the idea of having a flat, elevated platform. So, why not change the fusion value instead! Here, I changed it to 50. Here, the cliff is less steep.
![1716126100131.png 1716126100131.png](https://cdn.orbiter-forum.com/data/attachments/38/38193-be8f70f3565541e50b2475151b06a70f.jpg)
And that's done! Now you know how to done some very basic and simple terrain flattening! I hope this helps you! Don't hesitate to mess around with the values a bit to see what it can do!
![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)