Table of Contents

Start Page » Modding Epsylon » Vegetation System

Large outdoor sceneries are no more uncommon in games. Rich outdoor sceneries though require a lot of smaller plants and props laying around on the ground interacting with wind and actors walking through to be believable and up to a standard level of graphic details players grew accustomed to. Creating rich sceneries can take a lot of time for a mapper if he has to hand place plants and other kinds of flora. Furthermore creating naturally looking environments is tricky doing by hand especially since nature often obeys to certain laws governing where plants grow. The Epsylon game provides a powerful vegetation system using Prop Fields. Developers are therefore not required to use this vegetation system as it is just a layer above prop fields exposed by the game engine writing their own system if they want to. This system is though simple to use and a great help for all mappers to create fast sceneries.

How it works

The vegetation system is based upon rebuilding laws used by nature governing plant placement. Plants don't grow just anywhere. Symbiosis is one example of a set of laws in nature. Certain plants therefore grow only in the vicinity of other plants. On the other hand some plants can prevent the growth of other plants because they are either too large or otherwise too dominant. Also the underground influences where plants grow as well as the slope or the amount of light hitting a place. Eventually man made restrictions influence placement like buildings or for example contaminated areas. All these factors can be represented using a set of rules which defines how probable it is for a plant to grow at a certain location. This vegetation system uses such a rule based system to populate the prop fields with plants.

This is also the huge advantage of this vegetation system. Once the rule base is set up properly a mapper can simply place dominant elements ( for example trees, buildings or info tokens designating special points of interest ) in the world and update the vegetation. All plants then are laid out where necessary. This way the vegetation naturally grows around the structures the mapper places. Hence the mapper set's up once the rules and from that point on all vegetation is automatic in a natural way! This makes the Epsylon Vegetation System a fast and easy way to create rich environments.

Vegetation Layers and Rules

For this to work each height terrain sector contains a set of Vegetation Layers. Each layer contains one Rule Base dictating the growth of various plants located on this layer. The order of the layers is important as plants can only grow where there is no other plant yet. Therefore it is best to place dominant plants on early levels so recessive plants can only grow where there is no dominant plant yet. This way no additional rules have to be defined for this trivial constellation which reduced the complexity of the rule base as well as improving the speed of producing the prop fields. The rule base is defined using a node based system. Node systems became a kind of standard for editing complex system and many developers and artists are already used to such systems ( for example from Blender3D ). The node system is explained in more detail in the Vegetation System Nodes Editor. The vegetation system produced for the sector a set of randomly placed props. These props are then tested using the rule base. At the end of each test a probability and a variation is defined. The probability yields a number between 0 and 1 indicating how probable it is for the plant at a given position to exist. The vegetation system tests this value internally using a random number generator and if passing this test the prop is added the prop field. The variation influences how the prop looks like and is explained in the variation section.

Evaluating the rule base for each prop field can consume some time which is why interactive editing is mostly not feasible with automatic updating of the prop fields. Therefore changes to the world influencing the vegetation are delayed until the “Update Vegetation” button in the vegetation panel is clicked. Since this evaluation time is also not so splendid for a game later on the created vegetation is saved in a cache file alongside the height terrain file. It's a small file with only the prop field informations inside which can be loaded by the game. This makes also loading only the requested percentage of instances in a prop field simple to do. Games therefore do not have to implement all this rule base logic and just have to load this cache file. Allows also developers to write their own tools to create the terrain if they want to.

Variations

Layers alone only define where plants grow but not how they look like. Variations are used since often a set of rules applies to multiple types of plants. Or stated differently often a mapper wants to place a certain type of plants using a set of rules but to add some variety he wants to use a couple of different plant models varied across all plants chosen from this layer. For this each layer has a list of Variations. A variation defines one particular kind of plant which can grow on this layer. This encompasses not only the model and skin to use but also physical properties. For each variation a Rotation Per Force and a Restitution can be defined. These values are used by the physics module to simulate how plants interact with forces acting on them like for example wind. Since the system is geared for performance the state of an instance is represented using its bending around the X and Z axis. Therefore the Rotation Per Force value is used to indicate how much bending ( rotation in degrees ) a constant force of 1 Newton induces on the plant. Plants though don't just bend they also try to get back to their original unbend position. To simulate this a Restitution factor can be defined. For simplicity the restitution indicates how much the plant forces itself back to the original position relative to the amount of bending it suffers at the time being. There is no real measuring for this value as it contains different physical parameters so you have to experiment a bit with the values to get a good result. ( TODO: enter some example values here ).

Using the rules not only the probability can be defined but also the variation. The variation input slot selects which variation is used for this particular instance in the prop field. The input value is supposed to be in the range from 0 to 1 mapping to the range 0 to VariationCount-1 with VariationCount representing the number of defined variations. This has been chosen since most rules operate on values in the range from 0 to 1 ( for example the probability slot accepts this range ) and using the same range allows to efficiently use the rules without remapping values. The variation value is rounded to the closest valid variation number. Therefore if 2 variations are defined the values from 0 to to without 0.5 map to variation 0 and the values 0.5 up to inclusive 1.0 maps to the variation 1. The same holds true for an arbitrary number of variations. If left unconnected the variation defaults to the value given in the result rule.

Examples

( TODO: add some example screens here )