Skip to content
furrykef edited this page Nov 6, 2014 · 15 revisions

How to

Creating new levels is not for the faint of heart. It isn't enough to put some tiles and sprites on the board; almost any level will require special code to function properly. This requires knowledge of Z80 assembly language. In the future, we will aim to make this as easy as we can manage, but it will probably always involve at least a little Z80 code hacking.

We will use Tiled to create levels. Tiled is a general-purpose level editor suitable for making levels for many types of games.

Starting a new level

Levels for Donkey Kong are 28 tiles by 32 tiles, with each tile being 8x8 pixels. The orientation is orthogonal and the tile layer format should be XML. The tile render order is irrelevant and will be ignored.

The top four rows of tiles are reserved for the status display, so tiles probably should not be placed there; however, sprites may be placed there from time to time if they don't overlap any status information. (For instance, Pauline appears here in the rivets level, and black sprites are used here to have DK cropped cleanly as he climbs the ladders after each level.)

Since DK is such a (let's face it) primitive game, many of Tiled's features must go unused. The following features cannot be used:

  • Multiple tile layers
  • Image layers
  • Object rotation (but horizontal and vertical flipping does work)
  • Terrains
  • Polygons, or any other objects other than sprites
  • Layer opacity
  • Automapping
  • Tile animations
  • Tile collisions

Try getting too fancy and our tools will complain, misbehave, or simply ignore what they don't understand. If you just stick to placing tiles and sprites and follow this guide, though, there should not be any issues.

The tilesets

To be written.

Placing objects

To place sprites, make sure "snap to fine grid" is enabled. In your preferences, make sure "fine grid divisions" is 8. This will ensure objects snap to pixels. If your objects aren't snapped to pixels, the exporter will snap them for you, but it might not snap to the pixel you wanted.

Be careful not to place sprites on the tile layer or tiles on the sprite layer.

For DK and Pauline, only the position of their heads is used to determine their position. Any part of DK or Pauline other than the head will be ignored and is only useful for illustrative purposes; their bodies will be added back in automatically by the game's level loader. DK's head may be any of sprites 32 through 36 inclusive (i.e., any of the sprites of his head facing the viewer). Which one you use does not matter and will not affect how DK appears in the game.

You may want to set the object layer's properties to use manual drawing order instead of top-down. This will allow you to place DK's arms in front of his chest instead of behind it. This particular issue does not affect how he will appear in the game, however.

Level design tips

Don't make your game too hard! This was the main flaw of the old D2K: Return of Jumpman hack. Remember that newcomers to your hack have never played it before, whereas you've probably spent hours playtesting your stages. The stage should be quite easy for you, but challenging for new players. Have playtesters record videos and see how they play. Ideally, they'll lose a couple of lives on their first few attempts, but soon get the hang of it.

Don't make your levels too linear. Every single level in the original DK had multiple paths the player could take. Hazards such as fireballs could be used to sometimes force the player to take a path he wouldn't otherwise have taken.

Remember that the original game had at least one unique concept per stage. The first stage had ramps and barrels; the second stage had conveyors and cement pies; the third stage had elevators and springs; the fourth stage had rivets. Donkey Kong Junior followed this philosophy as well except in its first stage.

You don't necessarily have to implement a new mechanic for every stage, but try to keep things fresh.

Don't clutter your stage. Make sure there aren't so many objects that the eye cannot quickly process everything.

Don't follow a "kitchen sink" philosophy of throwing in everything you can think of. Follow the philosophy of Antoine de Saint Exupéry: perfection is attained not when there is nothing left to add, but when there is nothing left to take away.

Be sure to consider putting the three bonus items in the stage. If you don't include any bonus items, make sure it's by choice, not negligence. Also notice that every stage that included them included all three.

Likewise, don't forget hammers. Every stage except the elevator stage had two hammers.

Do not put bonus items in locations where it would be pointless to try to get them, either due to excessive risk or because collecting them would take more points off the clock than you'd get as a reward.

Notice the thought that went into the original stages' design. In the barrel stage, it's always the longest ladders that are broken, the implication being they were stretched past their breaking point. The elevators in the elevator stage also likely go in opposite directions for a reason: the intention seems to be they operate in a loop, so that each platform that goes up the left comes down on the right. These considerations can be freely ignored if they make the level more fun; the point is just to consider that the stage design usually has a certain logic to it.

DK came out in a time games were mostly about getting high scores. However, it also introduced the idea of focusing on how far you can get. Look at how the pie factory and elevator levels allow you to get more points at the risk of not getting as far by choosing a more difficult path.

Rules the original levels followed

These things are not, strictly speaking, necessary. They will, however, make your levels look more like the ones Nintendo made.

The platform Donkey Kong stands on is always at vertical tile coordinate 11. The barrel level is an exception, where the platform is four pixels higher.

The platform Pauline stands on in the barrel, elevator, and pie factory stages always runs from tile coodinates (11, 7) to (16, 7) inclusive.

DK is positioned so that his foot just touches the ladder while facing the viewer (assuming his foot is on the ground).

Pauline is positioned so that her hair is one pixel away from the ladder.

Black sprites (sprite #58) should be placed at the top of DK's ladders so that DK will be cropped cleanly when he climbs them. If this is not done, he will seem to disappear piece by piece.

Sprites for bonus items should be one pixel off the ground.