Leaking maps

From The DarkMod Wiki
Jump to: navigation, search

What is a leak?

A leak occurs when the geometry of a map is not completely sealed.

In Doom/Radiant editing, the world is an infinite big empty space and your map is a small world placed inside this vacuum. The inner world must be completely sealed against this vacuum, or a leak occurs.

Maps with a leak will not compile (dmap) and do thus not work at all. Instead, when you dmap, Doom3 creates and saves a pointfile with info about the route through the leak. The editor can load this in and display it (see #How to fix leaks below.)

[edit: Springheel] Leaks can also be caused by models. If the origin of a model occurs in the void, it can cause a leak, which is often difficult to track down. If the red line created by the pointfile (see below) does not make sense, check to see if any models have an origin outside the visible model.

How to detect leaks

The easiest way is to watch the console during dmap yourmapname. When a leak occurs, a red warning will be printed.

Other warning signs:

  • Newly added geometry is not showing up
  • You're colliding with invisible things, as the .cm file is still stemming from the most recent compiling version.
  • Textures are not updated (they didn't get saved into the .proc file)
  • Lights/shadows precalculation doesn't take effect.
  • AAS is no longer valid - this will break pathfinding.
  • The map won't run at all if the .cm/.proc files aren't available from a previous version.

How to fix leaks

In the editor, open your map, and then select File -> Pointfile. This will insert a few red lines pointing from the inner world to the outside, hopefully helping you to pinpoint the leak.

Every time you move something to try and fix the leak, you must save and dmap your map again to test it. An updated pointfile will be created (assuming the leak is not fixed or there is another leak somewhere else).

Another option is using Edit -> Undo or going back to a previously saved map version.

Problems finding the cause of the leak

Sometimes the point file just generates a short line in the void and it is not clear where the entity is that is causing the leak.

Note that the dmap command will print some leak information to the console, which includes the entity the flood algorithm was able to reach from the outside (scroll up a little from the end.) This can also help pinpointing the leak (sometimes entities are filtered or way outside the map). You can use DarkRadiant's Entity List to look up the entity by name then and select it.

The entity might be a model that is basically inside but its origin is just outside in the void.

The entity might be a brush/patch construction where its origin is way outside. This can happen if say a brush is dragged away from its origin or even caused by a rotation. It can be dragged back inside the brush/patches using V for vertex mode.

Sometimes the brushes/patches of an entity are deleted in TAB mode leaving only the origin and nothing visible. Use the above information to find it in the entity list and either delete it or repair it.

Another way to find the entity is to use "Show Entity Names" under Preferences/Orthoview in DarkRadiant. In the 2d views the Entity names are displayed at the origin. You can then select it with the entitiy list (Ctrrl+J).

There is additional information about leaks in Performance: Essential Must-Knows