User Tools

Site Tools


Metroid-style level generator


An algorithm that can create entire worlds for a Metroid-like game.

World Subsections


The World is a collection of Regions arranged as rectangular areas.


A Region is a collection of Rooms with a similar design theme, similar enemies, the same music playing, etc.


Rooms contain the path the player moves on, items, and so forth.

They are connected to other Rooms by doors of some sort: literal doors, elevators, teleportation devices, or whatever.

Room generation rules

  • Rooms have a minimum size of one game screen, and should generally be aligned to a grid.
  • New rooms may not connect any two rooms in the critical path that are otherwise separated by a Barrier (shortcut avoidance)
  • The character with the best movement and jumping ability MUST be able to access all ledges and items
  • The character with the worst movement and jumping ability MUST be able to follow the critical path
  • The character with the worst movement and jumping ability MUST be able to reach an exit along the critical path from any ledge in the room (no getting stuck, ever)

Note that character abilities may change in the game world as the player collects Keys and bonuses.

Path Generation

When the Environments are built, the game will randomly place Keys throughout the world, develop a path between the Keys and the entry and exit points, and use these locations as hints to build the rooms.

  • The critical path cannot loop back upon itself without having first changed state.
  • Rooms in the critical path should have a fair distribution of size. If a link in the path is too long, break it and add paths to go around the break.
  • Barriers are added between points in the critical path, and the items needed to surpass them are added at points

The “critical path” is the shortest possible path to beat the game.

Barriers and their Keys

For this discussion, a “Barrier” is a blockade that requires the player to take specific action elsewhere to surpass it.

The “Keys” to these barriers may include:

  • Collecting or activating an item that does nothing more than open that door
  • Collecting an item that expands the player's abilities
  • Defeating a boss enemy

Multipart Keys

A barrier may require the collection of multiple items that are spread out throughout the world, and you may be able to collect a larger number of the item than you will need. For example, you may need 50 missiles to defeat the end boss, but there may be 100 in the game.

The critical path must include 100% of such items as are needed to surpass the barrier, and no less than 125% of the barrier requirement if there are that many of the item in the game world. Note that this will allow looping, going against the rules that I have already stated

Character-specific barriers

Certain barriers may exist that only certain characters can cross. This would give them a different critical path from other characters.

Potential algorithm sources

  • Xevil – open source room generation.

There should be literature on this. Do some searching.


{“TOPICINFO”:{“author”:“DeltaTango”,”date”:“1340255295”,”format”:“1.1”,”reprev”:“1.1”,”version”:“1.1”},”TOPICPARENT”:{“name”:“WebHome”},”GameAboutFormTemplate”:{“GameGenre”:“Unspecified”,”Inspirations”:false,”GamePerspective”:“Unspecified”,”ProjectLegality”:“Unspecified”,”ProjectDifficulty”:“Unspecified”,”TargetPlatform”:“Unspecified”,”TargetERSB”:”???”,”YearOfIdea”:false,”DesignVersion”:false,”DesignCompletion”:“Utterly Vague”,”CodeVersion”:false,”CodeCompletion”:“No code”}}

metroidvanialevelgenerator.txt · Last modified: 2013/11/27 01:47 (external edit)