Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Text-based map file format

  
  1. #1
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Text-based map file format

    I'm thinking about creating a level format which would be text-only - no binary data.

    Here's my early concept, Eversmile:
    Code:
    [legend]
    . NEUTRAL EARTH
    - NEUTRAL PATH
    $ NEUTRAL GOLD
    ~ NEUTRAL WATER
    = PLAYER0 CLAIMED
    * PLAYER0 WALL
    H PLAYER0 HEART
    P NEUTRAL ENTRANCE
    [level]
    .......................................
    ...--..................................
    ..----.................................
    .-------.........PPP...................
    ..----...........PPP...................
    ...--............PPP...................
    .......................................
    .......................................
    .......................................
    .......................................
    ...............*******.................
    ...........*****=====*......~~~~~~.....
    ...........*===*=HHH=*$$$.~~~~~~~~~~~..
    ...........*=====HHH==$$$-~~~~~~~~~~~~.
    ...........*===*=HHH=*$$$.~~~~~~~~~~~..
    ...........*****=====*......~~~~~~.....
    ...............*******.................
    .......................................
    [things]
    object x y z model value
    creature x y model exp gold
    trap x y model ncharges
    action_point x y range
    light x y z range color
    [script]
    (standard DK1 script)
    Let me know what you think.

    Why am I doing this:
    I want KeeperFX levels to be stored in easy format, which would take full advantage of version control systems. Binary data is hard to compare, so if someone is changing a level - it's hard to say what was really changed.
    Also, it would be quite easy to write a level editor which creates levels in such form - it soesn't need any decrypting of DK level file format, this one is plain and self-explanatory.

    Text-based level file format - specification

    1. Basic structure

    Level files are divided into INI-like sections. Section starts with its name in square brackets, and ends with a start of another section, or end of file.
    Each section start must be in a separate line, with no non-white characters before or after square brackets.

    Standard sections are [legend], [level], [things] and [script]. These store level parameters with universal form.
    Additionally, there may be variants of each section used only for a specific game. The game is identified by a shortcut after a dot in section name, ie. [legend.DK1], [things.WFTO], [script.DK2]. If such game-specific section exists, level converter for that game will only use specific section and ignore the common variant of the section.
    Also, there may be new sections introduced by specific games - they should also keep the game name shortcut after dot, ie. [columns.DK1].
    Note that using varianted [level] section is a bad practice and should be avoided.

    Every line which do not contain non-white characters is ignored.
    The semicolon (;) is a comment indicator - all text between the semicolon and end of line is ignored, and the semicolon position is treated as end of line.
    The file should be coded in UTF-8, and have no BOM indicator at start. Line endings may be either Windows-style or Unix-style.

    2. Concept behind standard sections

    The [legend] section should assign owned rooms and terrain types to specific character. Then, in [level] seciton, the previously defined characters may be used to place those rooms on map area.

    Map size is determined by the amount of lines and amount of characters in each line of [level] section. The [level] section may only contain characters which purpose is defined in [legend] section.

    All additional items placed on the level are stored in [things] section. This section doesn't store items which are automatically placed in rooms (ie. no gravestones on the gaveyard), it only stores additional things - like creatures, additional light sources, traps, gold piles, effects. It also stores action points and static lights.

    The [script] section stores level script in a universal form. The LUA language will be used to create the universal form, but for now there's no specification of an universal script format. This is why, for now, only game-specific script blocks are used, ie. [script.DK1] or [script.DK2].

    3. Details of [legend] section

    Each line in this section stores 3 words separated by whitespaces.
    The first word must actually always be a single character, and defines the char to be used in [level] section. The character must be non-control and non-whitespace char (of code >32). Also, some characters are forbidden: [ ] ; and the char of code 255.
    The second word defines which player is the owner of the tile. Universal owner names are discussed later.
    The third word defines terrain or room type to be put on the tile. Universal terrain type names and room types are discussed later.
    All owner-specific [legend] sections will use the same basic scheme of 3 words, only specific words to be used will differ.

    4. Details of [level] section

    This section defines size of the level and its basic content - terrain types and their owners.
    Map width is determined by the amount of characters in each line; every line must have the same length. Map height is determined by amount of lines; lines which do not contain non-whitespace char are not counted. If a specific game has restrictions on map size, the map may be enlarged by a converter, and terrain around filled with unpenetrable rock.
    Every character used inside this section should be defined by a line in [legend] section.

    5. Details of [things] section

    The Universal things section contains a list of items placed on specific positions of the map. Each line of this section will add a new thing to the map. The amount of arguments in each line depends on what is being placed.
    What can be placed:
    - object
    - creature
    - trap
    - action_point
    - light

    WIP

    6. Details of [script] section

    Universal script format will be based on LUA scripting language. It will only contain basic commands, which are common to the supported games.

    More advanced scripting require game-specific sections. Those will contain commands in game-specific form.

    6.1. Section [script.DK1], specific to Dungeon Keeper

    This section should contain raw content of .txt script for Dungeon Keeper Level.

    6.2. Section [script.DK2], specific to Dungeon Keeper II

    This section should contain Dungeon Keeper II script written in a text form.
    The details are still to be decided - the game originally uses binary form of storing scripts.
    The text-based form should be made in a way which allows simple 1:1 translation between text and binary forms.

    6.3. Section [script.KFX], specific to KeeperFX

    This section should contain raw content of .txt script for KeeperFX.
    While KeeperFX may use [script.DK1] section, it also introduces some new commands, which doesn't exist in original Dungeon Keeper. In case such commands are used, the KeeperFX specific script section should be used.

    7. Owner names

    WIP

    7.1. Owner names specific to Dungeon Keeper

    Any sections specific to that game will use the following owner names:

    PLAYER0
    PLAYER1
    PLAYER2
    PLAYER3
    PLAYER_GOOD
    PLAYER_NEUTRAL


    8. Terrain/room types

    8.1. Terrain/room names specific to Dungeon Keeper

    Any sections specific to that game will use the following terrain names:

    HARD
    GOLD
    DIRT
    TORCH_DIRT
    DRAPE_WALL
    TORCH_WALL
    TWINS_WALL
    WOMAN_WALL
    PAIR_WALL
    PATH
    PRETTY_PATH
    LAVA
    WATER
    GEMS

    And available room names are as below:

    ENTRANCE
    TREASURE
    RESEARCH
    PRISON
    TORTURE
    TRAINING
    DUNGEON_HEART
    WORKSHOP
    SCAVENGER
    TEMPLE
    GRAVEYARD
    GARDEN
    LAIR
    BARRACKS
    BRIDGE
    GUARD_POST
    DOOR_WOODEN
    DOOR_BRACE
    DOOR_STEEL
    DOOR_MAGIC
    Last edited by mefistotelis; December 21st, 2013 at 10:14.

  2. #2
    Spider
    Join Date
    Mar 2013
    Location
    Cardiff, UK
    Posts
    206

    Default Re: Text-based map file format

    Is it important to have version control? If this makes a new editor more likely, then great.

    I have been wondering about random level generators - thoughts?

    Dayo

  3. #3
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Text-based map file format

    Quote Originally Posted by dayokay View Post
    Is it important to have version control?
    I would feel better having all levels in SVN, and submitting them in binary form doesn't make much sense.

    Making that happen requires lot of work, so I'm not sure I'll implement such format.
    Still, it opens quite a few possibilities.
    For example, we could figure out a way to make this a "universal" DK level format - which could be "compiled" to DK1 or DK2 level.
    I don't have enough knowledge about DK2 scripting to do this, but I believe it's possible.
    I don't know about WFtO level concepts, but it is possible to make this format useable for WFtO too. That would only need some kind of "replacements list" for creatures and rooms.
    Also, this makes it easy to share levels - everything about a level is written in one file, so it's even possible to just paste a whole level into a forum post.


    Quote Originally Posted by dayokay View Post
    I have been wondering about random level generators - thoughts?
    Have you tried "random background generator" from ADiKtEd? From there, it's very easy to make levels - just place 2 hearts with 3 imps near each, insert basic template to TXT script and you have a whole level.
    Still, I don't think people would like to play such random levels.

  4. #4
    Ghost
    Join Date
    Dec 2010
    Location
    Madrid, Spain
    Posts
    368

    Default Re: Text-based map file format

    I think is a good idea but the bad thing is that levels done for Dungeon Keeper, won't be read by KeeperFX if text-based map file format is used. We will need a conversion tool to convert they from original level format (binary) to the new level format (text based).

  5. #5
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Text-based map file format

    Unfortunately, the DK2Mapper author lost his source code.

    I contacted him and searched for other sources a few years ago, and I came up with a simple tool which reads basic structures of DK2 maps.

    It's here:
    http://keeper.lubie.org/html/dk2_tools_other.php

    I remember being able to understand most files, but I didn't tried to get deeper into script format. Anyway, this is what the tool can do out of level 20:
    Code:
     ___________________________________________________________________________________________________
     _BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB_
     _BBBBBBBBBBBBBBBBBBBBBBBBKKBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB_
     _BBBBBBBBBBBBBBBBBBBBBBIIKKIBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB_
     _BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB_
     _BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB_
     ___________________________________________________________________________________________________

  6. #6
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Text-based map file format

    Quote Originally Posted by Wyrmcast View Post
    You seem to already know how the tile placement and other things work so I'm guessing that's not an issue for you.
    That's the issue - I'm not really planning to do that.

    Looking at your answers, I think the text-based format would fit best as kind of "level source code" - which can't be read by any game by itself, but levels from various games can be converted to text format, and also text format can be converted to level in various games.

    I would probably only work on DK1 converter - someone else would have to work on others.

    But to make all that happen, we still need to figure out some kind of "universal script format". Also, there woulds probably be sections with hacks for specific games - ie. for "custom columns" in DK1, or with more advanced scripting which is only supported in DK2.

    Let me know if you have any more thoughts.

  7. #7
    Beetle Stanislas Dolcini's Avatar
    Join Date
    Aug 2012
    Location
    France
    Posts
    113
    Gamer IDs

    Steam ID: StanleySweet Raptr ID: stanleysweet

    Default Re: Text-based map file format

    Well that would just imply that we need to have two or three formats. Or that in the header of such files, a thing that decides if its DK1 DK2 or whatever. And if so, more special characters (to draw the map) would be allowed.

    I was wondering, if we make a program that does such maps, all he would have to do is convert the binary format and with fprintf write the character bound to that format so let's say 89(hex) is a ground tile he would write "." and this for the number of tiles. Reversing that to make the levels with text files, shouldn't be that hard, but what about objects ?
    Last edited by Stanislas Dolcini; November 7th, 2013 at 22:57.

  8. #8
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Text-based map file format

    Quote Originally Posted by Stanislas Dolcini View Post
    Well that would just imply that we need to have two or three formats. Or that in the header of such files, a thing that decides if its DK1 DK2 or whatever. And if so, more special characters (to draw the map) would be allowed.
    Characters would be the same, only their function would be different. So that would need two separate "[legend]" blocks - ie. for DK2 make combat pit, for DK1 make just another training room.

    Quote Originally Posted by Stanislas Dolcini View Post
    I was wondering, if we make a program that does such maps, all he would have to do is convert the binary format and with fprintf write the character bound to that format so let's say 89(hex) is a ground tile he would write "." and this for the number of tiles. Reversing that to make the levels with text files, shouldn't be that hard
    Converting slabs would be the easiest part, but characters would have to be assigned dynamically - ie. use "t" for treasury, but if 't' is taken, then use 'T', and if it's also taken, use another char.

    Quote Originally Posted by Stanislas Dolcini View Post
    but what about objects ?
    Objects which are room equipment (workshop machines, trainers, scavenge eyes, heart etc) would be placed automatically.
    Other objects (decorations, traps, creatures, action points) would be listed in "[things]" block.

  9. #9
    Moderator MaxHayman's Avatar
    Join Date
    Sep 2009
    Location
    London, England
    Posts
    220
    Gamer IDs

    Gamertag: Max Hayman PSN ID: Ballwinkle XFIRE ID: elmaxaman Steam ID: ballwinkle

    Default Re: Text-based map file format

    I was looking into something like this when I was making a random map generator/editor from NBK. Sounds like a good idea!

  10. #10
    KeeperFX Author mefistotelis's Avatar
    Join Date
    Sep 2009
    Location
    Poland
    Posts
    1,242

    Default Re: Text-based map file format

    Added spec draft to 1st post.

    To discuss:
    - which chars should be forbidden for [legend] section?
    - How universal names of players should look like?
    - How universal names of terrain should look like?
    Last edited by mefistotelis; December 18th, 2013 at 10:57.

Similar Threads

  1. DK2 texture format
    By Trass3r in forum Dungeon Keeper 2
    Replies: 69
    Last Post: January 16th, 2020, 19:27
  2. Sound bank file format description
    By mefistotelis in forum KeeperFX
    Replies: 10
    Last Post: June 18th, 2014, 12:19
  3. Homeworld Cataclysm - based story
    By Keeper Decagon in forum Off Topic
    Replies: 1
    Last Post: November 20th, 2013, 12:17
  4. Reveal Map in Assault-Based Maps
    By Zyraen in forum DK1 Mapmaking
    Replies: 2
    Last Post: June 1st, 2011, 16:31

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •