ReX's Nexus: Creating Hub Structures in ZDooM

Creating Hub Structures in ZDooM

This is a brief discussion on how to create maps in a hub structure within a ZDooM environment. A "hub" structure is a loose definition of the original "hub & spoke" structure. A hub & spoke design is one where there is a central map (the hub), and peripheral maps connected to the hub via spokes. [Very similar to a cart wheel, with the central hub being the point through which the entire structure connects.] A good example is the first Hexen mission. Subsequently, any collection of maps that allow players to return to maps already traversed (or allowed back-and-forth travel between maps) became known as hub-based wads.

There are two parts to creating a set of maps within a hub structure. The first part involves setting up your MAPINFO definitions, and the second part involves setting up your maps. (This discussion assumes you are familiar with the use of a MAPINFO lump.) To set up your MAPINFO, you'd need to assign your maps to a "cluster". [From the ZDooM wiki:] A cluster definition begins with the keyword “cluster”. For purposes of ZDoom, clusters are used to displays messages when moving between maps and to optionally group different levels into a hub.... When leaving a hub, the game will remember the contents of the level when the player left it and restore the level to that state when the player returns to it. The following is an example of a MAPINFO definition for maps in a hub:

You'll notice that each map has to be defined within its cluster (in this case, "cluster 1"). Also note that cluster 1 is defined as a hub via the lines "clusterdef 1" & "hub". [The definitions for map names, skies, and music are all optional in the context of defining clusters and hubs.]

This next section covers how to set up your maps. Assuming, for a moment, that you have a true hub-spoke wad in which the player starts in the hub map and can travel to 3 other maps, you'd do the following:

If you wanted to create direct connections between the peripheral maps (i.e., Maps02 to 04) that would not require going through the hub (Map01), you'd create similar exit/entry points, taking care to use different player start arguments (unless the entry points happen to coincide with those from Map01, in which case you wouldn't need new arguments).