Creating Your Own Vegetation



PlantStudio is an excellent program for the creation of .BMP files for use as ground cover in QuadTree.

The flowers seen here were exported from PlantStudio using models created by Nigel Pickering

   
The image must be square and have dimensions that are a power of two, such as 64x64, 128x128, and 256x256. The image should have a solid background such as black, white, or one of the primary colors. The background is transparent, but its color does matter, as it it used to slightly shade the edges of the generated sprite. To avoid visual artifacts at the edges of the transparent rectangle that the image is mapped onto, the image should have a 1-pixel border of background color. To the left is an example of the image used to produce the field of blue wildflowers seen above. Images that seem to work well tend to be visually balanced but not perfectly symmetrical, and if 90-degree crossed to form each plant, are exactly centered within the image square.
Example object, placed within a tile{}
element in server.cfg:
object {
    type    plant
    texture weed
    height  1.0
    x       0.0
    z       6.0
    count   4
    radius  2.0
    flags   65
    seed    5
}
    
type Always "plant" for this type of object.
texture The name of a .BMP file (omit the actual extension) that will be used to draw the object.
height Specifies the distance from the ground to the top of the image. From ground level to eye level is approximately 1.0 unit high, so 0.5 would be about waist high.
x Specifies the west/east position of the object's center relative to the center of the tile in which the object definition appears. Tiles are 128 units wide, so the range of x is from -64.0 to 64.0 with the negative value to the west, and positive to the east.
z Specifies the north/south position of the object's center. Tiles are square, so values of z range from -64.0 to 64.0 with the negative coordinates in the north and positive to the south.
There is no need to specify the height because it is computed to place the bottom center of the object's image at the same height as the ground at the x,z location.
count Specifies how many plants will appear for this object. The first plant is always placed at the x,z coordinates. Additional plants are placed within the circle defined by the object's location and radius.
radius The radius of a plant object describes the area in which plants appear. For plant objects of count 1, it has little effect. However, large radii can increase the distance at which plant objects reach their maximum opacity. In general, the radius should be kept between about 0.5 and 10.0
flags This is an optional value that controls several different parameters for a plant object. Adding the following values together and specifying the sum as the value for flags will enable any of the following options for the plant object:
  • 1 - Treat white as transparent. (Default is to assume black)
  • 2 - Treat red as transparent
  • 4 - Treat green as transparent
  • 8 - Treat blue as transparent
  • 16 - Randomize the height of plants when count > 1
  • 32 - Randomize the width of plants when count > 1
  • 64 - Use two images crossed at 90 degree angles for each plant
seed This value seeds the random number generator for the object. This allows for variations in sprite facing, placement of multiple plants within the object radius, and variations in height and width values between objects, but allows the objects to appear in exactly the same configuration for different clients that visit the area.