TS3 Tutorials Archive

Archives of The Sims 3 Tutorials

    Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted


    Posts : 220
    Join date : 2010-12-04

    Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted

    Post  Archivist on Fri Jun 20, 2014 2:14 am

    Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted

    by aminovas, EA Caw Forum

    aminovas wrote:

    Procedural generation is the process of using algorithms to generate landscapes with programs that mimic natural landscape processes.  We can use such programs to generate height maps for CAW.  

    Hand sculpting and painting terrain in CAW can be incredibly rewarding and produce lovely results, but sometimes we want our landscapes to look more realistic.  In my profession I worked with a lot of real-world Digital Elevation Data, and so naturally I got my start in CAW importing that data.  There is a great tutorial for that here.  However, there are lots of limitations with simply working with DEM data, DEM software, and a graphics editor to generate your height map.  It can be quite tricky getting that data to look they way you want it to in CAW, especially with getting the scale right and dealing with smoothing, and more often than not, we want to generate our own shapes for use in CAW.  

    With Procedural Generation (PG for short?) we can either generate new terrain algorithmically OR we can apply algorithms that mimic weathering or other distortions to our existing terrain.  It can be used for transformations both subtle and dramatic.  We are only limited by the restrictions of the CAW height map.  

    The purposes of this thread is to introduce Procedural Terrain Generation to creators by…
    1. Indexing resources such as software and tutorials
    2. Sharing what we know about how to use that software, through tips and mini-tutorials
    3. Sharing our strategies for using PG output with CAW
    4. Height map and texture map sharing
    5. Post pictures of our results

    Posts : 220
    Join date : 2010-12-04

    Re: Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted

    Post  Archivist on Fri Jun 20, 2014 2:21 am

    aminovas wrote:

    Introduction, Glossary, and Index

    ((UNDER CONSTRUCTION!  Help me fill this out by adding suggestions))

    Introduction on Wikipedia http://en.wikipedia.org/wiki/Procedural_generation

    Procedural Generation software:
    Free for non-commercial or under $100
    World Machine - Intro version is free (512x512 resolution)
    Unreal Development Kit (UDK) - free for non-commercial
    Bryce 3D

    Note: Any 3D meshing program can be used to make terrain, and many of these programs have procedural generation capabilities.  All of the above listed Free programs can be used to translate meshes into PNG height maps.  

    World Machine specific tutorials (but may be useful for other software)

          aaronrogers8i3 introduces his workflow and his project files here.

    My introduction is here, and it links to  an intro TMD file.  This is specifically for using a pre-existing height map to add erosional features to it.   This demo has a height map originally sculpted by Rflong7, but you can use any height map.  Aaron has done his own transformations on the height map and has uploaded the CAW files, TMD file, and output here: mediafire.com ?8a4n1jy578utlbg
    mirror: mediafire.com download/tw9gt5t8n37cf2x/RflongHeightmap.zip

    Last edited by Archiver on Fri Jun 20, 2014 3:42 am; edited 2 times in total

    Posts : 220
    Join date : 2010-12-04

    Re: Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted

    Post  Archivist on Fri Jun 20, 2014 2:26 am

    aminovas wrote:

    This is a Demo of how World Machine can be used to alter an existing height map exported from CAW.

    Disclaimer: World Machine is very intuitive once you get how it works, but quite a hard program to explain. Please be patient with yourself and with those who are trying to explain how to use it!  We are doing our best Wink  I am a very visual-spatial person and do not do well with sequences, which is why I take to this program like a duck to water, but have been struggling since I started this thread to translate that understanding to the page.  This program requires a willingness to experiment, and if you do that you will find your own ways to use it that suites your needs.  It just takes a little patience.    And  please give feedback so I can clarify what is confusing!  I plan on adding more pictures to better explain the window and the buttons.  In the meantime, please read the text and I apologize for anything that is confusing.

    You can download the TMD file from my dropbox here
    mirror:  http://www.mediafire.com/download/kdkh1kdklya09m4/CAW_World_Machine_Intro.zip
    TMD files are the basic project files for World Machine.  After you install World Machine, find the World Machine Documents Folder.  You can add this TMD file to the examples folder, and find other example files there.  I have included the lovely height map by Rflong7 that will be the starting point for this project.  You can use your own height map.  I would encourage any of you world builders to take a height map you are already using in a world and run it through this simple process, just to get a sense of how it works on a familiar landscape.  Maybe you will like the results and want to import the new height map into your existing project.  Using this TMD can be as simple as doing the first and last step of this tutorial, without bothering to play with the different devices, just focusing on Input and Output.  
    Additionally, AaaronRogers has uploaded his own project file for this same height map, and also the CAW files.
    Here: mediafire.com download/8a4n1jy578utlbg/RflongHeightmap.zip
    Mirror: mediafire.com download/tw9gt5t8n37cf2x/RflongHeightmap.zip
    I recommend checking it out in comparison to this TMD file to see how he achieved different results.  My demo is to show how subtle the changes can be, and Aaron's project shows how the landscape can be sculpted more dramatically, but still be recognizable.


    1. Open the Project file.  Double click the TMD file to open it or after opening World Machine, choose File --> Open.  World Machine opens in Devices View.

    (Note:  See the nice big boxes with words in them that you see in the intro default project that opens when you open World Machine, such as "Terrain Creation", "Filters" and "Output":  They don't do anything except organize your space.  In the TMD file I have created, I have made boxes with text in to help walk you through the devices.  They don't really do anything to the terrain.  You can move the devices off of them by clicking and dragging the devices.  You can delete these boxes by clicking on them and selecting "Delete" from the Edit Menu.  You can make your own by looking under the "Tools menu" and finding the Group tool there.  You double click them to change the text and color.  I'm telling you about groups so that you know from the start not to worry about them having a function, as I worried about that when I first started.  You can just ignore them if they are not useful to you.)

    2.  Familiarize Yourself with the World Machine Screen. You can hover your cursor over any button and a the name of a device or menu should pop up.  The picture below shows World Machine as it opens up in Devices View (F5). The other two views that are most important as I understand it are Layout View(F6) and 3D view (F8 ).  You can navigate between these windows by using the function keys or by clicking the buttons that correspond to them (look above where it says "Favorites" and "Macros").  In this demo we are not working with Layout View.  Also, note the green button next to the views buttons.  That is for building (rendering) your devices.  3D view will display whatever device you have highlighted, so you can compare before and afters  😉

    3.  Load your input file:  In this project, I've started with a file input device. In my TMD file it is already placed on the screen for you. To add your own or to add a new kind of terrain generator, find the Devices Menu called Generators, and find the disc icon within it. Click it, and place the generator on your devices view.) Double click the file input to bring up a menu for to loading your PNG file.  Any size PNG file that you already have working in CAW will work.  In this case, I have loaded a 2048x2048 PNG file graciously provided by Rflong.  (Also, please note the "World Extents and Resolution" button.  It is the Mountain icon above the Tools Devices menu.  I recommend working through your landscape in 512x512 resolution, just to make it faster on your computer.  As you get closer to finishing, you can up the resolution to better fine-tune what you are doing.)  

    Cool landscape!

    4. Next, choose from Filters, Natural, or Generators Menus to add effects to your terrain. Devices from other categories may also be useful, but most of the processes you will be using are in these three categories. In my TMD file, I have chosen another device from the generators menu, called "Advanced Perlin".  This can be used to generate terrain without any other file inputs (without an existing height map).  In this case we are using it to add interesting details or noise to an existing height map.  To connect your File Input to the Advance Perlin generator you click the top box on the right side of the device File Input Device.  It will give you a chord.  You drag that over to the input box on the left side of the Advanced Perlin device.  If you make a mistake and connect it somewhere you don't want, you can right-click the chord and delete it.  This has already been done for you in the provided TMD file.

    (Note: The boxes on the left of each device are for inputs.  The boxes to the right are outputs.  The bottom box on the device is for inputing a mask to limit how the device is applied.  Note that you can see what each box does by hovering over it.  The terrain map flows from one device to the next.  A single output can go to many devices, but each input box only gets one input.  We are focusing on the "Heightfield" inputs and outputs.)

    Double click the device to alter how it works.  Be prepared to experiement to get the effect you want!  You can lower "persistence" to reduce how much the device effects your terrain.  You can also input a mask (more on that another time).  Remember, also, that if you want a more extremem change, you may want to give you terrain a slight elevation boost in order to give the erosion more "rock" to work with.  

    As you can see below (if you can see with this resolution) it is a subtle change, but it will look much stronger in CAW (if not, we just come back into WM and make it stronger Wink )  The only thing I have changed in the Advanced Perlin device menu from its defaults is I have lowered the persistence.  

    5. Next, you might want to try out erosion.  Under "Natural", choose the Erosion device.  Again, connect the output from your last device (the Advanced Perlin) to the input of your new device, the Erosion device.  Double click the Erosion Device to change the settings.  There are a lot of  options!  You can leave everything on the default, or play around.  In this case, all I've done is change the erosion method to "channeled erosion" (top left of the drop down menu). In the TMD file, this has all been done for you.  

    After accepting the Erosion settings, again, I click the green button to render the device, make sure the device is selected, and then switch into 3D view to see it by pressing F8.  

    I've tried to zoom in a bit more on this shot to show the channeling this has added:

    And this may be all you want to do in World Machine!  (This is more or less the treatment I am giving to King's Point, but it doesn't have much height to it to show off what can be done, so this terrain really works beautifully, I think)  

    6. The file is now ready to export.  Connect your Erosion output to a "Height Output" device (already done for you in the TMD file).  Double click it to set the output path. If you are using a full (paid) version of World Machine, you can change your World Resolution to a larger resolution such as 1024x1024 or 2048x2048.  In that case, change it before you export it, and you will need to allow it to build before you export (it will ask you to let it build the heigh map when you choose "write to disk").  If you don't have a paid version, you are limited to 512x512. You can change the size of the PNG in Photoshop or Gimp or any other image editing program that works with PNGs.  You may want to run it through a gaussian blur and/or sharpening to compensate for the resizing.    

    We can now go into CAW and look at the height maps.  Here is the original, with autopaint:

    And here is the after:  

    You can see the height has changed somewhat overall, and there are now channels carved into the terrain.  

    Last edited by Archiver on Fri Jun 20, 2014 3:55 am; edited 2 times in total

    Posts : 220
    Join date : 2010-12-04

    Re: Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted

    Post  Archivist on Fri Jun 20, 2014 3:15 am

    aaronrogers8i3 wrote:

    Here's a quick explanation of shaping a map with world machine. I suck at explaining things but here goes! Laughing

    Before starting your map make sure you set the world size to 2048x2048.

    First thing I add is a layout generator device which allows me to make a basic shape of my map. I can also use this later to add mountains.
    The pic below shows what devices I use. There aren't very many.

    Then I add an advanced perlin device. This adds bumps to the map to make it look more like real terrain. Setting the Feature Scale higher makes less of an impact on your layout generator shape. I'd also recommend playing with its values to see what you can come up with.

    I then add another Layout Generator. This will allows you to make flatter surfaces and add really shape the world is you want.

    Next is the Erosion device. This is perhaps the most important as it will really make your map look realistic. Again, just play with its settings too see what you like.

    There are also many devices to the Filter tab such as curves and terraces. They are very useful but I didn't use them on my current map.

    By experimenting with settings you'll be able to make any world you desire.

    I'll try to make a quick tutorial on Distant Terrains and Masks soon as well.

    aaronrogers8i3 wrote:

    Sure thing! I still have my world machine file for Crystal Bay/Bridgewood.

    Bridgewood: CoastMapTMD
    mediafire.com download/8d4zoi12rb7u10k/CoastMapTMD.tmd
    mirror: mediafire.com download/set8h8rf34wwclq/CoastMapTMD.tmd

    And an old heightmapped island CAW file.
    mediafire.com download/rglc2mvb7jlvc82/Santa_Rosa_Caw.zip
    mirror: mediafire.com download/nammadrox0adya4/Santa_Rosa_Caw.zip

    I'll be starting my third world Strangetown soon so I'll have lots of pics of world machine.Very Happy

    Sponsored content

    Re: Procedural Generation of Terrain Discussion and Tips: Two Tutorials Posted

    Post  Sponsored content

      Current date/time is Wed Feb 20, 2019 11:15 pm