Main Connecting Starting



Building: Wilderness Templates

Wildernesses are now defined using a global pool of template rooms, rather than information hardcoded in the source code. Hurrah! This means you can now create your own terrain types, or update/improve/fix/replace existing terrains.

The bad news is that creating a detailed wilderness location is not simple. This doc may either help you, or discourage you. It is all good. Don't break existing templates, as it will screw up existing wildernesses.

Don't delete any existing templates. We really mean this.

Contents

Terraforming for Non-Deities

A basic wilderness terrain type needs 5 different blocks of descriptive text.

Name
Grassland
Room description
You are in an area of grassland
What it looks like from nearby locations
There is some grassland to the <direction>
What it looks like from distant locations
There is some grassland in the distance to the <direction>
What it looks like when a location is surrounded by this type of terrain
You are in the middle of an expanse of grassland

Every single type needs these. Additionally, descriptions can be improved if a location supports these additional descriptive strings:

What it looks like when there are several bits of this terrain visible to nearby locations
There are ponds <direction>
As above, but for distance locations
There are ponds in the distance <direction>
What it looks like when bits of the same kind of terrain adjoin each other
The river continues to the <direction>
What it looks like when you are flying high above the terrain
There is a forest far below you

Special cases also exist for certain types of terrain which have additional behaviours defined for them

What it looks like when you are underneath the terrain
You are underneath a bridge
What it looks like when you are above the terrain
You are in the branches of a tree in a forest

You also need to provide a little icon for how the terrain looks in the wilderness (mini)map, for example %% for prarie locations.

Each of these strings can be defined in two ways. The easy way is to have a single predefined string attribute. The complicated way is to use a lua trap, capable of returning different strings depending on the specific details of the room. This is used to display a freshwater wilderness location as a lake, river or pond depending on its expanse, and whether it flows or not.

Display Traps and Attributes

Attribute Trap Use  
name lua.wild_name The name of the terrain to people in, under or over it, and in exit lists of adjacent locations  
desc.internal lua.wild_desc The basic description of the terrain to people in, under or over it  
wild.near lua.wild_desc_near Description of the terrain in an adjacent location %s
wild.near.plural lua.wild_near_plural Description in an adjacent location which is itself adjacent to several instances of the terrain %s
wild.same lua.wild_same Description when an instance of this terrain is adjacent to another instance of the terrain %s
wild.same.all lua.wild_same_all Description when totally surrounded by instances of this terrain  
wild.far lua.wild_desc_far Description of terrain when seen from a distant location %s
wild.far.plural lua.wild_desc_far_plural Description when an a location can see several instance of this terrain in the distance %s
wild.far.same lua.wild_same_far  
wild.far.same.all lua.wild_same_far_all  
wild.near.far lua.wild_desc_near_far  
wild.near.far.plural lua.wild_desc_near_far_plural  
wild.surrounded lua.wild_desc_surrounded  

Configuration Attributes

Of course there are various other important attributes used by the internals of the wilderness generator. If your template lacks theses, it will work oddly, or even not at all.

Attribute Use
wild.short This is the name shown in the map key, and what the form command expects as a terrain type. If you miss this out, you'll not be able to form this terrain.
wild.id This number should be unique to your set of terrain templates. If two terrains share the same id, the last one read in will override all the others. This is handy for creating custom replacements for standard templates
wild.alt The default altitude of a location. 0 for sea, 1 for beaches, 2 for ‘normal land’, 3 for hills, 4 for mountains etc. The altitude map understands altitudes up to 7
wild.map The map symbol that shows up in the body of the map, and the map key. Should be a colourcode followed by 2 characters. Don't bother with a closing ^n colourcode.

Custom Wildernesses

I'll assume you've already read the wilderness dev doc, and have successfully created a wilderness for yourself. But this wilderness lacks a certain something... perhaps the sea is the wrong shade of pink. You can however override default wilderness templates, or add your own new templates to your wilderness without affecting any other wilderness in the game.

Create a new room to hold your templates. On the zone object associated with your wilderness, set the wild.templates attribute to be the id of this new room

The easiest way to create wilderness templates is to copy an existing simple one, like wilderness_ice. If you want to create an entirely new terrain type, you'll need to give your template a unique wild.id number. This cannot currently be done easily... you'll just have to go for trial and error. Starting at 30 or 40 is a good idea, so you won't have any weird effects if new global wilderness templates are added.

If you want to override an existing template (like the sea) set the new template's wild.id to be the same as the old template's. For the sea, this would be 0.

Now you must set all of the attributes and traps to fit your new design... I won't go into this in detail, you can work this out for yourself from looking at the template you copied and tweaking it until it fits.

Good luck with that.

Caveat Muppet

The wilderness templates are (or at least should have been) designed to work in sensible circumstances. If you make crazy terrain, you'll get stupid descriptions. This is not the fault of the coders.

Known Bugs

Single terrain types that can look like different things depending on circumstance (beach becoming a sandbank when surrounded by water, freshwater becoming a pond if only one location in size, or becoming a river if it is flowing, etc) can be confused by the describer if several instances of the terrain are visible at a time.

For example, imagine you are in a location, which has a river to the north, and a pond to the south. The describer will not understand they are different, and will combine the two, so you'll just see “There are rivers to the north and south.”. The descriptive text is taken from the first found location going in order north-south-east-west. You can avoid this by putting at least 2 locations between bits of terrain which behave in this way.