Duke 1 Level Format

From ModdingWiki
Jump to navigation Jump to search
Duke 1 Level Format
Duke 1 Level Format.png
Format typeMap/level
Map type2D tile-based
Layer count1
Tile size (pixels)16×16
Viewport (pixels)208×160
Games

The levels in Duke Nukem 1 are stored in the files WORLDALx.DNy, where y is the episode number, and x is the level number, going from 1-9 then A-C. Oddly, level 2 is the intermediate level and level C is the demo level.

Level structure is very simple, each level is 128x90 tiles in size and consists of 11520 UINT16LE words (23040 bytes) of data. Each word controls what appears on one tile in the level. (The level has only one plane, containing background, foreground and enemies. Thus each word is sometimes called a ShapeThing. Because of this limit, the game has some interesting shortcuts to allow things to appear more naturally, such as an enemy tile using the tile before it as its background.) The following values control what appears:

Range (hex) Class Description
0000-05FF Flashers Animated backgrounds or stationary backdrops, Duke can pass through these.
0600-17FF Backgrounds Static background objects that Duke can pass through.
1800-2FFF Solids Static foreground objects that Duke cannot pass through.
3000-3059 Active This is the fun stuff, all the things that move, such as techbots, bonuses, items, Duke's starting location, hazards (spikes, force fields), doors, keyholes/access slots, conveyor belts and some special effect items (such as mirror floor and transparent windows).
306A-FFFF (Hacks) Static foreground objects that Duke cannot pass through. The first tiles use tile images from BORDER.DN? and most of the later tiles are displayed as random junk. All of these tiles are clingable.

Tile mapping

The Level's tiles use tile graphics from 8 files: BACK0.DN? through BACK3.DN? and SOLID0.DN? through SOLID3.DN?. Tiles from BORDER.DN? can also be used, though they are not "officially" supported.

Each file contains 48 tiles (at least the game loads 48 tiles from each file), so there are 384 "actual" tiles. Due to the way the tile graphics are stored in memory, you need to divide the tile value by 32 (EGA plane size of a 16x16 pixel tile) to get a tile index from the data stored in the level file.

Range (hex) File
0000-05FF BACK0.DN?
0600-0BFF BACK1.DN?
0C00-11FF BACK2.DN?
1200-17FF BACK3.DN?
1800-1DFF SOLID0.DN?
1E00-23FF SOLID1.DN?
2400-29FF SOLID2.DN?
2A00-2FFF SOLID3.DN?
3000-367F Varies, see below
4000-? current backdrop 1 (hack)
8100-? current backdrop 2 (hack)

Active

The follow tiles appear to be manually mapped. These tile codes from the map do not need to be divided by 32, unlike the other tilecodes.

Tile code (hex) File Tile index Type Description
3000 OBJECT0.DN1 0 Bonus Grey box, empty
3001 OBJECT0.DN1 5 Interactive Elevator
3002 ! ? ? Interactive Left-moving conveyor belt start, must be left of end tile
3003 ! ? ? Interactive Left-moving conveyor belt end, must be on right of start tile
3004 ! ? ? Interactive Right-moving conveyor belt start, must be left of end tile
3005 ! ? ? Interactive Right-moving conveyor belt end, must be on right of start tile
3006 OBJECT0.DN1 10 Bonus Grey box (0 @ OBJECT0.DN1), contains shoes
3007 OBJECT0.DN1 11-17 Interactive Rocket, tile below is replaced with default tile after rocket takeoff
3008 OBJECT0.DN1 18 Bonus Grey box (0 @ OBJECT0.DN1), contains ceiling-clinger
3009 OBJECT0.DN1 24-28 Hazard Flamethrower, firing to the right (three tiles wide including placement tile)
300A OBJECT0.DN1 29-33 Hazard Flamethrower, firing to the left (three tiles wide including placement tile)
300B ANIM0.DN1 0-5 Enemy Floating 1x1 robot with purple antenna
300C ANIM0.DN1 10-33 Enemy Jumping 2x2 robot
300D ANIM0.DN1 34-41 Enemy Wheeled 2x1 robot with blue wheels
300E ANIM1.DN1 0-31 Enemy 2x2 rotating wheel with flames
300F OBJECT0.DN1 43 Bonus Grey box (0 @ OBJECT0.DN1), contains raygun (ammo)
3010 ANIM1.DN1 32 Enemy 1x1 robot
3011 - - - Exit door (only 1 instance allowed!)
3012 ANIM2.DN1 17 Bonus Grey box (0 @ OBJECT0.DN1), contains dynamite
3013 ANIM2.DN1 24-31 Enemy Flying orb monster, each shot removes one orb
3014 - - Decorative Shimmering water effect, also affects tile below this one
3015 ANIM2.DN1 32-35 Bonus Red box (1 @ OBJECT2.DN1), contains soda can
3016 ANIM2.DN1 40-43 Enemy Green bitey creature walking up and down walls, facing right
3017 ANIM2.DN1 44-47 Enemy Green bitey creature walking up and down walls, facing left
3018 OBJECT0.DN1 44 Bonus Red box (1 @ OBJECT2.DN1), contains turkey drumstick
3019 ANIM3.DN1 0 - Bridge that explodes when stepped on twice (only 1 instance allowed!)
301A OBJECT1.DN1 0-3 Hazard Blue force field, horizontal
301B ANIM3.DN1 12-19 Hazard Rotating fan blades, blowing left
301C ANIM3.DN1 12-19 Hazard Rotating fan blades, blowing right
301D OBJECT1.DN1 8 Bonus Blue box (0 @ OBJECT2.DN1), contains football
301E OBJECT1.DN1 9 Bonus Blue box (0 @ OBJECT2.DN1), contains joystick
301F OBJECT1.DN1 10 Bonus Blue box (0 @ OBJECT2.DN1), contains "DN" floppy
3020 OBJECT1.DN1 13 Bonus Grey box (0 @ OBJECT2.DN1), contains robohand
3021 OBJECT1.DN1 15-18 Hazard White/blue force field, vertical
3022 ANIM3.DN1 20-47 Enemy Helicopter
3023 OBJECT1.DN1 19-23 Bonus Blue box (0 @ OBJECT2.DN1), contains balloon
3024 ANIM4.DN1 8-10 Bonus Security camera
3025 ANIM4.DN1 11 Decorative Brown spikes
3026 ANIM4.DN1 12 Decorative Rock, left half
3027 ANIM4.DN1 13 Decorative Rock, right half
3028 ANIM4.DN1 14 Decorative Grey rounded window
3029 OBJECT1.DN1 24 Bonus Grey box (0 @ OBJECT0.DN1), contains nuclear molecule
302A OBJECT1.DN1 33 Hazard Loose/falling ACME sign
302B OBJECT1.DN1 34 Hazard Blue reactor
302C OBJECT1.DN1 45-46 Hazard Spike, pokes up when walking over
302D OBJECT1.DN1 47-49 Bonus Blue box (0 @ OBJECT2.DN1), contains magenta flag
302E OBJECT2.DN1 2-4 Bonus Blue box (0 @ OBJECT2.DN1), contains radio
302F ANIM4.DN1 20-28 Interactive Teleporter, transports to tilecode 3030
3030 ANIM4.DN1 20-28 Interactive Teleporter, transports to tilecode 302F
3031 ANIM4.DN1 31 Hazard Spiky round red bomb, bouncing
3032 - - Interactive Player start point
3033 OBJECT1.DN1 14 Bonus Grey box (0 @ OBJECT0.DN1), contains access card
3034 OBJECT2.DN1 5-12 Interactive Access card activation point
3035 OBJECT2.DN1 14-15 Interactive Robohand activation point
3036 ! ? ? ? Red girder, creates a bridge when Robohand activation point is used
3037 OBJECT2.DN1 21 Bonus Grey box (0 @ OBJECT0.DN1), contains "D"
3038 OBJECT2.DN1 21 Bonus Grey box (0 @ OBJECT0.DN1), contains "U"
3039 OBJECT2.DN1 21 Bonus Grey box (0 @ OBJECT0.DN1), contains "K"
303A OBJECT2.DN1 21 Bonus Grey box (0 @ OBJECT0.DN1), contains "E"
303B ANIM2.DN1 18-23 Bonus Purple rabbit thing, 5000 bonus points
303C ANIM5.DN1 1 Enemy Fire monster
303D ANIM5.DN1 12 Decorative Diamond-shaped wire mesh
303E ANIM5.DN1 13 Decorative Window showing through to backdrop, left half
303F ANIM5.DN1 14 Decorative Window showing through to backdrop, right half
3040 OBJECT2.DN1 23 Interactive Message, press up to read (blank message for most levels?)
3041 - - - Screen display with Dr. Proton
3042 ANIM5.DN1 30-42 Enemy Dr Proton, E3 boss, killable ("I won it all!", game ends)
3043 ANIM5.DN1 30-42 Enemy Dr Proton, E1 boss, not killable (escapes to moon, game ends)
3044 OBJECT2.DN1 24 Interactive Door key, red
3045 OBJECT2.DN1 25 Interactive Door key, green
3046 OBJECT2.DN1 26 Interactive Door key, blue
3047 OBJECT2.DN1 27 Interactive Door key, magenta
3048 OBJECT2.DN1 37 Interactive Door lock, operated by red key
3049 OBJECT2.DN1 38 Interactive Door lock, operated by green key
304A OBJECT2.DN1 39 Interactive Door lock, operated by blue key
304B OBJECT2.DN1 40 Interactive Door lock, operated by magenta key
304C OBJECT2.DN1 28 Interactive Door, opened by red lock
304D OBJECT2.DN1 28 Interactive Door, opened by green lock
304E OBJECT2.DN1 28 Interactive Door, opened by blue lock
304F OBJECT2.DN1 28 Interactive Door, opened by magenta lock
3050 OBJECT1.DN1 8 Bonus Football
3051 OBJECT0.DN1 44 Bonus Turkey drumstick
3052 ANIM2.DN1 32-35 Bonus Soda can
3053 OBJECT1.DN1 10 Bonus "DN" floppy disk
3054 OBJECT1.DN1 9 Bonus Joystick
3055 OBJECT1.DN1 47-49 Bonus Purple flag
3056 OBJECT2.DN1 2-4 Bonus Radio
3057 ANIM4.DN1 31 Hazard Spiky round red bomb, stationary, explodes on touch
3058 OBJECT2.DN1 48 Hazard Spikes, poking up
3059 OBJECT2.DN1 49 Hazard Spikes, poking down

Links

There are numerous level editors available, from the basic original ASCII one, to rather advanced ones capable of rendering animations.

  • Maps can be found at vgmaps.com
  • The original level editor is at Dook Nookim Klassik
  • A reasonable level editor can be found at crystalshard.net
  • Possibly the best editor is DN1MOD, which renders levels as the game does, by loading the game's graphics files [1]