-
Notifications
You must be signed in to change notification settings - Fork 3
User guide
The designer workflow is divided into roughly three parts:
- Setup and configuration of the generation process. At this stage, the designer imports and/or selects the map pieces to use for the generation process, and defines the generation parameters.
- Map generation and validation assessment. The designer generates the map, which appears in the scene view; the validation metrics appear in the console, allowing the designer to quickly assess the map's navigability.
- Demo of an NPC traversing the map. The two previous steps occur in editor mode, i.e., when the "game" is not running. To get a first-person feeling for the generated map, the designer can enter play mode, in which case a demo of an NPC traversing the map starts, as exemplified in the following image:
Naturally, this workflow can be repeated and iterated upon until the designer is satisfied with the results. The next sections further detail these steps, as well as the user interfaces which allow for this interaction.
The designer sets up the generation process by interacting with the GenerationManager
component, displayed in Unity’s inspector—see image below—when the game object of the
same name is selected in the scene’s object hierarchy. Here, the designer can generate
a new map or clear an existing one (subfigure (a) below), select the pieces used to
create the map (subfigure (b) below), define the connection criteria (subfigure (c)
below), specify general parameters (subfigure (d) below), and choose and configure a
selection method (subfigure (e) below). Configuring map validation is also performed at
this stage. This is done in a separate inspector panel, which appears when the
NavController
game object is selected in the object hierarchy. Among other aspects,
the designer can define the dimension of NPCs and/or players navigating the map, as
well as the number of navigation points used for determining the navigation metrics.
After configuring the generation process, the designer can create a new map by clicking the "Generate" button (subfigure (a) above). Besides the produced map, the process also outputs a detailed generation log in Unity’s console, listing each selected guide and tentative pieces, as well as successful and unsuccessful snaps, allowing the designer to follow all the steps of the generation process.
After the map is generated, the validation step is triggered, and a predefined number of navigation points are randomly placed on the map’s surface in order to obtain the validation metrics, namely the map's average relative connectivity, and the relative area of the largest fully-connected region. This information is also provided via a log in Unity's console (separate from the generation log).
These metrics can be used to request a regeneration of the level if the average connectivity is below a certain threshold and/or the largest region does not represent a large enough relative area of the generated map. Additionally, the largest relative area can be used to define the playable area of the map, where new players or NPCs are spawned, for example.
Having successfully generated a map, the designer can enter Unity's play mode, where an NPC traverses the map using the navigation points (initially created for map validation) as randomly selected waypoints. The NPC is placed in the largest fully-navigable area of the map, also determined during the validation procedure, thus avoiding getting stuck in poorly connected regions. While this demo is not useful in a real-world automatic generation process, it constitutes a visual aid for the designer to get a first-person awareness of the generated map. An example of this demo mode is shown in the top image in this page.