Difference between revisions of "Adding Cities and Dungeons to the IVAN World Map"

From IvanWiki
Jump to navigation Jump to search
Line 13: Line 13:
 
=== Your dungeon data file ===
 
=== Your dungeon data file ===
  
Your <code>dungeon.dat</code> file should reside in <code>Script/dungeons</code> where it will automatically be picked up by the  
+
Your dungeon data file should reside in <code>Script/dungeons</code> where it will automatically be picked up by the game when it creates the world map.
  
 
=== define.dat ===
 
=== define.dat ===
Line 29: Line 29:
 
=== owterra.dat ===
 
=== owterra.dat ===
  
The data file <code>owterra.dat</code> contains the "over-world terrains" of the IVAN world map. These are so named, because they become the little pictures that sit over the ground terrain on the world map. They denote the  
+
The data file <code>owterra.dat</code> contains the "over-world terrains" of the IVAN world map. These are so named, because they become the little pictures that sit over the ground terrain on the world map. They denote the places - cities or dungeons - you can visit when adventuring in the world map, and so they need to be linked up to the dungeon data files.
 +
 
 +
Pictures showing famous owterrains...
 +
 
 +
This table shows the control variables for each over-world terrain:
 +
 
 +
{| class="wikitable"
 +
! Keyword
 +
! Values
 +
! Description
 +
|-
 +
| <code>BitmapPos</code>
 +
| <code>x, y;</code>
 +
| This determines the bitmap position of the picture of the terrain in <code>WTerra.pcx</code>
 +
|-
 +
| <code>NameStem</code>
 +
| <code>"string"</code>
 +
| This is a string, beginning with a lowercase word, usually a noun or an adjective, for example, "mighty cathedral" or "cave entrance"
 +
|-
 +
| <code>UsesLongArticle</code>
 +
| <code>true</code> or <code>false</code>
 +
|
 +
|-
 +
| <code>IsAbstract</code>
 +
| <code>true</code> or <code>false</code>
 +
|
 +
|-
 +
| <code>CanBeGenerated</code>
 +
| <code>true</code> or <code>false</code>
 +
|
 +
|-
 +
| <code>AttachedDungeon</code>
 +
| <code>DEFINED_VALUE</code>
 +
|
 +
|-
 +
| <code>AttachedArea</code>
 +
| <code>0, 1, 2, ...</code>
 +
|
 +
|-
 +
| <code>RevealEnvironmentInitially</code>
 +
| <code>true</code> or <code>false</code>
 +
|
 +
|-
 +
| <code>NativeGTerrainType</code>
 +
| <code>DEFINED_VALUE</code>
 +
| MUST be non-zero. Can select from <code>DESERT</code>, <code>JUNGLE</code>, <code>STEPPE</code>, <code>LEAFY_FOREST</code>, <code>EVERGREEN_FOREST</code>, <code>TUNDRA</code>, <code>GLACIER</code>. Note that the tundra type produces the familiar snow terrain.
 +
|}
  
 
== A worked example ==
 
== A worked example ==

Revision as of 04:47, 6 June 2016

This section is about adding dungeons to the world map. If you would like to learn about the specifics of dungeon building, see Dungeon Building.

Introduction

This is a brief guide explaining how to include your customized dungeons on the IVAN world map.

Three key resources

There are three key steps to getting your dungeon to appear on the world map.

Your dungeon data file

Your dungeon data file should reside in Script/dungeons where it will automatically be picked up by the game when it creates the world map.

define.dat

Anything you put in define.dat, you can refer to in your other script files. This is a general rule and is applicable to any of the data files. For example, if you want to create another config of a guard, then you just put a new #define in define.dat, and you can now refer to it in char.dat and your dungeon data file.

So it follows that you can #define your own dungeon name, which will be essential when we come to link the dungeon data file to the terrain data file.

Stick to upper case lettering when adding a new #define, and be sure to put an underscore when separating words.

Dos and don'ts: be sure items that are enumerated follow a nice numerical sequence e.g. 1, 2, 3, 4, 5; or 2, 4, 8, 16, 32;, rather than 1, 2, 5, 7, 8;.

If we wish to refer to a particular dungeon in the code itself, say in game.cpp, then the code will need to know about it, and so a #define will need to appear in ivandef.h before compiling the game.

owterra.dat

The data file owterra.dat contains the "over-world terrains" of the IVAN world map. These are so named, because they become the little pictures that sit over the ground terrain on the world map. They denote the places - cities or dungeons - you can visit when adventuring in the world map, and so they need to be linked up to the dungeon data files.

Pictures showing famous owterrains...

This table shows the control variables for each over-world terrain:

Keyword Values Description
BitmapPos x, y; This determines the bitmap position of the picture of the terrain in WTerra.pcx
NameStem "string" This is a string, beginning with a lowercase word, usually a noun or an adjective, for example, "mighty cathedral" or "cave entrance"
UsesLongArticle true or false
IsAbstract true or false
CanBeGenerated true or false
AttachedDungeon DEFINED_VALUE
AttachedArea 0, 1, 2, ...
RevealEnvironmentInitially true or false
NativeGTerrainType DEFINED_VALUE MUST be non-zero. Can select from DESERT, JUNGLE, STEPPE, LEAFY_FOREST, EVERGREEN_FOREST, TUNDRA, GLACIER. Note that the tundra type produces the familiar snow terrain.

A worked example

Known limitations

As of 0.50.6, the number of slots is 32.

Overflow of number of dungeons. Ways in which this can happen.

Population distribution of terrain types collected by the sampling algorithm.