Monday, July 16, 2012

Creating Terrains with POVRay



In this blog I will describe how to make some terrains with POVRay like those shown in the above image.  This is a simple way to make some great looking terrain maps for your campaign.  In order to do this you will need to get POVRay and install it.

The process takes two steps.

  1. Create a gray scale height map of the surface where white represents high and black represents low.
  2. Use the gray scale map to render a terrain surface.
Step 1. I will start out with a simple example and gradually make it more complex.  The first step will be to use the POVRay pattern bozo to create the surface.  Bozo is like a smoothly varying random surface.  An example of this is given by the following POVRay code:


camera {location <0,10,0> look_at <0,0,0>}

light_source {<0,100,0> rgb 1 shadowless}

plane {y, -1.0 pigment {bozo color_map {[0.00 color rgb <0,0,0>] [1.00 color rgb <1,1,1>]}}}


This code should produce an image something like the following.  I used the +FN option on the render to make the file a png graphic type file since POVRay does not do jpg.
I will explain the code briefly.  The first line generates a camera that is at a certain position (x,y,z) coordinates and is looking at a certain point in space.
The second line puts a light source at a certain location in space.
The third line makes a flat plane and colors it according to the bozo pattern.  The color map goes from black at values of 0 to white at values of 1.  rgb represents the color based on values of red, green, and blue going from 0-1.  For more info read the manual.

Step 2.  I will use this image to make a height field or terrain surface.

camera {location <0,2,.5>  look_at <0,0,0> angle 60}
light_source { <-2,7,2> color rgb 1}
global_settings { ambient_light rgb 1.5 }
background { color rgb 1 }

height_field {
    png "gray_terrain.png"
    smooth
    texture {pigment{rgb .5} finish { ambient 0.225 diffuse 0.75 crand 0.01975}} 
    translate <-.5, .1, -.5>
    scale <1, .5, 1>   
    rotate <0,0,0>
  }
The next code is used to generate the surface.  It should look something like the following at this point.
>

This one has a camera, a light source, some ambient light in the global settings, anything that is not an object is colored white by the background  statement.

The main object here is the height_field object.  It uses the png file created by the previous program.  I called my program gray_terrain.pov so the file it created was called gray_terrain.png.  This is going to use the png file indicated to make a gray height surface from it.
Not too impressive yet.  Next I will add a better pigment to get some better color.

camera {location <0,1,.5>  look_at <0,0,0>}
light_source { <-2,7,2> color rgb 1}
//light_source { <1,7,3>  color rgb .5}
global_settings { ambient_light rgb 1.5 }
background { color rgb 1 }

height_field {
    png "gray_terrain.png"
    smooth
texture {
  pigment {
    gradient y
    color_map {
      [.00 color rgb<.7,  .7,  .5>]
      [.40 color rgb<0,  .2,  0>]
      [.60 color rgb<.2, .5,  .1>]
      [.70 color rgb<.4, .4,  .3>]
      [.85 color rgb<.3, .2,  .6>]
      [.90 color rgb<.9, .9,  1>]
      [.95 color rgb<1,  1,   1>]
      [1.0 color rgb<1,  1,   1>]
    }
  }
    finish { ambient 0.225 diffuse 0.75 crand 0.01975 }
}
    translate <-.5, .1, -.5>
    scale <1, .3, 1>   
    rotate <0,0,0>
  }

This should give you something like the following:

Getting a little better.  Next I will make a more complex surface.
camera {location <0,10,0> look_at <0,0,0>}
global_settings { ambient_light rgb 10}
plane {y, -1.0 pigment {bozo turbulence .5 color_map {[0.00 color rgb <0,0,0>] [1.00 color rgb <1,1,1>]}}}


Added turbulence .5 (as well as adjusting the lighting).
camera {location <0,1,.5>  look_at <0,0,0>}
light_source { <-2,7,2> color rgb 1}
light_source { <1,7,3>  color rgb .5}
global_settings { ambient_light rgb 1.5 }
background { color rgb 1 }

height_field {
    png "gray_terrain.png"
    smooth
texture {
  pigment {
    gradient y
    color_map {
      [.00 color rgb<.7,  .7,  .5>]
      [.40 color rgb<0,  .2,  0>]
      [.60 color rgb<.2, .5,  .1>]
      [.70 color rgb<.4, .4,  .3>]
      [.85 color rgb<.3, .2,  .6>]
      [.90 color rgb<.9, .9,  1>]
      [.95 color rgb<1,  1,   1>]
      [1.0 color rgb<1,  1,   1>]
    }
  }
    finish { ambient 0.225 diffuse 0.75 crand 0.01975 }
}
    translate <-.5, .1, -.5>
    scale <1, .2, 1>   
    rotate <0,0,0>
  }

This is basically the same code as before, but with the new file.  And following is the resulting terrain.

plane { y, -1.0 texture {pigment {color rgbt <0,.2,1,.5>}} translate <0,1.08,0>}

To add some water add the above plane and use the translate 1.08 value to adjust the height of the water.



That is all there is to the basic terrain generator.  I will explain a few more things in upcoming blogs.

Cityscape

Rough draft of a cityscape.

I based this on Brandon Kruse's D and D Doodle

Sunday, July 15, 2012

Korgoth Swamp

Korgoth Swamp: Home to lizardfolk, bullywugs, and troglodytes.  This was my most successful campaign although I think the players got sick of mucking around in the swamp.

In ancient times this was a beautiful lake region where the royalty would go for recreation.  A series of baths were created.  It later became the site of a great battle between wizards and druids.  During the battle a rift was torn between the planes connecting planes of earth, water, and limbo.  Transforming this region to a swampland.  The druids were able to seal the rift but the seal was fragile and so guards were set to ensure no one would try to open the rift again.

In recent times the constant summoning spells of the bullywugs have begun to weaken the rift.

The players spent so much time in this swamp I even put in a swamp Inn called The Bog for the players to rest up.  The bullywug village is shown above.  Gardenia is the village of the gnomes located outside of the swamp.  Gardenia can only be seen by friends of the gnomes, otherwise it is hidden by illusion.

The center of the concentric circles labeled Chaos indicates the location of the rift seal.  There is a small castle located at the site labeled giant.  The ruins in the center are the remains of the original Pleasure Palaces.
The lizard folk have a village in the swamp shown above.  The blue dots along the border indicate the location of lizard folk guards.

This is a small Chateau built on the edge of the lake but since the waters have been rising the place has fallen into ruin.  There is a swamp giant living in the caves.

Saturday, July 14, 2012

3D Mazes

I was inspired by an article in Scientific American to start creating 3D mazes.  This was one of my first attempts at a 3D maze.  This is a 3x3x3 maze.  There are 9 rooms on each of the three levels for 27 rooms total.  The party starts at room 1 and must work through to room 27 (level 2).  The color of the tile indicates the level.  In the small map I had blue/gray as level 1, white marble as level 2 and brown as level 3.  For the higher resolution maps I used green for level 3 and added stairs and doors.  The map works better at 1 square = 10 feet, otherwise the party will likely not fit into the room.  The levels are directly above each other and connected by the stairs.

Most of my dungeon crawls since this time have been based on 3D mazes.  This is pretty easy to solve looking at the top level but could be more difficult to follow when you are playing this as a game.  Be sure to let the players know that solving the maze is part of the puzzle.  The higher resolution tiles could be printed and cut out for playing the maze.  Again each square should be 2 inches if you want the standard 5'/inch.



Friday, July 13, 2012

Hall of the Lizard King


This is the hall of the lizard king populated by lizard folk, a small dungeon crawl.  This was one of my early attempts to use POVRay to render a dungeon.  I eventually came up with a web based POVRay dungeon generator program but it was pretty clumsy to use and I only had it running on an internal server.  The water used to take forever to render.  The tiles use standard POVRay stone textures.

Thursday, July 12, 2012

Hasar

The golden city of Hasar is located on the coast of the great southern continent, a golden jewel amidst the emerald jungle.  To the north the Tarbamar Mountains are the home of trolls and ogres that raid the Hasarian caravans so that they are forced to travel throughout the Kumar Dessert.  Maboji is a great city on the edge of the jungle.  Exotic materials, woods and spices are traded between Maboji to Hasar.  Recently a shadow has fallen over Hasar just as the Khalif has taken a new bride.  She seems to have come down with an illness which causes her once beautiful skin to turn scaly.   Should be a simple matter for a healer to deal with...


Rendered using POV-Ray

Wednesday, July 11, 2012

Elves in Caves


Durring one of my chemistry labs I must have spilled some acid on my notebook.  Over the years it has begun to burn away my notebook pages as can be seen in the lower left corner of this map.