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

Region generation part I: Landscape textures

Original posted December 16 2013

The region generation feature in Skyrims Creation Kit that lets you automate landscaping. It saves a lot of time compared to painting the terrain and placing every object by hand.
To get good regions can be tricky, there are many parameters to tweak and the learning curve is rather steep. I’m still learning and had the good fortune to have a good teacher, Noir, who has been working with region generation for years. In this guide and those to come I will try to share what I have learned. The region generation feature was also present in Bethesda’s older games and I recommend also looking at guides from Morrowind, Oblivion and Fallout.

I’ll start with the basics, how to generate landscape textures and show examples of Hoddminir region settings. A later guide will look at generation of objects.


How to create a new 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. To add textures or objects you drag them from the Object Window list to the Generated Objects window.


Parent and Child

A important concept in region generation is Parent and Child object or texture.
Textures and Objects are added as a base object, called Parents, or as an under objects to that Parent called Child. Parents gets generated first and the generation of children is dependent on the placement of the Parent.

Settings

There are two tab that is of interest for landscape textures, Objects and Objects (more). The main setting parameters that you will be working with are:

Density Range 1-100
Min and Max slope Range 0-90
Min and Max height Cut of in units that limits how high or low the texture will be applied on the terrain.
Clustering Range 1-100
For a more comprehensive explanation look at the Oblivion Construction Set wiki page
Lets have a look at the different parameters and how they effect generation of Parent vs Child textures. To illustrate the effect of the settings I show some examples.

Parent texture

Density

How much this Parent texture will blend with other Parent textures.
Note that the first Parent in the list will regardless of value be calculated at 100% if the total number of parent textures are less then 100%.
In the test I had two Parents, with the density for the second Parent ranging from 100, 80, 50, 30 and 10%.


Clustering

Clustering determine random terrain vertices drop outs of the parent texture to allow other parent textures to blend throw.

Child textures

Density

Amount of in land area covered (not blend) that the Child texture will occur on.
In the test I had one Child, with the density ranging from 100, 80, 50, 30 and 10%.

Clustering

Noise or breakup of the Child texture. High values will be more broken up, low values will give larger patches. Child textures are always at a 100% blend.
In the test I had one Child, with the clustering ranging from 100, 80, 50, 30 and 10%.


Child texture to an object

Density is always calculated as 100% (regardless of value) and clustering has no effect. Radius of child texture is controlled by the vertex color radius slider, 0-200% of the objects set radius.
A good example how to use this feature is for covering the ground under trees with a landscape texture of dead leaves.

Example region settings

When designing a new region it is important to know that there is a limit to how many landscape textures that can be used. A cell is divided in to 4 quads, and there cam be a maximum of 6 landscape textures per quad. Any more texture added to the landscape will show up as black.
When painting the terrain by hand you could if careful actually get in 6 x 4 textures in a cell.

But region generation applies textures all over a cell, so this means practically that you should not have more than 5-6 landscape textures in your setting. Sometimes you will want to make an exceptions to this rule, like when having one set of textures above and another below the water level. It will usually give some black texture artifacts in the border cells that must be fixed by hand.
The Creation kit can some times be a bit tricky to work with, and Region generation is no exception. Another good thing to know is that when changing a value of an texture or object the CK will not always register this change. Select another entry and the select the entry you changed and see that the change is really there.


In the examples below we work with different settings of slopes, clustering and density. Note how different the landscape will look when adding Child textures to the Parents compared to just having the Parent texture. The textures used in the regions are from the Hoddminir ground texture pack.

Hoddminir settings

Conifer forest



Moorland



Mountain



Deciduous forest


/Elinen

Adding a new creatures to Skyrim

 

Original posted July 8 2017

In the guide below i will go through the steps on how to add a new creature, I’m using a sheep as an example. At first the order things are added seemed backwards and circular, but as far as I can figure out this is how it’s done, and seems to work.

A special thanks to Awake Night for the video on how to create unique animals, without that I would probably not have figured this out.


Before I started adding the first new animals to Hoddminir I had to map out all the different elements that are part of a creature and try to figure out how they were connected. As you can see in the diagram below there are so many parts that make up a creature, but most of the things are not anything we need to change or add.


All the elements that make up a creature

We will need a model and textures, and the main things that make up a creature will have to be added in the Creation Kit, like Race, NakedAnimal, SkinAnimal and EncActor. Unique Death Items and new sounds for the new creature can also be added, but I have not tried this yet.

If you are adding a completely new animal, like the sheep, it’s important to consider which skeleton, movement and behavior that would fit the best for this animal. Most creature modelers have explained what will work best for their new creature. For this example the goat will work well as a template for the sheep.

First off, you will need a model and textures. For the sheep I used Sheep Modders Resource by Stormshallow and made my own texture variant.



Adding a new creature

1. Add model and textures:

To start, add the Nif model to the right folders, under Data\Meshes\Actors\AnimalType\Character Assets\. and the textures to the folder, under Data\Textures\Actors\AnimalType\.

The re-textured sheep in NifSkope


In the Creation kit

2. Create a new Race(Character/Race):

Open a similar animal, in this case a goat. Rename the ID to SheepRace and under the Text Data tab change the Name to Sheep. Close window and answer Yes to create a new form.

New SheepRace


3. Create a new NakedAnimal (Items/ArmorAddon):

Open the NakedGoatAA, rename the ID to NakedSheepAA, set Race to SheepRace. Select a new model under Biped Model.

New NakedSheep


In the Model Data window, press Edit, and select your new model. (If there are different models for male and female animals also change the female Biped Model.)

Select model of the sheep

Close window and answer Yes to create a new form.

4. Create a new SkinAnimal (Items/Armor):

Open the SkinGoat, rename the ID to SkinSheep, change Name to Sheep, set Race to SheepRace. In the list Models, right click in the list window and select New.

New SkinSheep

Select NakedSheepAA from the list in the new popup window.

Select NakedSheepAA

Close window and answer Yes to create a new form.

5. Skin the Race (Character/Race):

Now go back to the SheepRace to add the right skin, under the Body Data tab set Skin to SkinSheep. Keep the Skeleton, Behavior Voice, and BodyPartData of the goat.

The right skin on the sheep

6.Create a new EncAnimal (Actor/Actor):

Open the EncGoat. Under theTraits tab rename ID to EncSheep, change Name to Sheep and Set Race to SheepRace.


Under theStats tab you can change things like Enc class, Level and Health as you see fit. Close window and answer Yes to create a new form.


Now you have a new creature you can add to your world


There are more things you can also do, like add unique Death Items that match your new creature and add more texture variants using new Texture Sets.



/Elinen