MAZE and DS1 Mechanisms

Post here for all aspects of map making and level design. Click here to visit the Keep's official map site, Diabolic Cartography.

Moderator: Paul Siramy

Post Reply

2
100%
 
Total votes: 2

User avatar
Paul Siramy
Retired staff
Principality
Posts: 2828
Joined: Sat May 25, 2002 2:39 pm
Location: La Garenne Colombes (near Paris)
Contact:
France

Hand-picked

MAZE and DS1 Mechanisms

Post by Paul Siramy » Mon Jun 23, 2003 11:03 am

OVERVIEW
This topic is the result of some tests and discussions. It'll expose some knowledge about how the mazes of the game are made, thus allowing you to edit the corresponding ds1 in the way they're used by the game.


FIRST EXEMPLE (slightly increased Den Of Evil)
First of all, check that screenshot. This is the Den of Evil maze, after I have changed its size in LvlMaze.txt to 6. I have draw lines to show that the maze is composed of 7 'Rooms'. Each Rooms is in fact a DS1. Here's a diagram of the placment and links of these DS1 (the North in the game is the Upper/Right corner) :

Code: Select all

  O <----- Start
  |
  O-O
    |
  O-O
  |
  O-O <--- CorpseFire
Each O is a Room, it's a DS1. For the Den of Evil, the game use the DS1 that are in data\global\tiles\ACT1\CAVES\ like caveNE2.ds1. This is the Level Type of the area that is used to choose what are the DS1 that are used to build the maze. Here's another diagram. This is the same map as before, but this time with the name of the DS1 that are used, and with their (ID, DEF) if you want to edit them in the DS1 editor :

Code: Select all

caveSpre2.ds1
  (3, 85)
     |
     |
     |
caveNE2.ds1       caveSW.ds1
  (3, 62)   -----  (3, 57)
                       |
                       |
                       |
caveSE2.ds1       caveNW2.ds1
  (3, 58)   -----  (3, 61)
     |
     |
     |
caveNE.ds1       caveWspec.ds1
  (3, 62)   -----  (3, 95)
All ds1 are 25*25 tiles, despite the size in lvlmaze is 24*24, that's because the SizeX and SizeY columns in the LvlMaze.txt (but also in LvlPrest.txt and Levels.txt) are the coordinates of the bottom/right cell of the map, and the count start from 0, not 1.

Anyway, it's not always a straight pattern. With Rooms = 4, I had this kind of map :

Code: Select all

  O <----- Start
  |
  O-O <--- CorpseFire
  |
  O
Note : if someone would add a 2nd exit to the Den of Evil without changing the LvlType, he'd simply edit all the 4 ds1 of CorpseFire and add a Vis there (Warp), since that ds1 can only spawn 1 time in the DoE.



SECOND EXEMPLE (largely increased Den Of Evil)
This time in LvlMaze.txt I have set the Rooms to 20. I needed quite some time to revealed the entire map, but in the end here it is :
Large Den of Evil

The same, with a grid over it
Large Den of Evil (grid)

As you see, there's 21 DS1, and 24 nodes :

Code: Select all

  O-O-O
  | |
O-O O-O
|   | |
O-O-O-O
    | |
  O-O-O-O <--- start
  |   |
  O-O-O
    |
  O-O
  |
  O <--------- CorpseFire
So Rooms in LvlMaze.txt is the minimum number of DS1 that will compose the maze (the game may add some Rooms if necessary according to its internal Dungeon Room Logic Grid -DRLG- system). The total connections number between the DS1 is irrelevant.

Note 1 : for testing HUGE Rooms numbers someone will better have to make simple DS1 of 3*3 tiles. That way, even with that huge number of Rooms, since each rooms is very small, it won't take hours to explore it.

Note 2 : I think the maze must fit in Levels.txt. Here, we have 5 DS1 * 7 DS1, each one beeing 25*25 tiles, so the maze fit in an area of 125*175 Tiles, which are included into the 200*200 defined in levels.txt for the cave1. I haven't tried to make it larger (20 Rooms was quite long enough to explore for the purpose of just testing).


MAZE DS1 NAMING CONVENTION
I found that the elements composing a maze are 15 different ds1, all the possible combinations with at least 1 passage open. The name of the DS1 are not only easy to understand (like caveE for a cave with an open passage to the East), but they're also following a naming convention, and maybe in fact it's use deeply into the code...

Say that we use a number with 4 bits, each position for a given direction. N S E W is the order. Now, looks this :

Code: Select all

....NSEW
--------
00000000 =  0 = no opening, not used
00000001 =  1 = W
00000010 =  2 = E
00000011 =  3 = EW
00000100 =  4 = S
00000101 =  5 = SW
00000110 =  6 = SE
00000111 =  7 = SEW
00001000 =  8 = N
00001001 =  9 = NW
00001010 = 10 = NE
00001011 = 11 = NEW
00001100 = 12 = NS
00001101 = 13 = NSW
00001110 = 14 = NSE
00001111 = 15 = NSEW
now, looks the order of cave maze elements in LvlPrest.txt :
Act 1 - Cave W
Act 1 - Cave E
Act 1 - Cave EW
Act 1 - Cave S
Act 1 - Cave SW
Act 1 - Cave SE
Act 1 - Cave SEW
Act 1 - Cave N
Act 1 - Cave NW
Act 1 - Cave NE
Act 1 - Cave NEW
Act 1 - Cave NS
Act 1 - Cave NSW
Act 1 - Cave NSE
Act 1 - Cave NSEW

Looks familiar ? All element in all maze (cave, crypt, barracks ...) are following this pattern.

Be aware that in LvlPrest.txt each type of DS1 of a maze is coming into several variants (the columns File1 to File6). That way, when the game wants to use a NSE type DS1 for instance, it won't always take the same, it'll take one of the available variants of the NSE DS1, thus bringing variations if the final layout of the map. I'm not sure if you can *add* new variants tough, I was told that the game is hardcoded to only take 1 DS1 between the first 2 columns...


Now, let's make a map :

ds1 placment:

Code: Select all

O
|
O-O
|
O
openings needed :

Code: Select all

S
|
NSE-W
|
N
therefore, our values (and therefore also our DEF index *from the base*) :

Code: Select all

4
|
14-1
|
8

In summary, I think the game, when building a maze, use a table. Each element of this table (the Dungeon Room Logic Grid) should be a number between 1 and 15, telling not only the passages between the ds1 (the binary), but also in the meantime the name of the ds1 (associating a letter to each bit wich is set)... Therefore it's not so difficult to create a maze, so ... once this code is find, we might do some tricks easily (our own maze-building logic anyone ?)

Not really usefull for the end-user, but for a programmer that'll looks for a code, that may be interesting. Maybe one day we'll be able to code our own maps in the game ?

Also, be aware that the layout of the maze is dependant of the Level Type of the area. The number of Warps, the presence or not of Special DS1 (like CorpseFire in the Den of Evil)... is determined by the Level Type. Changing the Den of Evil from Act 1 Caves to Act 5 Ice Caves (there's a tutorial for that) makes the Den of Evil have 3 exits instead of 1. Also, the Arcane Sanctuary and the Nihlatak mazes for instance are always placing the entrance in the middle of the maze. That layout is something which is hardcoding, and that we can't change (yet ?).





Now, I'll let Myhrginoc speak :
I was able to climb up a couple of levels and find this code (v1.09b):

Code: Select all

6FD77190  /$  SUB ESP,438
6FD77196  |.  PUSH EBX
6FD77197  |.  MOV EBX,ECX                         
6FD77199  |.  PUSH EBP
6FD7719A  |.  PUSH ESI
6FD7719B  |.  MOV EAX,DWORD PTR DS:[EBX+20]
6FD7719E  |.  MOV ECX,DWORD PTR DS:[EBX]          
6FD771A0  |.  XOR EDX,EDX
6FD771A2  |.  PUSH EDI
6FD771A3  |.  MOV ESI,DWORD PTR DS:[EAX+8]        ;  "ptGetPreset"
6FD771A6  |.  MOV ECX,DWORD PTR DS:[ECX]
6FD771A8  |.  MOV EAX,DWORD PTR DS:[ESI+C]
6FD771AB  |.  MOV DWORD PTR SS:[ESP+30],EBX
6FD771AF  |.  MOV EDI,DWORD PTR DS:[ECX+4]
6FD771B2  |.  LEA EBP,DWORD PTR DS:[ESI+C]
6FD771B5  |.  CMP EAX,EDX
6FD771B7  |.  JNZ SHORT D2Common.6FD771E6
6FD771B9  |.  MOV EAX,DWORD PTR DS:[ESI+4]
6FD771BC  |.  LEA EAX,DWORD PTR DS:[EAX+EAX*2]
6FD771BF  |.  LEA EDX,DWORD PTR DS:[EAX+EAX*4]    ;  15 * [ESI+4]
6FD771C2  |.  MOV EAX,DWORD PTR DS:[ESI+8]        ;  ptr to LvlPrest.bin record
6FD771C5  |.  LEA EDX,DWORD PTR DS:[EAX+EDX*4+44] ;  get the name string for the file
6FD771C9  |.  PUSH EDX
6FD771CA  |.  MOV EDX,DWORD PTR DS:[ECX+8]
6FD771CD  |.  MOV ECX,EBP
6FD771CF  |.  CALL D2Common.6FD76AD0              ;  ds1 loader is down in here

Code: Select all

6FD771BF  |.  LEA EDX,DWORD PTR DS:[EAX+EAX*4]    ;  15 * [ESI+4]
[ESI+4] is the File Column Index in LvlPrest.txt (0 to 5 means column File1 to File6)
15 is the width of the string in the .bin for each File columns


Here are two records of a structure I have only a dim idea about, the second one was retrieved at line 6FD771A3. I do not know how this structure is loaded.

Code: Select all

05864100  55 00 00 00 00 00 00 00 80 9F 5E 02 80 5D 86 05  U.......€Ÿ^€]†
05864110  DC 05 00 00 E8 03 00 00 18 00 00 00 18 00 00 00  Ü..è........
05864120  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
05864130  00 00 00 00 00 00 00 00 C0 8B B4 02 00 00 00 00  ........À‹´....
05864140  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
05864150  00 00 00 00 80 40 86 05 00 00 00 00 00 00 00 00  ....€@†........
05864160  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
05864170  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
05864180  3E 00 00 00 01 00 00 00 B0 78 5E 02 00 00 00 00  >......°x^....
05864190  DC 05 00 00 00 04 00 00 18 00 00 00 18 00 00 00  Ü...........
058641A0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
058641B0  00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  ...............
058641C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
058641D0  00 00 00 00 00 41 86 05 00 00 00 00 00 00 00 00  .....A†........
058641E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
058641F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
Let's call this mystery structure ptGetPreset for now:

+00 DEF number from LvlPrest.bin
+04 File index number for fields File1 to File6 in LvlPrest.bin File# where # = (index+1)
+08 Record pointer for LvlPrest.bin
+10 OffsetX from Leveldefs.bin
+14 OffsetY from Leveldefs.bin
+18 SizeX from LvlPrest.bin
+1C SizeY from LvlPrest.bin
+54 previous record in a linked list of pGetPresets

Okay, now look at the actual LvlPrest.bin record:

Code: Select all

025E78B0  3E 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  >..............
025E78C0  00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00  ..............
025E78D0  00 00 00 00 00 00 00 00 18 00 00 00 18 00 00 00  ..............
025E78E0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E78F0  02 00 00 00 44 41 54 41 5C 47 4C 4F 42 41 4C 5C  ...DATA\GLOBAL\
025E7900  54 49 4C 45 53 5C 41 63 74 31 5C 43 61 76 65 73  TILES\Act1\Caves
025E7910  5C 43 61 76 65 4E 45 2E 64 73 31 00 00 00 00 00  \CaveNE.ds1.....
025E7920  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7930  44 41 54 41 5C 47 4C 4F 42 41 4C 5C 54 49 4C 45  DATA\GLOBAL\TILE
025E7940  53 5C 41 63 74 31 5C 43 61 76 65 73 5C 43 61 76  S\Act1\Caves\Cav
025E7950  65 4E 45 32 2E 64 73 31 00 00 00 00 00 00 00 00  eNE2.ds1........
025E7960  00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00  ............0...
025E7970  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7980  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7990  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E79A0  00 00 00 00 00 00 00 00 30 00 00 00 00 00 00 00  ........0.......
025E79B0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E79C0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E79D0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E79E0  00 00 00 00 30 00 00 00 00 00 00 00 00 00 00 00  ....0...........
025E79F0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7A00  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7A10  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7A20  30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  0...............
025E7A30  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7A40  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
025E7A50  00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  ...............
Stack build that defines LvlPrest.bin, now you can see where the data is in the record:

Code: Select all

0012ECB0   6FDC970C  ASCII "Def"
0012ECB4   00000002
0012ECB8   00000000
0012ECBC   00000000
0012ECC0   00000000
0012ECC4   6FDC9704  ASCII "LevelId"
0012ECC8   00000002
0012ECCC   00000000
0012ECD0   00000004
0012ECD4   00000000
0012ECD8   6FDC96F8  ASCII "Populate"
0012ECDC   00000002
0012ECE0   00000000
0012ECE4   00000008
0012ECE8   00000000
0012ECEC   6FDC96EC  ASCII "Logicals"
0012ECF0   00000002
0012ECF4   00000000
0012ECF8   0000000C
0012ECFC   00000000
0012ED00   6FDC96E0  ASCII "Outdoors"
0012ED04   00000002
0012ED08   00000000
0012ED0C   00000010
0012ED10   00000000
0012ED14   6FDC96D8  ASCII "Animate"
0012ED18   00000002
0012ED1C   00000000
0012ED20   00000014
0012ED24   00000000
0012ED28   6FDC96CC  ASCII "KillEdge"
0012ED2C   00000002
0012ED30   00000000
0012ED34   00000018
0012ED38   00000000
0012ED3C   6FDC96C0  ASCII "FillBlanks"
0012ED40   00000002
0012ED44   00000000
0012ED48   0000001C
0012ED4C   00000000
0012ED50   6FDC94E4  ASCII "SizeX"
0012ED54   00000002
0012ED58   00000000
0012ED5C   00000028
0012ED60   00000000
0012ED64   6FDC94DC  ASCII "SizeY"
0012ED68   00000002
0012ED6C   00000000
0012ED70   0000002C
0012ED74   00000000
0012ED78   6FDC96B8  ASCII "AutoMap"
0012ED7C   00000002
0012ED80   00000000
0012ED84   00000030
0012ED88   00000000
0012ED8C   6FDC96B0  ASCII "Scan"
0012ED90   00000002
0012ED94   00000000
0012ED98   00000034
0012ED9C   00000000
0012EDA0   6FDC96A8  ASCII "Pops"
0012EDA4   00000002
0012EDA8   00000000
0012EDAC   00000038
0012EDB0   00000000
0012EDB4   6FDC96A0  ASCII "PopPad"
0012EDB8   00000002
0012EDBC   00000000
0012EDC0   0000003C
0012EDC4   00000000
0012EDC8   6FDC9698  ASCII "Files"
0012EDCC   00000002
0012EDD0   00000000
0012EDD4   00000040
0012EDD8   00000000
0012EDDC   6FDC9684  ASCII "File1"
0012EDE0   00000001
0012EDE4   0000003B
0012EDE8   00000044                 <--- offset for beginning of file names
0012EDEC   00000000
0012EDF0   6FDC967C  ASCII "File2"
0012EDF4   00000001
0012EDF8   0000003B
0012EDFC   00000080
0012EE00   00000000
0012EE04   6FDC9674  ASCII "File3"
0012EE08   00000001
0012EE0C   0000003B
0012EE10   000000BC
0012EE14   00000000
0012EE18   6FDC966C  ASCII "File4"
0012EE1C   00000001
0012EE20   0000003B
0012EE24   000000F8
0012EE28   00000000
0012EE2C   6FDC9664  ASCII "File5"
0012EE30   00000001
0012EE34   0000003B
0012EE38   00000134
0012EE3C   00000000
0012EE40   6FDC965C  ASCII "File6"
0012EE44   00000001
0012EE48   0000003B
0012EE4C   00000170
0012EE50   00000000
0012EE54   6FDC9654  ASCII "Dt1Mask"
0012EE58   00000002
0012EE5C   00000000
0012EE60   000001AC
0012EE64   00000000
0012EE68   6FDC9508  ASCII "Expansion"
0012EE6C   00000002
0012EE70   00000000
0012EE74   00000020
0012EE78   00000000
0012EE7C   6FDC5404  ASCII "end"
0012EE80   00000000
0012EE84   00000000
0012EE88   00000000
0012EE8C   00000000

CONCLUSION
So, why this knowledge is important for you ? It'll be usefull if you're planing to completly edit the DS1 of a maze. For instance, if you want to make all the caves DS1 looks like an underground castle, you'll have to take care of these points :
  • You can resize the Rooms of the maze, but if you want to, then you'll have to edit all DS1 of that maze to be the exact same size, and edit LvlMaze.txt and LvlPrest.txt accordingly.
  • Follow the naming convention to know where to put the exit of each Room
  • Make the exit of each Room always at the same coordinates. For instance if you're making a ds1 like this :

    Code: Select all

    +---+
    |   |
    |   |
    |   [color=orange][b]X[/b][/color]
    +---+
    
    Then make all DS1 with East exit at the exact same coordinates, like :

    Code: Select all

    +XX-+
    |   |
    |   |
    |   [color=orange][b]X[/b][/color]
    +XX-+
    
    And don't forget to make all the West exit of the DS1 on the same coordinates also :

    Code: Select all

    +---+
    |   |
    |   |
    [color=orange][b]X[/b][/color]   |
    +---+
    
  • The higher the number of Rooms, the bigger the maze. But the final size of the maze is also dependant of the size of each Rooms. A 'big' maze (20 Rooms) with Rooms of only 3*3 tiles each is not that big in fact, while a maze of 5 Rooms but with each Rooms beeing 100*100 Tiles is huge.
EDIT : typos, and some new infos
Last edited by Paul Siramy on Mon Jun 23, 2003 12:10 pm, edited 5 times in total.

User avatar
Joel
Moderator
Dominion
Posts: 6921
Joined: Mon May 27, 2002 7:19 am
Location: Orsay
Contact:

Hand-picked

Re: MAZE and DS1 Mechanisms

Post by Joel » Mon Jun 23, 2003 11:17 am

:firedevil:
Well that will busy me for some days I think ..;
:firedevil:

/me starts to redo ALL the Arcane Sanctuary ds1 ....

Oh and a question :
What happen if we make a 1x1 or other very small ds1 for some exit combination ??
"How much suffering, mortal, does it take before you lose your grace?"
Shadow Empire (coming soon) | forum

User avatar
Paul Siramy
Retired staff
Principality
Posts: 2828
Joined: Sat May 25, 2002 2:39 pm
Location: La Garenne Colombes (near Paris)
Contact:
France

Hand-picked

Re: MAZE and DS1 Mechanisms

Post by Paul Siramy » Mon Jun 23, 2003 11:28 am

I think the Player needs 4 sub-tiles to be able to go thru a passage (note : 1 tile is composed of 5*5 sub-tiles), or maybe he needs 5 sub-tiles ? I don't remember. Anyway, making your DS1 having a passage of 1 Tile should be enough for the player (but maybe not for large monsters).

I forgot to mention it, but you can make the exits be 2, 3 or even more Tiles width, as long as you're taking care of the links between each Rooms, it's all right :

2 Rooms connected by a passage of 2 Tiles :

Code: Select all

+---+    +---+
|   X    X   |
|   X    X   |
|   |    |   |
+---+    +---+
will make this in game :

Code: Select all

+---+---+
|       |
|       |
|   |   |
+---+---+

User avatar
Red Havoc
Retired staff
Arch-Angel
Posts: 1191
Joined: Sun May 26, 2002 8:57 pm
Location: Berlin, Germany
Contact:

Re: MAZE and DS1 Mechanisms

Post by Red Havoc » Mon Jun 23, 2003 11:07 pm

Since Paul has already started a thread about map generation here, allow me to add some information I´ve gathered about random outdoor levels, the act1 wilderness in particular. Most of this stuff will be applicable to the act2 deserts and it´s likely the act4 mesa and act5 highlands work similar (I didn´t check the last two). The act3 jungle level generation, however, seems to work more like caves although it also has DRLGType set to 3.

How are the act1 wilderness areas generated? Certainly they differ quite much from random indoor level, as their size and shape is always the same, but the inner structure is different every game (although, if you play often enough you´ll see there are only a couple of variations of the outdoor levels - they are not completely random). For example, houses or shrines are always at different locations, stones, rocks, bushes etc. are placed without a recognizable structure. So how does it work?

I´ve broken my head about it for a long time, but finally I have at least a vague idea how they are generated. I can be wrong of course, but it seems logical to me and works fine as an imaginary model:

1. The borders of the level are calculated and drawn. This includes placing the exits of the map and whether there is a river or a stone cliff at one side etc.
The borders are composed of simple ds1 files (which can be edited):

Code: Select all

BordX.ds1 - these are the normal wilderness borders with trees and a stone wall
StnClfX.ds1 - the cliff borders in Stony Field and Dark Woods
XRiverX.ds1 - different versions of rivers as a border
Note: there are .ds1 with only fragments of cliff borders in them - I haven´t tested it, but I assume they are used similarly like random map objects - read below.

2. Next important thing should be the paths, the waypoints and internal level warps (caves, Countess Tower). The waypoints are randomly placed somewhere in the (still empty) map, except for the Cold Plains where it is always near the entrance. It might have to do with the two .ds1s containing the wp, but I don´t know.
The paths are probably generated dynamically. Though they look like they have some kind of a modular build (always the same elements like crossroads, path splittings etc.), there are no .ds1 files containing any path elements. The path creating routine is certainly complex, as it has to link all entrances as well as caves, bridges etc. To get rid of paths would be difficult, I think the only possibility so far is to edit the dt1 files.

3. After the paths have been drawn comes the really interesting part, interesting because it is finally something that can be changed to a larger extend :D . Now, some of the wilderness ds1 files you can find when browsing the mpq are placed. These are some examples of the files I´m talking about:

Code: Select all

circle.ds1 - a circular shape of little rocks
arrow.ds1 - an arrow made of little rocks
pond1.ds1 - a pond
etc.
These themed ds1s are also placed randomly somewhere in the map. As an illustration, see the following pictures where I have marked them in red squares (I also edited their floor so they are visible on the automap - just in case you wonder):

example 1
example 2

As far as I can tell, the number of such themed ds1s is static for every single outdoor area (I wonder where it is, that the game knows from there have to be X of them and not more or less - a dll table perhaps?). Additionally, there are always a couple of big bordered blocks, 1 or 2 houses, sometimes a burning house and five shrines in each area.
The range of themed ds1s differs from region to region, some maps also have special ds1s:

Cold Plains - Bishibosh Camp
Stony Field - the Cairn Stones, the Moldy Tome
Dark Woods - the Inifuss Tree, the big farm ruin, the fallen-crowded clearing

By editing these ds1s, you can change the levels to a good amount. If you want an additional warp in these maps or a certain boss, simply edit one of the ds1s which always spawns in that region. However, you must not change the size of any of these ds1s, as the DRLG routine expects them to have the size as stated in the txt files. Anything bigger will get cut down to the original size and will result in messy maps.

4. What´s left are the details of the map. That means all the stones and trees and swamps you find all around. Actually, the mechanism that spawns them seems to be really funky, because it takes elements out of a ds1 instead of spawning the whole thing at once. Check these ds1 images:

object.ds1
pud.ds1
stone.ds1
swamp.ds1
swamp2.ds1
trees.ds1

Looks weird, doesn´t it? Not like an ordinary .ds1, more like some kind of map designer concepts. But observe! Let´s give them all a floor tile which is visible on the automap, something like this:

example

And now we enter the game, walk around a bit and then have a peek at our automap:

Tadaa!

And in the normal game it looks like this. Obviously, the game has taken individual elements of the above ds1 files and placed them randomly on the map.
And that´s not enough! You did observe that, for instance the swamps from swamp2.ds1 didn´t appear in the Blood Moor, did you? That´s because of the SubTheme column in levels.txt, it limits or extends the range of those d1s that are used upon creation of the map.
By editing these random object .ds1s, you can again change the look of the wilderness levels. :) Unfortunately, it doesn´t seem like you can add new random objects - the ones I added for test purposes never appeared on the map.

These ds1s I spoke about are not listed in lvlprest.txt, instead, they are in lvlsub.txt. While part of this file is still mysterious to me, I think it works in some ways similar to TCex.txt. There are Prob columns, there are Trials (aka Picks) and a maximum number is also given. By editing these columns, you should be able vary the density of those random objects, but my results doing this were mixed so far. More testing needed.

Now, that step 4 is executed, the remaining gaps in the map get filled with ordinary floor tiles (grass). That´s it.
Last edited by Red Havoc on Mon Jun 23, 2003 11:15 pm, edited 1 time in total.
PLEASE READ THE TERMS OF SERVICE BEFORE POSTING

Avatar image is Scrat from 'IceAge' by Blue Sky Studios and Twentieth Century Fox

User avatar
Iohkus
Posts: 40
Joined: Sun Jun 08, 2003 1:29 pm

Re: MAZE and DS1 Mechanisms

Post by Iohkus » Tue Jun 24, 2003 2:31 am

so by changing the sub type of bloodmoor to that of darkwoods or black marsh you would make the blood moor coverd in trees or swampy bits?

great stuff :D looks like I'll be having some fun tomorrow
MEH!?

User avatar
Joel
Moderator
Dominion
Posts: 6921
Joined: Mon May 27, 2002 7:19 am
Location: Orsay
Contact:

Hand-picked

Re: MAZE and DS1 Mechanisms

Post by Joel » Tue Jun 24, 2003 7:43 am

Yes you can, it's a really esay changes.
Furthermore, you can also edit the random bits ds1 to add fog or whatever you like in these.
"How much suffering, mortal, does it take before you lose your grace?"
Shadow Empire (coming soon) | forum

Skylancer64
Posts: 39
Joined: Mon Jul 29, 2002 1:59 pm
Location: In front of the computer screen

Re: MAZE and DS1 Mechanisms

Post by Skylancer64 » Wed Jun 25, 2003 12:02 am

Ummmm, why is it that when I try to save this page for reference, I get an error? :(
Energizer Bunny arrested -- charged with battery. *grin*

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: MAZE and DS1 Mechanisms

Post by Alkalund » Wed Jun 25, 2003 1:19 am

Skylancer64";p="108429" wrote:Ummmm, why is it that when I try to save this page for reference, I get an error? :(
If you want to save it to your HD, click on the Printable Version option at the top right of the page. Then, you can ask your browser to display the source code of the page (in Internet Explorer for example, open the menu between 'Edit' and 'Favorites', and select Source Code). You can then save the source code as a html file. Not sure if there's a better method, but this one works quite nicely.

User avatar
Paul Siramy
Retired staff
Principality
Posts: 2828
Joined: Sat May 25, 2002 2:39 pm
Location: La Garenne Colombes (near Paris)
Contact:
France

Hand-picked

Re: MAZE and DS1 Mechanisms

Post by Paul Siramy » Wed Jun 25, 2003 10:31 am

As for me, with MS Internet Explorer, I also need to use the 'printable version', but then I use the "File / save as..." command, as this time it'll work. The nice point about using that command instead of just saving the source code is that it also save the images (well, the *smileys*, but they're important ;) )

Skylancer64
Posts: 39
Joined: Mon Jul 29, 2002 1:59 pm
Location: In front of the computer screen

Re: MAZE and DS1 Mechanisms

Post by Skylancer64 » Wed Jun 25, 2003 12:53 pm

Yay, it worked. Okay now, maybe we should move back on topic...

:D
Energizer Bunny arrested -- charged with battery. *grin*

User avatar
ChaosEnergy
Forum Regular
Angel
Posts: 677
Joined: Wed Dec 03, 2003 3:48 pm
Location: NRW
Contact:

Re: MAZE and DS1 Mechanisms

Post by ChaosEnergy » Sun Aug 22, 2004 8:53 pm

Hi

I tried to expand the act5 lava areas
Act 1 - Cave W
Act 1 - Cave E
Act 1 - Cave EW
Act 1 - Cave S
Act 1 - Cave SW
Act 1 - Cave SE
Act 1 - Cave SEW
Act 1 - Cave N
Act 1 - Cave NW
Act 1 - Cave NE
Act 1 - Cave NEW
Act 1 - Cave NS
Act 1 - Cave NSW
Act 1 - Cave NSE
Act 1 - Cave NSEW
in same way i expanded it for the lava areas..result doesnt work

hope anyone has an idea, how to expand it

Chaos
Chaos Empire Net
chaosenergy(a)chaosempire.net
Chaos Empire ® is a registered Trademark of Hans-Jürgen Ohler
Copyright by Hans-Jürgen Ohler (aka ChaosEnergy)2003 - 2015

User avatar
Black Heart
Retired staff
Angel
Posts: 748
Joined: Tue Sep 10, 2002 11:58 pm
Contact:

Re: MAZE and DS1 Mechanisms

Post by Black Heart » Fri Oct 08, 2004 8:15 am

This is a question in regards to maze generation with a level type that has variable amount of warps.

In this example I am currently working with level type 13 (Act3 sewers)

In its original level (Act 3 - Sewer 1 id 92) it has 4 warps using vis 0, 1, 2, 3, and 4.

Vis 0,1,2, and 3 are up warps and vis 4 is a down warp (the warp using the hidden stairs and the lever)

After linking in correct levels the only working warp is using vis 4 the down warp. On 0,1,2, and 3. I receive an hroom error. Witch in my experience is an incorrect link error. (Meaning that the warp destination level does not have a receiving warp)

After exploring the lvltype 13 maze. I found that the rooms containing the special warp tiles for 0,1,2,and 3 are not being drawn in the maze.

So guess my question is. is their a level check at work here influencing how may room containing warps are to be drawn in the maze?

Or something entirely different?
Sometimes we win with greater firepower, through sheer numbers or more powerful weapons, but for the most part it is knowledge that defines our victories. Know something and it has lost its power over you.

The Shadow Has risen!!!! Warped Tiles

User avatar
tmuhlhausen
Junior Member
Paladin
Posts: 104
Joined: Sat Aug 24, 2019 6:43 pm
Canada

Re: MAZE and DS1 Mechanisms

Post by tmuhlhausen » Wed Dec 11, 2019 11:16 am

You guys are my hero's, a lot of this info is still very relevant figured i should show some appreciation :P

Post Reply

Return to “Map Editing”