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

From IvanWiki
Jump to navigation Jump to search
Line 110: Line 110:
 
</tt>
 
</tt>
 
|
 
|
  <tt> #define RANDOM 0
+
  <tt> #define RANDOM 0
 
   #define ELPURI_CAVE 1
 
   #define ELPURI_CAVE 1
 
   #define ATTNAM 2
 
   #define ATTNAM 2
Line 126: Line 126:
 
! Before
 
! Before
 
! After
 
! After
!
+
! Result
 
|-
 
|-
 
|
 
|

Revision as of 11:29, 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 steps

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. It should contain the kinds of things described in the article on Dungeon Building. Most importantly, the Dungeon control variable will need to be the DEFINED_VALUE you set in define.dat, which will help link the dungeon to its overworld terrain.

define.dat

You will need to define the name that the IVAN script files will use to recognise your dungeon. Therefore you will need to include a #define with the other dungeon names in 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. 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;.

For programmers: note that if we wish to refer to a particular dungeon in the code itself, for example to do something special in game.cpp, then the code will need to know about it, and so a #define will also 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 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.

Here are some pictures showing famous owterrains:

New Attnam Attnam Gloomy Caves
Ownewattnam.png Owattnam.png Owgloomycaves.png

As of IVAN 0.50.6, there are exactly 32 slots (dungeonAA up to dungeonBF) available for use as the over-world linkages to your dungeon. Simply pick one out that is free and modify it to link together with your dungeon data file by specifying which DEFINED_VALUE you introduced in define.dat

This table shows the control variables for each over-world terrain. You can configure your over-world terrain with the ground terrain type of your choice, and a bunch of other things besides.

Keyword Values Description
BitmapPos x, y; This determines the bitmap position of the picture of the terrain in WTerra.pcx. You can create your own picture by modifying 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 Specify whether to prefix the name stem with the english language short article, "a", or the long article, "an".
IsAbstract true or false Do not worry about this. An over-world terrain has no other config than the base config and only the protoype is abstract, if that means anything.
CanBeGenerated true or false Set this value to true if you want your user defined dungeon to appear in the world map. It is not applicable to core locations.
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

A Dungeon data file

(Attachement)

In define.dat

Before After
 #define RANDOM 0
 #define ELPURI_CAVE 1
 #define ATTNAM 2
 #define NEW_ATTNAM 3
 #define UNDER_WATER_TUNNEL 4
 #define EMPTY_AREA 5
 #define UNDER_WATER_TUNNEL_EXIT 128
 

 #define RANDOM 0
 #define ELPURI_CAVE 1
 #define ATTNAM 2
 #define NEW_ATTNAM 3
 #define UNDER_WATER_TUNNEL 4
 #define EMPTY_AREA 5
 #define HOUSE_ON_THE_STEPPE 6
 #define UNDER_WATER_TUNNEL_EXIT 128

In owterra.dat

Before After Result
locationAA
 {
   BitmapPos = 0, 64;
   NameStem = "empty area";
   UsesLongArticle = true;
   AttachedDungeon = EMPTY_AREA;
   AttachedArea = 0;
   CanBeGenerated = false;
   NativeGTerrainType = JUNGLE;
 }
locationAA
 {
   BitmapPos = 0, 64;
   NameStem = "house on the steppe";
   UsesLongArticle = false;
   AttachedDungeon = EMPTY_AREA;
   AttachedArea = 0;
   CanBeGenerated = true;
   NativeGTerrainType = STEPPE;
 }
ShopBare.png

What's this about "core locations"

Core locations are the original ones from IVAN 0.50. These are New Attnam, Under water tunnel, Attnam and Gloomy Caves. Their generation on the world map is not handled in the generic way covered by the means of adding places to the world map described here.

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.