Thursday, February 4, 2021

Region generation part II: Objects

Original posted February 26 2015

Long overdue but here it is, a guide on how to set up region generation with objects and some information on the settings. Much of the information in this guide is not new, there are some tutorials for how to make regions and what the settings do from Oblivion or Fallout and not that much have changed from the earlier games.

This is a hard subject to write a guide on that is not just listing the different settings. Region generation is complex and a lot of it feels like just going with your gut feeling but there is order to the madness.
I go through what all settings do and give some tips on how to figure out what settings to use. I’ll make a third part on the subject of region generation later on, where I show some of the Hoddminir regions.

Content in this guide:

  • Links to other guides
  • How to create the region
  • Region Settings
  • How to calculate which settings to use
  • Different approaches
  • Testing your settings

How to create a region

  1. To open the Region editor, go to World, Regions
  2. Choose your worldspace in the drop down menu
  3. Right click in the Region Name list, choose New Region
  4. In the General tab, you can change the name and color of the region
  5. The next tab is Objects, first you have to click the “Enable this type of data” box to be able to add objects and make changes.
  6. To add textures or objects you drag them from the Object Window list to the Generated Objects window.

You can preview an object from the object window by selecting it, right clicking and select preview. Textures you can view by double clicking on them, then you can also see if there are any grasses that will be placed with that texture.There are different levels that an object/texture can have, the first level is called a parent, dragging new objects/textures to the parent will create a second level, called child. Children levels can also have more levels under them. When a parent is generated children will be generated close to it.


7. Select your object, now you can change the settings for that object/texture. Some of these settings have different function depending if it’s an object or a texture as well as the level, parent or child.

 


Region Settings

General Tab

Edge fall-off, game units

The region will diminish in density of generated objects on the border of the region, the Edge fall-off setting determines how large this buffer zone should be.


Objects Tab

Priority and Override

If the Override box is checked the generation will check the priority values for each cell with more than one region. In this case the region with the highest number will completely override the other regions and only objects from the highest priority region will generate. If you wish to generate objects from several regions together don’t use Priority.

Radius, game units

This is a value that determines how close two objects of the same kind can be, objects with with smaller radius will appear closer together. Radius is the most influential setting determining the amount of objects generated.

A radius of 512 will make a grid (4096/(512*2))^2=16 blocks, and a radius of 256 gives 64 blocks. The radius value divides the cell in to a grid of blocks with the sizes of double the radius setting of the object. Think of a block with the object in the center and the borders of the block one radius away from the center (but in a square). The density setting then determines the chance that an object will be generated in each block.


Density, values 0-100

The density determines the chance of object appearing. The cell will be divided in to a grid of blocks dependent on the radius of the object and for every block in the grid there will be a % chance that the object will be generated.


Clustering, values 0-100

The chance that the object will shift towards objects of the same kind after generated. The shift is minor and I usually use a low number for clustering.

Min Slope and Max Slope, 0-90

The minimum and maximum slope in which an object will be generated.

This can for example be very useful when you want trees to grow on flat terrain but not up steep hills.

Min Height and Max Height, game units

If you have default Skyrim land heights the sea level is at -14 000, but the default setting is always 0 when an object is added.

I use the min max height to combine what would be an above-water and a below-water region into one region. It’s a very useful setting to get a variation in your region depending on the altitude.

Most often when something doesn’t generate it’s because I forgot to change the min height. For your worldspace, check the sea level under World and Worldspace.

Radius wrt Parent, game units

A setting only used in Child objects and defines the radius from the parent (closest level up) that this child object can be generated.

I use 512, 1024 or 2048 in my regions. Remember that a cell is 4096 units wide, so 2048 is ½, 1024 is ¼ and 512 is ? of a cell to give you something to compare to. In the image below I used a small radius on the children to show how the Radius wrt Parent works, it is not a suggestion for an actual region.

Is a Tree

Changes the radius in regard to other objects with “Is a Tree” checked. The idea is that the radius becomes greater than the setting so the space between the crowns of the trees becomes larger, but other objects can still be generated close to the trunk of the tree, using the original radius setting. Useful for rocks, ferns, mushrooms etc. I have not found any official information on how much larger the “Is a Tree” radius becomes, but from my test here I would say at least double.

Is a Huge Rook

Objects will be generated on top of the stone. I have never tried using this.


Objects (More) Tab


Sometimes values are not entered correctly under this tab unless you first select another object then goes back to the one you wish to change. This can happen when you switch between the Object and Object (More) Tabs.

Angle Variation, degrees

Varies the rotation of the object in x, y and z axes separately, can be both negative and positive values or if both are wanted you can tick the +/- box.

Sink, game units

Sinks the generated object an amount of units. A negative value will elevate the object.

Always good to use on trees, bushes and rocks so the underside doesn’t show if the terrain is not perfectly flat.

Sink Variance, game units

Variation in the sink value.

Size Variance, percent

A range that the generated object will vary in scale. Both negative and positive values or if both are wanted you can tick the +/- box. Many objects will look weird if you have too large size scaling. I usually use 0.1 –  0.2.

Conform to Slope

The object will adjust the angle depending on the terrain, Angle Variation is applied after Conform to Slope.

Paint Vertices

The terrain under the generated object will be painted with the selected color. The % of Radius slide determines the percentage of the object Radius setting that will be painted. Can also be used to determine the radius of a child texture to an object. See more information below on this .


How to calculate which settings to use

There is a nice way to calculate how many objects that will be generated in a cell. This is a great help when setting up a region. The number of objects generated (N) is dependent on the cell size in game units (4096), the radius (R) and density (D) of the object.

N=((4096/(R*2))^2)*(D/100)

This will calculate the approximate amount of objects generated. Remember that if you also have an angle limitation on the object this will reduce the amount generated depending on the terrain in the cell.

A setting of radius 20 and density 0.1 will give around 10 generated objects. But if we also only let the object be generated on the slope of 0-10°, and you have about 10% of your cell at those angles, you will get 1 object generated (10% of 10) per cell. Figuring out the amount of different slopes for a region is mostly guess work, but it is good to keep in mind when setting up the region.

A region has lots of object in it, and each generated object will effect the space left for other objects. Let take a look at how this works. In the example below I have two parent objects, the first in the list is the blue rock (density 30, radius 512) and the second parent object is the gray rock (density 100, radius 256). First the cell is divided into 16 block for the first parents, and in about 30% of them the blue rock gets generated, this space is now of limit for other objects. The remaining space gets divided according to the next objects radius and generated 100% gray rocks.



But what happens if the first object in the list has a child?

The generation happens in order from the top:
Parent 1, Children of Parent 1, Parent 2 and so on.


Can be good to keep in mind that the lower down the list an object is the smaller chance it has to be generated.

Some other useful information

  • Trees don’t rotate when generated, regardless of settings, use placeholders when generating and then use search and replace once generated. This only apply to animated trees.
    Update: Verteiron has made a script for TES5Edit that will randomly rotate trees after region generation. I have not tried this get, have a look here if you are interested.
  • Models that are open at one side, like Skyrim’s cliffs, can’t really be generated in a good way.
  • One of the troubles you can run in to if you try to generate on the same cells you generated on before is that the CK refuses to generate objects “due to bounds”.
  • Use a spread sheet to keep track of your settings, it is much easier then to see what settings might need changing after you made test generations.
  • What cell is where?
    The region generator will show a black grid on white to represent the cells of a world space. For a small space its easy to know what cell is where, but I have a large world with 16384 cells in it and it is hard to know where I’m in the Region generation grid. I have a map made with a cell grid on that I always have open whenever I set up regions.
  • Adding many parents can become hard after a while when the object window get full. It’s easy that the newly added object becomes a child instead of a parent as intended. Try dragging the object to the corner on the scroll bar, on the down arrow (for me this works).

Objects as children to textures

Adding objects as children to parent textures can be a great way to control the placement. But objects won’t, as far as I can see, generate when they are children to a child texture.

Textures as children of objects

You can add textures as children to an object, this is a really nice feature. I use it to have leaf covered ground under trees for example.

The child textures density can be set to anything, it will show similar as if you have two parent textures and the second had a high density (but not 100). Even if the base texture does not show, the grasses from the base texture will. If you have many of the parent objects generated close together the grass from the base texture will disappear.


Under the Objects more tab there is a slider for “% of Radius” ranging from 0-200%. This determines the size of the child texture generation on the terrain.


The radius of the texture is not a function of the radius set for the object, it is based on the objects actual size. Below I show two equally sized rocks with “% of Radius” settings, 0 and 200%, and two different radius on the objects, 20 and 512 units. As you can see this doesn’t effect the size of the child texture.

When the object is a child of a child texture, the object child texture generates all over, more over no objects get generated except in the edge fall-off zone.


Different approaches

Low density/small radius vs High density/large radius

There are two different schools of thought on density and radius settings, one that advocates a low density/small radius, the other using high density/large radius.
If we just look at the numbers both strategies will generate the same amount of objects per cell. A density 30, radius 350 will generate about 10 objects and so will a density 0.1, radius 20.
The difference is in the amounts of blocks in the grid that the objects can generate in. With a radius of 350, there are 34 block in one cell, but with a radius of 20 there are 10485 blocks.
The risk with the high density/large radius approach is a too ordered generation, the objects will stand in ordered lines. With low density/small radius the objects will appear to be more randomly generated due to the smaller block size.

The drawback of the low density/small radius are that objects can clip into each other. On the other hand, each generated object only occupy a small space, so the risk that the generator runs out of space for objects at the end of the list is much lower.
Another difference between the two ways of setting up a region is the time it takes to generate. With a larger radius there are fewer slots or blocks for the generator to calculate the density for, and it can make a noticeable difference in the time even a test 3×3 cell area takes to generate.

On an even ground with little or no height variation I would not use a radius greater than 80-100.  The example I show here has a density of 2, and you can still notice some rock generated in straight line, but it is not too bad. I use low density and small radius approach, but you should try both and see which you prefer.


Testing your region settings

When I make a region I always start with the landscape textures, parents first then children textures. Once I get them looking good I continue by adding one or two parent objects. I usually start off with a low density of 0.1 and a radius of 20 and work up from that until I get the desired effect. First when I’m satisfied with all the parent objects, I add the child objects and continue testing.

I recommend finding a good spot in your terrain to do tests in, someplace that is representative of the area the region will cover. I test in an area with an approximate size of 3×3 to 5×5 cells, and a test region should not take too long to generate. If it takes too long, the settings generate too many objects. No more than 5 min is my rule of thumb, and even that is probably too much. If such a small area takes that long, an 80-100 cell area will take very long and might not be doable at all.

It is important to know that you can run into problems if you generate on the same cells over and over again. The procedure I suggest might seem tedious and unnecessary but it really is important. Some have got it working without this approach, but my suggestion is to be on the safe side.

Here is what you do:

  1. Change region settings, save
  2. Take a copy of your esp
  3. Generate the test region, save
  4. Check the generated cells to see how the settings work
  5. Load up the copy, go to 1. and repeat
    Remember to continue working with a clean (non generated) file once the region setting is perfect.

To define the borders of the region go to General tab.
By holding the mouse over a white cell you can see the cell coordinates in the bottom of the Region window. To pan around the map, press and hold the middle mouse button and drag with the mouse. You can zoom with the mouse wheel.
  1. When you find the cell you want, click with the left mouse button, this will place a red cross,  repeat in the next cell and you will get a line between the crosses. when you have encircled an area, right click and select done, and the red line will connect with the beginning. The region will now become colored.
  2. To generate the region you just drew, right click on the region, select generate and wait for it to finish. It’s a good idea to save before taking a look at the generated cells.

Once you feel happy with your region settings and would like to generate over a larger area I suggest you take a look at this guide, it describes very well the best practices when it comes to region generation. I would go so far as to say you really, really should read it.

Next part: Making region settings, from start to finish.

/Elinen

1 comment:

  1. Thank you for your tutorials! Hard to believe it's been such a long time since Skyrim went out. Makes me feel old.

    ReplyDelete