The Cathedral of Attnam

Changes

Jump to navigation Jump to search
4,414 bytes added ,  14:29, 23 October 2019
no edit summary
''This section is all about dungeon building. If you would like to learn about adding dungeons to the world map, see [[Adding Cities and Dungeons to the IVAN World Map]].''
 
__TOC__
== Introduction ==
=== A suitable text editor and font ===
When editing the dungeon file, it pays to have a good text editor. A nice program in Windows might be, for example, Programmer’s Notepad 2, but any program with suitable syntax highlighting will do. The script file text is based on C/C++ syntax, so you can set the syntax highlighting to this language. It is also highly prudent to select a mono-space typeface. A mono-space typeface means each character has the same horizontal length in the editor. Because we are also going to “draw” with ASCII characters in the script files, it would be good if the characters can properly align in a grid-like fashion, making it easy to identify the geometrical patterns. This is indispensable when it comes to laying out large rooms and even particular dungeons, helping to avoid confusion along the way. Suitable typefaces to consider for this purpose might include [https://en.wikipedia.org/wiki/ConsolasConsolas], [https://en.wikipedia.org/wiki/Courier_%28typeface%29#Courier_New Courier New ] or [https://en.wikipedia.org/wiki/Lucida#Lucida_Console Lucida Console ] fonts, or any [https://fonts.google.com/?category=Monospace other suitable monospace font].
=== Backing up your work ===
== Dungeon script hierarchy ==
{[[File:DungeonHierarchies.png| class="wikitable"thumb|Example of hierarchy in a dungeon script]]| The dungeon script file follows a definite structure. However, this may be hard to see since certain keywords can be used over and over again. For example to re-define default values in a certain portion of the script, the keyword <code>RoomDefault</code> might be encountered at the <code>LevelDefault</code> stage or simply the <code>Level</code> stage.
Each dungeon has default parameters specified within <code>LevelDefault</code> and <code>RoomDefault</code>. This is where the general look and feel of the dungeon can be uniformly specified with only a few commands. These defaults can be overridden at any point in the script, within that dungeon.
Squares can be defined within rooms, or within a level somewhere. On a square may be placed any amount of items, or a particular ground-terrain or over-terrain, such as stairs or a fountain.
Each room and square can be made to appear randomly within a level, in a random position, and/or within a random sub-area of a level (handled by <code>BoundedRandom</code>), and/or on a random member of a subset of levels (handled by <code>RandomLevel</code>). | [[File:DungeonHierarchies.png|400px]]|}
== Examples from the original game ==
=== Gloomy Caves Shop ===
As The shop in the gloomy caves is a good example of how to manually lay out a specific room in the script. The shop is declared as a simple room. The size is set to 5 tiles wide by 9 tiles high. Because it is a startshop, let's have and Mellis is the god of trade and politics, the divine master is set to Mellis. No altars, fountains, locked doors or booby trapped doors will generate here. This will generate a look at what bare room (see adjacent image). It generates doors and lanterns by itself, because this is going on with specified in the default parameters for rooms in the Gloomy Caves Shopdungeon.
{| class="wikitable"
! Script
! Result
|-
|
<tt>Room
{
AllowLockedDoors = false;
AllowBoobyTrappedDoors = false;</tt>
| [[File:ShopBare.png|160px]]
|}
 
Next we can fill the room with characters. We can place each character in a precise way, by writing a little ASCII map showing where everyone will go. The map - a character map - has a size, a position relative to the room's origin (the top-left corner is <code>x = 0; y = 0;</code>), and a key showing all the character types to be found on the character map. The character map can be thought of as a little sub-map belonging to the room. We need to show where the character map is positioned relative to the room it is in. We see the top-left corner of the room <code>Pos = 0, 0;</code> is occupied by a wall. We want to have a map that covers the floor area. The total floor area available in the shop is 3 tiles wide by 7 tiles tall, so this will be the size of or character map. The top-left tile in the character map will be the top-left tile in the room's available floor space. Therefore we will position the character map at <code>Pos = 1, 1;</code>, relative to the co-ordinates of the room's total space.
 
We need a shop keeper, and some strong guards to protect the fine wares. Therefore we will add the types <code>g</code> for a <code>guard</code> character with the config <code>SHOP</code>, and <code>s</code> for a <code>shopkeeper</code> with the config <code>ELPURI_CAVE</code>. We'll put them both on the same team, and we'll make the shopkeeper the room's master, which is relevant to the room type being a shop. So when the player character wishes to make a trade in the shop, the person he will deal with is the shopkeeper.
 
We then lay the types out in a 3x7 ASCII map. White spaces are ignored, full-stops represent no character, and g and s represent the guard and the shop keeper. We can place the guard in the shop many times over, and we will place one of them in each corner. We probably only want one shop keeper, and so he is placed in the middle of the map.
 
{| class="wikitable"
! Script
! Result
|-
|
<tt>CharacterMap
{
g.g
}</tt>
| [[File:ShopPeople.png|160px]]
|}
 
 
We need to put items in the room so the shopkeeper has something to sell. We can do this in the same way as with the character map, only this time with an item map. The item map will have the same footprint as the character map, so this will be the same as before.
We want to fill the remaining available spaces in the room with random item types of varying categories and worth. In the script, random items are created, but within the parameters of minimum and maximum prices, and item category flags. This enables a good balance between high and low value items, preventing the game from creating a room full of broken leather boots, or for that matter, a room full of magic lamps! If we want we can generate specific items, and so by looking at this script you will see a wand of striking will generate in every shop, for every game of IVAN. This is an example of a so-called "guaranteed item", and is a design element I hope you will choose to use sparingly.
 
We can then populate our 3x7 item map with the types we specified, and using a full-stop to leave some spaces for the character types we placed in the character map for the shop.
{| class="wikitable"
! Script
! Result
|-
|
<tt>ItemMap
{
.s.
}</tt>
| [[File:ShopItems.png|160px]]
|}
== Dungeon default control variables ==
! Description
|-
| <div id="DungeonControlVariable"><code>Dungeon</code></div>
| 0, 1, 2, ... , 64
| This is the dungeon enumerator variable. Enumerations 0 to 4 are occupied by the original dungeons with predefined variables like ATTNAM or ELPURI_CAVE.
=== Square, BoundedRandom; ===
 
== Dungeon balancing ==
 
=== Monster net population ===
 
=== Monster generation net interval ===
 
=== Net difficulty ===
 
=== Item price ===
 
=== Item enchantment ===
 
 
[[Category:Modding]]
Moderator
1,400

edits

Navigation menu