Day 10

Its been a while since I have added a post to the Condor Scenery Adventure, and I have been getting complaints that I was slacking off in my endeavors.  Seems like there are other Condorites who would like to stick their toes into the scenery waters, and are having the same problems I am ;-).

OK, so after talking to Dave Regula the last time, he advised me to become familiar with the ‘Terragen Method’ of scenery generation, and sent me three of his recent ‘world’ (.TGW) files for inspection.  Now this is somewhat akin to sending an iPad to an orangutan and asking for a detailed design critique, but since I was too embarrassed to admit that to Dave, I thanked him profusely and slinked off into the night.  After drinking a few (many) more beers, and contemplating my navel for a while, I finally found the courage to actually go back and look at the files.

I launched Terragen, clicked on ‘World File’, and navigated to where I had saved ‘Moriarty01.tgw’, and selected it.  When it opened, I saw the following screenshot.

Moriarty 'World' .TGW file opened in Terragen

Moriarty ‘World’ .TGW file opened in Terragen

The first thing I noticed was the Surface Map list didn’t look anything like I expected – instead of ‘forest’ and ‘deciduous trees’, I saw ‘Grass Land dry’, ‘Cactus’, and ‘Grass Land w/water’, apparently as a set of ‘child’ surfaces under ‘Planes’.  OK, so maybe the names are arbitrary, and only the hierarchy matters – children cover parents, but child surfaces don’t exist outside the boundaries set by the parent surface.  After dicking around with this for a while (and not making much progress), I happened to click on the ‘Open’ button above at the top of the ‘Terrain’ section, and saw that it was looking for a .TER file – hmm… Then I remembered that on a previous run at this, I had produced TER files for my Caesar Creek scenery, and decided to see what would happen if I opened one of them.  I navigated to ‘C:\Program Files\Condor\Landscapes\CaesarCreek\Working\Terragen’, and selected ‘0302.ter’ (this is the tile that contains my one and only airport), and lo and behold I got something that resembled my CCSC scenery in the preview window – interesting.  Then I went one step further and selected the ‘Grass Land dry’ surface and clicked on ‘Edit’, which brought up yet another dialog that I didn’t  understand (see the screenshot).

Moriarty TGW with CCSC tile, and 'Grass Land Dry' surface

Moriarty TGW with CCSC tile, and ‘Grass Land Dry’ surface

 

Now this is really cool – I think I might actually start to understand some of this stuff!  OK, the Preview in the ‘Landscape’ dialog shows the tile (0302.ter) being used, and the ‘Surface Layer’ dialog shows how that tile would be affected by the ‘Advanced Distribution’ selections Dave made for this layer.  With Dave’s settings, you can just about make out the north-south trending river valley on the left (west) side of the tile – neat.  Now to figure out how the Altitude and Slope Constraints produce that result…  If you look at the (mostly) white lines under ‘Altitude’ and ‘Slope’, you’ll see a tiny bit of black at the very bottom of the ‘Slope’ curve, and no black at all on the ‘Altitude’ curve.  I already figured out that white means that the surface will be visible in that area, and black means it won’t.  Looking at the checkboxes, it appears that Dave decided to show this dry grass color at all altitudes (hence the unchecked min/max boxes, and the solid white altitude line), and at all slopes except the very flattest ones (hence the tiny bit of black at the very bottom of the slope curve).  The result of this set of distribution constraints (rules) when applied to the CCSC 0302.ter image is shown in the thumbnail preview image.  Because the river valley has fairly steep sides, the color is shown over most of its area, but not as much up on top of the flat plateau.  To see if my understanding holds water, I decided to diddle the rules for ‘Grass Land Dry’ a bit and see if the changes match up with my expectations.  If I check the ‘Max Slope’ box, I should be able to add some black at the top of the slope curve as well as the bottom, and I should be able to restrict this surface to only those portions of the image with a specific range of slopes, i.e. just the steep edges of the river valley.  The next screenshot shows how this worked out.

 

Grass Land Dry after adjusting slope constraints

Grass Land Dry after adjusting slope constraints

Now you can see there is some black at the top of the Slope curve as well as the bottom, and the river valley is more starkly defined as the only place in the image with significant slope.  As it turned out, the ‘Max slope’ constraint really didn’t do anything – even the steepest parts of Ohio aren’t very steep!  Anyway, this exercise was probably what Dave was after when he suggested I look at his .TGW files, and it certainly does improve my understanding of the scenery design machinery, at least as far as Terragen-generated ones go.

Just to summarize what I just did; I took Dave’s Moriarty Terragen ‘World’ file describing various constraint rules for a set of surfaces to be applied to scenery tile images (.ter files) and mated it with a terrain tile from my CCSC scenery.  Now even I know that a coloring scheme customized for New Mexico high desert is probably going to look a little funny in low/flat/wet Ohio, but it still works!  Moreover, the labels in the Moriarty TGW file have absolutely nothing to do with the actual colors and constraints – they are just for us humans to help us remember what we were trying to do.  The only things that matter are the hierarchical order of the surfaces and whatever constraints make sense (obviously, slope-based constraints don’t mean a whole lot for Ohio, but they would for Moriarty).

Next, just for grins, I performed ‘Render Preview’ and ‘Render’ operations on 0302.ter, using the entire set of constraints, including my minor modifications to Grass Land Dry, and got the result shown in the following screenshot.  The river valley is clearly highlighted with the ‘Grass Land Dry’ brown, with the rest of the area a lighter shade (from the Cactus layer, I think).

CCSC tile 0302 rendered with Moriarty TGW rules

CCSC tile 0302 rendered with Moriarty TGW rules

Next, I saved the .BMP file that resulted from the render operation to C:\Program Files\Condor\Landscapes\Caesar Creek\Working\Terragen, and then launched Condor to see what happened – hmm, absolutely NOTHING! :-(.  Oh, wait, I forgot a step.  As mentioned earlier, the end product of this entire enterprise is the set of DDS files that Condor uses to display the scene out the canopy – and I forgot to regenerate them.  OK, I launched Landscape Editor, and selected the Caesar Creek scenery.  LE loaded up the textures, and I saw the following

Landscape Editor showing 0302 tile with modified Moriarty coloring

Landscape Editor showing 0302 tile with modified Moriarty coloring

 

Then in LE, I selected ‘File/Export to DDS’ and said no to ‘Export only missing DDS files’ so I would get a complete regeneration of the file set.  After this finished, I checked for new DDS files in the ‘C:\Program Files\Condor\Landscapes\CaesarCreek\Textures’ folder and found they now all had a current date stamp – yay!  Then I checked the result in Condor, and got the following screenshot.  The Moriarty coloring can clearly be seen, and it is also apparent that only the portions of the scenery with higher-than-normal slopes have the darker brown ‘Grass Land Dry’ color.

Caesar Creek scenery showing Moriarty-colored 0302 tile

Caesar Creek scenery showing Moriarty-colored 0302 tile

Summary (so far):

What I  learned from this session was that any Terragen ‘World’ (TGW) file can be applied to any set of scenery terrain (.TER) files, and that the TGW file embodies a set of rules that define the color of each pixel in a particular terrain segment (tile?).  The final color of a pixel is determined by considering the complete set of layer constraints, working under the philosophy that child layers can’t appear outside areas where their parents appear, but within those areas, child layers supersede parent ones.   For instance in the Moriarty ‘World’ (TGW) file, there are 5 child surfaces under the ‘Everything’ surface – Planes, Trees, Scree, Cliff, and Snow.  Because ‘Everything’ is shown everywhere, its 5 child surfaces are considered in reverse order when determining the color for a particular pixel; Snow takes precedence over Cliff, which takes precedence over Trees, etc.   If a pixel is located where all 5 sets of constraints apply, then it gets the ‘Snow’ color.  For areas where Snow, Cliff, Scree and Trees are all absent (their constraint sets prevent them from appearing), then the ‘Planes’ color applies, but the ‘Planes’ color is determined from a reverse order consideration of the child surfaces that make it up; i.e.  ‘Grass Land w/Water’ first, ‘Cactus’ second, and ‘Grass Land Dry’ last.  The ‘Render Preview’ and ‘Render’ buttons on the Rendering Control dialog show the effects of the surface layer constraints when applied to a particular .TER file.

After all this, I started to think it probably would have been lots easier if I had RTFM’d regarding Terragen before jumping into the deep end of the pool, so I decided to find and read the Terragen Classic documentation – FAIL!!  The ‘Help’ button on the Terragen window points me to http:://www.planetside.co.uk/terragen/guide – which unfortunately routed me right back to the Terragen home page.  Then I nosed around in the Terragen Classic support forum for a while, hoping to find a better link, but they all pointed to the same place, which apparently doesn’t exist anymore (if anyone out there has a copy of the Terragen Classic guide – I’d appreciate a pointer).  I did happen to stumble onto a set of Terragen tutorials (http://www.caroluk.org.uk/terratut/) which helped a bit – and even cleared up a big mystery for me.  While dicking around aimlessly in Terragen (before buying clues from David Regula), I tried clicking that big bold ‘Generate Terrain‘ button on the Landscape dialog, only to get some random pattern in the preview window.  Via the tutorial I found out that is, in fact, what happens – this feature generates a small random terrain section with water, grassland, and mountains, presumably so you can test whatever surface constraints you are working with – neat!

Now that I understand a wee bit more about Terragen and its applicability to Condor scenery design, I hope to figure out what to do about trees, rivers, roads, and all that stuff. I may even make another try at understanding the Condor Scenery Toolkit checklist, now that I have some clue what I’m doing ;-).

Frank (TA)

Series Navigation