Unreal URLs and Hubs

Tim Sweeney
Epic MegaGames, Inc.
tim@epicgames.com
http://www.epicgames.com/

This document is a trade secret of Epic MegaGames, Inc.

Unreal URLs

Unreal uses the standard URL (uniform resource locator) syntax of the WorldWide Web for identifying levels, entry options, and startup options.  This approach unifies Unreal's local level switching with its network play. A sample URL is:

unreal://server.site.name.com/levelname#teleportername?option1?option2?option3

A URL consists of the following parts.

The following are player URL options, which may be specified either when starting a local game or entering a network game.

The following are server URL options, which may be specified either when starting a local game, or starting a dedicated server.  They are not recognized for clients who are entering a network game, because the server options have already been set at that point.

In addition to these predefined URL options, licensees using the Unreal engine and users creating mods can define entirely new options.  The URL options are processed in the GameInfo class in two places: InitGame parses the server options when the dedicated server is started; and Login parses the player options when each client (either local or remote) who connects to the server.

Several kinds of URLs are used commonly:

Unreal hub system

The Unreal engine supports "hub" levels using a "stack" of levels.   The level stack always contains at least one level (the current one you're playing).  When you go from a hub into a gameplay level, the hub will typically be saved, you play the game level, then you return to the hub.  The engine automatically saves the state of the hub levels if you link your levels using the proper URL's.

Note: Unreal uses URL's to designate all level-travelling options such as the level to travel to, the teleporter to enter through, and more.  URL's are sort of ugly and complex-looking, but they are extremely versatile in enabling single-play and network levels to be linked together in many cool ways, so they are a necessary evil.

Here is an example that might help visualize the "level stack".

When you start gameplay, you enter Vortex Rikers. The hub stack looks like:

Then you exit Vortex Rikers into the first hub, which is linked with the URL "fhub1#teleportername?peer".  "fhub1" is the name of the level.   "#teleportername" gives the name of the teleporter to enter the level through.  The "?peer" option tells the engine that you're travelling to a peer level that should replace the current level on the hub stack.  The new level stack looks like:

Now you go from the first hub into a gameplay level, Dig, using the URL "dig#teleportername?push".  The "?push" tells the engine to push the current level onto the level stack, then move into a new level.  The level stack now looks like:

Once you successfully complete Dig, you encounter a URL that sends you back to the hub, "#newteleporter?pop".  The "#newteleporter" names a new teleporter to jump the player to within the saved level.  "?pop" tells the engine to pop the current level off the level stack, and return to the previous level.   The level stack now looks like:

The hub system should completely work with savegames.  Each level in the hub stack is saved in a different file in the \unreal\save directory.

The hub system supports hubs up to 10 levels deep.  Of course, this would be extremely confusing to players.  For simplicity, in Unreal, we never go above 2 levels deep in our design.

Notes: