When designing a new mission, it's important to understand that the GEOGRAPHY of the mission is different from the TERRAIN style, and that missions may differ in objectives and in terrain, but the underlying geography is not going to change very much.
This is because our multi-player missions must all place airfields, mountains, and lakes in the same exact locations for all players. Obviously, if you are trying to hide behind a mountain so your opponent can't find you, it's essential that the mountain be positioned in the exact same location for all players.
If the terrain were generated with random features on each participating computer, then mountains and other geographic features would be in different places for everybody. One player might try to hide behind a mountain that his opponent would not see. One player might fly in a straight line through clear skies, but his opponent might see him disappear into the middle of a mountain or hill.
To facilitate this need for synchronizing the geography, LAC uses what is known as a geographic "height map". Upon startup of every important mission, LAC looks for a special file, known as "DefaultHeightMap.LAC". LAC expects to find this file in your new, hidden ".LAC" folder.
That file tells LAC about the altitudes of all geographic features at every East/West and North/South location of every mission.
Because all of LAC's important missions all use the same "DefaultHeightMap.LAC" file, the mountain and valley depths are ALWAYS in the same positions in all missions! The missions can LOOK dramatically different from one another, but the underlying topography is identical. The differences in appearance are caused by "flooding" the landscape with oceans or other watery areas like lakes, or by covering mountains and valleys with pine trees or desert sand. (Some of the terrain logic can also "erode" slopes a bit, but the heights of peaks and depths of valleys aren't changed very much even if the slope angles are adjusted by this erosion.)
"Blake's Mission" is slightly different: When that mission reads the "DefaultHeightMap.LAC" file, it squashes all of the altitudes down to just 22% of their usual height, and then it elevates everything up high enough to ensure that the flat terrain beneath airfields is at the proper altitude to hold up the runways. If you want to write a mission with "squashed" geography, you could do the same. Take a look at the "land.cpp" file, where the "Landscape::genSurface()" function detects Blake's mission. Here is the affected code snippet:
As you can see, that code is only executed for MissionNumber 17, which is Blake's mission. Instead of using every "h" settting as it is read from the DefaultHeightMap.LAC file, it multiplies the value by 0.22, and then it adds 38000. This results in "squashing" the mountain and valley heights to just 22% of normal, while bringing the average altitude up to normal.
You can do the same for your own missions. We've found that if you multiply by 0.022289 or less, the resulting terrain is as flat as a billiard table. Multiplying by 0.022290, on the other hand, leaves the mountains just big enough to have their tips visible as very small hilltops sticking slightly above the billiard-table flat, remaining landscape.
Because LAC uses single-precision math, it cannot effectively differentiate the small differences between mountains multiplied by 0.022289 or by 0.022290, so you don't have as much subtle control as you might like, but you can still use this method to create a fully flat or an "almost flat with some pointy little hills" landscape.
Last edit: bbosen 2023-02-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the "DefaultHeightMap.LAC" file is not present, then LAC will generate new terrain at random, which will not match the usual setups.
Because LAC's missions hard-code the locations of airfields, funny things can happen if the terrain is generated at random: Airfields might be under water, or floating in the air above a deep valley, or sticking out of the side of a mountain.
It would be difficult to create a mission with dramatically different geography because you would need to distribute some new height map file, with a different name, like "HeightMapForFredsMission.LAC" or something.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When designing a new mission, it's important to understand that the GEOGRAPHY of the mission is different from the TERRAIN style, and that missions may differ in objectives and in terrain, but the underlying geography is not going to change very much.
This is because our multi-player missions must all place airfields, mountains, and lakes in the same exact locations for all players. Obviously, if you are trying to hide behind a mountain so your opponent can't find you, it's essential that the mountain be positioned in the exact same location for all players.
If the terrain were generated with random features on each participating computer, then mountains and other geographic features would be in different places for everybody. One player might try to hide behind a mountain that his opponent would not see. One player might fly in a straight line through clear skies, but his opponent might see him disappear into the middle of a mountain or hill.
To facilitate this need for synchronizing the geography, LAC uses what is known as a geographic "height map". Upon startup of every important mission, LAC looks for a special file, known as "DefaultHeightMap.LAC". LAC expects to find this file in your new, hidden ".LAC" folder.
That file tells LAC about the altitudes of all geographic features at every East/West and North/South location of every mission.
Because all of LAC's important missions all use the same "DefaultHeightMap.LAC" file, the mountain and valley depths are ALWAYS in the same positions in all missions! The missions can LOOK dramatically different from one another, but the underlying topography is identical. The differences in appearance are caused by "flooding" the landscape with oceans or other watery areas like lakes, or by covering mountains and valleys with pine trees or desert sand. (Some of the terrain logic can also "erode" slopes a bit, but the heights of peaks and depths of valleys aren't changed very much even if the slope angles are adjusted by this erosion.)
"Blake's Mission" is slightly different: When that mission reads the "DefaultHeightMap.LAC" file, it squashes all of the altitudes down to just 22% of their usual height, and then it elevates everything up high enough to ensure that the flat terrain beneath airfields is at the proper altitude to hold up the runways. If you want to write a mission with "squashed" geography, you could do the same. Take a look at the "land.cpp" file, where the "Landscape::genSurface()" function detects Blake's mission. Here is the affected code snippet:
As you can see, that code is only executed for MissionNumber 17, which is Blake's mission. Instead of using every "h" settting as it is read from the DefaultHeightMap.LAC file, it multiplies the value by 0.22, and then it adds 38000. This results in "squashing" the mountain and valley heights to just 22% of normal, while bringing the average altitude up to normal.
You can do the same for your own missions. We've found that if you multiply by 0.022289 or less, the resulting terrain is as flat as a billiard table. Multiplying by 0.022290, on the other hand, leaves the mountains just big enough to have their tips visible as very small hilltops sticking slightly above the billiard-table flat, remaining landscape.
Because LAC uses single-precision math, it cannot effectively differentiate the small differences between mountains multiplied by 0.022289 or by 0.022290, so you don't have as much subtle control as you might like, but you can still use this method to create a fully flat or an "almost flat with some pointy little hills" landscape.
Last edit: bbosen 2023-02-17
If the "DefaultHeightMap.LAC" file is not present, then LAC will generate new terrain at random, which will not match the usual setups.
Because LAC's missions hard-code the locations of airfields, funny things can happen if the terrain is generated at random: Airfields might be under water, or floating in the air above a deep valley, or sticking out of the side of a mountain.
It would be difficult to create a mission with dramatically different geography because you would need to distribute some new height map file, with a different name, like "HeightMapForFredsMission.LAC" or something.