Map editing : how to start

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

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

Hand-picked

Map editing : how to start

Post by Paul Siramy » Fri Oct 19, 2018 1:12 pm

Questions about how to edit other ds1 in win_ds1edit than the one that comes with the zip are redundant. I guess a fixed post about the subject should have appear long ago. So let's make one.

First, you have to know that win_ds1editor is a DS1 editor, not an AREA editor. Some areas like Tristram are composed of only 1 ds1, so it's easy in this case, but some other areas are composed of multiple ds1, like Outdoors (Stony field) and Mazes (Jail).

Here are the important .txt you have to open in Excel or any other similar spreadshet :
  • Data\Global\Excel\Levels.txt
  • Data\Global\Excel\LvlMaze.txt
  • Data\Global\Excel\LvlPrest.txt
  • Data\Global\Excel\LvlSub.txt
  • Data\Global\Excel\LvlTypes.txt
The first thing to do is to check Levels.txt, to know what type the area you want to edit is. Sometimes the Name column is not explicit enough to know what an area is, so a good idea is to check another column, near the end, which is named LevelName. You can even move that column next to the Name column and save the .txt like that, since the order of columns in the .txt is not important for the game. In Levels.txt, the column DrlgType whill tell you what type the area is :
  • 1 = Maze
  • 2 = Preset
  • 3 = Outdoor
Mazes are handled by LvlMaze.txt, Presets by LvlPrest.txt, and Outdoors are a bit complex as their infos are in Levels.txt, LvlSub.txt and LvlPrest.txt.

For reference, here are the Mazes of Act 1 :
  • Den of Evil
  • Cave Level 1
  • Underground Passage Level 1
  • Hole Level 1
  • Pit Level 1
  • Crypt
  • Mausoleum
  • Tower Cellar Level 1
  • Tower Cellar Level 2
  • Tower Cellar Level 3
  • Tower Cellar Level 4
  • Barracks
  • Jail Level 1
  • Jail Level 2
  • Jail Level 3
  • Catacombs Level 1
  • Catacombs Level 2
  • Catacombs Level 3
The Presets of Act 1 :
  • Rogue Encampment
  • Cave Level 2
  • Underground Passage Level 2
  • Hole Level 2
  • Pit Level 2
  • Forgotten Tower
  • Tower Cellar Level 5
  • Monastery Gate
  • Outer Cloister
  • Inner Cloister
  • Cathedral
  • Catacombs Level 4
  • Tristram
And the Outdoors of Act 1 :
  • Blood Moor
  • Cold Plains
  • Stony Field
  • Dark Wood
  • Black Marsh
  • Tamoe Highland
  • Burial Grounds
  • Moo Moo Farm
The easiest areas to edit are the Preset, as it's only 1 to 6 ds1 to edit (1 preset can come into a max of 6 variations, we'll see that later). Mazes are areas that are more or less easy to edit.

Preset areas
So, let's start with basic editing. I have already cover it in the topic Ds1edit docs + usefull links, in the sections Adding a ds1 to edit and Finding easily what are the ID and DEF of a DS1 . Here's a copy/paste of these parts :
Adding a ds1 to edit
My ds1edit.exe works the same way as my ds1scene.exe, that means you have to give parameters to the prog. Copy a .bat and rename it. Let's say you want to edit the town in act 2.
  1. Extract the ds1 in the directory of ds1edit. You better have to check first in patch_d2.mpq in case there's an update of this map, else in d2exp.mpq, else d2data.mpq. In our case, it's in d2data.mpq, but there are several ds1. Let's take \Data\Global\Tiles\Act2\Town\lutN.ds1
  2. copy a .bat and rename it, for instance "act2_town_N.bat"
  3. open the "LvlTypes.txt" of the game in Excel (or D2Excel), and look for the appropriate ID. In our case the choice is easy, it's "Act 2 - Town" and therefore the Id is 12 (this is NOT the row, but the Id you take).
  4. Open the "LvlPrest.txt" of the game and choose the good DEF. In our case, it's again easy : it's the row having "Act 2 - Town", and therefore the Def is 301.
  5. Edit the "act2_town_N.bat". Change the command line to have something like
    win_ds1edit lutN.ds1 12 301 > act2_town_N.txt
  6. launch the .bat. If your parameters are ok, you'll see the town correctly. If problems appear, that's because one, or both number parameters are false, retry with another values.
Finding easily what are the ID and DEF of a DS1
I'm using DRTester, made by Sloan Roy. Get it here (from the "file center / mod making tools / animation editing" section), or from SVR website (click on "Dr. Tester" and pick 1 of the zip). Whatever the version, you should be able to use it for finding ID and DEF as follow :
  1. launch DRTest.exe
  2. in the File menu, choose the mpq you want to browse, for instance D2Data
  3. use the file selector dialog box to quickly jump to your ds1 file by typing its full path,
    for instance data\global\tiles\ACT1\Graveyard\gravey.ds1
  4. Usually, the DEF is found automaticaly, check the upper / right window (the LvlPrest.txt file datas).
    Here, the line 108 : Act 1 - Graveyard is already selected, that's the DEF value you'll give to the ds1 editor

    If DrTester don't find the DEF value, that's because you're editing a special DS1. Open LvlSub.txt in Excel, and check if your DS1 is not there. If it is, then check its Dt1Mask value, and in LvlPrest.txt search for a line that have this EXACT same Dt1Mask, and use that DEF value (it's a trick). If the DS1 is not in LvlSub either, then good luck... as it's now the common Trials and Error method in DrTester, and you're not even sure that you'll find a good value. Btw, for common map editing, you don't have to edit DS1 that are not in LvlPrest.txt, so DrTester will be usefull for you.
  5. click 2 times on the '-' button, to have a Zoom of 0.25, just to have a larger view of the map
  6. now in the bottom / right window, try several Level Type lines, until the map looks good for you.
    Here, it's the line 2 : Act 1 - Wilderness, that'll be your ID value.
  7. You can drag and move the map by clicking on the image with the left button, keep the button hold, and then move the mouse. It's the "Ctrl + Home" keys to recenter the map automaticaly if you're lost (can happen by moving far from the center and then zooming in)
  8. ---> You have found the ID and DEF values to use with the editor (here 2 and 108).
I'll just add 3 things that were not mentionned.

First, DarthDevilous as made a very usefull front-end program for my ds1 editor. Check the sticky topic GUI Loader for Paul's ds1edit. With this tool you don't have to deals with .bat, .ini, LvlTypes ID nor LvlPrest DEF.

Second, I have added some months ago a new feature to my ds1 editor, it also can try to find itself the correct LvlPrest DEF, basing its search on the ds1 filename you're editing. So instead of searching Lut Gholein in LvlPrest.txt, you can use the -1 value as follow :
win_ds1edit lutN.ds1 12 -1 > act2_town_N.txt
Since there's one and only one "lutN.ds1" in LvlPrest.txt, the editor will find it, and then will automatically use the correct LvlPrest DEF, avoiding you to search yourself.

Third, some ds1 comes in more than 1 version. Lut Gholein for instance use 2 ds1. In LvlPrest.txt, check the columns File1 to File6. You'll find all the possible ds1 for an area. Here they're "Act2/Town/LutW.ds1" and "Act2/Town/LutN.ds1". You can either make 2 .bat, or better create a .ini to loads them simultaneously in the ds1 editor :

Code: Select all

12 -1 LutW.ds1
12 -1 LutN.ds1
and you save it with the name you want, like "act2_town.ini". Now, to use this .ini you edit the Lut Gholein .bat like this :
win_ds1edit act2_town.ini > act2_town.txt
This should be enough for editing Preset areas.


Mazes areas
Mazes are a bit complex. Read the topic Understand the Mazes and DS1 mechanism.


Outdoor areas
Red Havoc has made a post about Outdoor generation, check it there.


Other usefull links
Many informative topics have already been made. Here's a list of interesting ones (they're mainly sticky topics in this forum, or links found within them) : For comments/suggestions/errors/whatever about this guide : create a new topic (I'd like to keep a 'clean' guide ;) )


Edit 06 february 2005 : added link to "Making A New Preset Level"
Edit 21 march 2005 : added link to "Guide to Mapping"
Edit 12 october 2005 : added link to "[Tutorial] Creating new static automaps - Harogarth automap"
Edit 18 october 2005 : added link to "Map Editing Errors - A starting place"
Edit 28 october 2005 : added link to "Complete Lvlprest.txt Fileguide"
Edit 31 march 2011 : updated links
Edit 01 october 2011 : added link to "A Simple Mans Guide to Adding a New Preset Level"
Last edited by Ogodei on Fri Oct 19, 2018 1:12 pm, edited 11 times in total.
Reason: Hopefully fixed all of the dead links.

Locked

Return to “Map Editing”