Fuite

You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.
Les cartes .bsp (Dans GoldSrc et
Source) doivent être complètement fermées. Aucun élément intérieur du niveau, du monde, ne doit donner sur l'extérieur, le vide . Le ciel doit également être contenu dans un bloc utilisant la texture
tools/toolsskybox
(cf. skybox ). Dès qu'il existe une légère ouverture sur le vide, une fuite (leak en anglais) est générée lorsque la carte est compilée via QBSP2 /HLBSP ou VBSP . Lorsqu'une fuite apparaît, le compilateur BSP ne peut pas savoir quel élément est à l'intérieur ou à l'extérieur, ce qui fait que cela ne fonctionnera pas correctement.
Dans cet exemple, on constate un trou béant dans la géométrie débouchant sur le vide. Ceci provoquera une message d'erreur de fuite lors de la compilation.
Lors de la compilation d'une carte comme celle-ci, avec une ouverture sur le vide, VBSP générera une erreur similaire à la trace ci-dessous :
ProcessBlock_Thread: 0...1...2...3...4...5...6...7...8...9...10 (0) **** leaked **** Entity light (-1607.69 -1094.12 -183.00) leaked!
Dans HLBSP (ZHLT /VHLT ), cela générera l'erreur suivante:
Warning: === LEAK in hull 0 === Entity info_player_start @ ( -0, 832, 128) Error: A LEAK is a hole in the map, where the inside of it is exposed to the (unwanted) outside region. The entity listed in the error is just a helpful indication of where the beginning of the leak pointfile starts, so the beginning of the line can be quickly found and traced to until reaching the outside. Unless this entity is accidentally on the outside of the map, it probably should not be deleted. Some complex rotating objects entities need their origins outside the map. To deal with these, just enclose the origin brush with a solid world brush Leak pointfile generated
Avec ce message d'erreur, VBSP vous indique qu'il existe une fuite sur le niveau, ainsi que la première entité trouvée débouchant sur le vide (dans notre exemple, l'entité de lumière). Cela vous renseigne sur l'emplacement de cette entité, exprimée en coordonnées sur le monde (x, y, z).













Conséquences des fuites
Une fuite dans un niveau a des effets négatifs. VBSP indiquera la fuite et cela généra un fichier portail incorrect (mapname.prt
), voir aucun fichier. Le fichier portail est utilisé par VVIS pour faire ses calculs de visibilité. Puisqu'il n'y a pas de fichier portail, VVIS ne s'exécutera pas correctement voir pas du tout. Lorsque cela arrive, VRAD ne fonctionnera pas non plus correctement, ou uniquement l'éclairage direct - sans rebonds de lumières.
Les cartes ne sont pas du tout jouables. VVIS va demander au moteur de générer la carte en une seule fois, ce qui est trop mauvais pour la fréquence d'images, ou il y aura des zones complètement invisibles. Au pire des cas, une fuite peut faire que VRAD généra une carte entièrement noire.
Perte de temps avec les fuites
VBSP remontera toutes les fuites qu'il constate, mais passer des heures à faire des compilations et d'exécution en jeu pour se rendre compte que la carte est corrompie après compilation, n'est tout simplement très efficient. Assurez vous que votre carte n'a pas de fuite avant que vous vous préoccupiez de la visibilité et de l'éclairage. Si vous remarquez que VBSP remonte une fuite pendant que la compilation s'exécute, appuyez sur Ctrl+C pour abandonner l'exécution.
Trouver les fuites
Parfois les coquilles ne sont pas aussi évidentes que dans l'exemple précédent. Ils peuvent être une petite fraction d'une unité de largeur et provoquer une fuite. VBSP fournit un pointfile pour vous aider à localiser la fuite. Il dessine une ligne à partir du vide de la carte jusqu'à l'entité qu'il a trouvé lors du contrôle de fuites. Après avoir reçu une erreur de fuite, un fichier mapname.lin
sera créé dans le même répertoire que votre fichier .vmf .
Charger un pointfile
Le pointfile peut être chargé dans l'éditeur Hammer pour montrer précisément où se trouve la fuite dans le niveau. Pour charger un pointfile du niveau, aller dans Load Pointfile du menu Map.
Cette image montre le pointfile chargé dans l'exemple précédent. Remarquez que la ligne rouge apparait à la fois dans la vue 3D et la vue 2D, et affiche une trace depuis l'entité à travers la brèche.
En utilisant cette aide visuelle, vous pouvez trouver l'origine d'une fuite en suivant la ligne rouge jusqu'à l'extérieur du niveau. Le mieux est de démarrer depuis l'entité spécifiée par VBSP , et de suivre la ligne jusqu'à trouver la brèche dans la géométrie. Comblez la brèche et recompilez le niveau si vous avez résolu la fuite.
Trouver l'extrémité
Si vous avez des difficultés à trouver l'entité de départ, vous pouvez utiliser la commande Go to Coordinates du menu View pour trouver l'entité et le début de ligne pointfile . Entrez juste les coordonnées fournies par l'entité, et les vues 2D et 3D seront centrées sur celles-ci. Suivez ensuite la ligne jusqu'à la fuite.
Une autre méthode consite à trouver la source de la fuite en dézoomant dans une des vues 2D. Après avoir chargé le pointfile , dézoomez jusqu'à voir la ligne rouge. Suivez la ligne jusqu'à atteindre l'entité à son extrémité. Sélectionnez l'entité et utilisez Center 3D Views on Selection du menu View. Désormais vous pouvez suivre la ligne jusqu'à la fuite.
Other causes of leaks
Besides gaps in outside geometry, there are other map errors that can cause VBSP to generate a leak error.
Entities outside the level

All entities need to be inside the playable level space or skybox. VBSP treats all brush entities as if they are not there, so attempting to seal a map with a brush entity, such as a func_door , will create the same condition as if there were a gap in their place.
Improperly constructed areaportals
Leak error messages can also be generated when an areaportal does not properly seal the two areas it connects. Find leaks with areaportals using the same methods as geometry gap leaks.
Special geometry does not seal the world
Displacements and water also do not seal maps and will cause leaks. You can fix this type of leak by adding a solid brush behind them to seal the map. Using a brush with the tools/toolsnodraw
material will seal the map, but not add any additional rendering cost, so it's a great way to seal the map behind displacements. Water should be sealed off with whatever is sealing off the area above it (probably tools/toolsskybox
or another typical texture, such as bricks.) Do not use nodraw to seal off water, as this will cause a weird trailing effect.
Mismatched entity origins
A more subtle cause of leaks can be with any entities that have origin helpers, such as func_door_rotating or func_rot_button . While the entity itself may be inside the world, if the origin helper is outside the map, the entity will cause a leak. If you find a pointfile heading to a empty spot outside of the map, and there is no entity there, an origin helper is a good thing to look for.
One way to quickly tell if an entity origin is causing the leak is to:
- Load the pointfile.
- Find the endpoint(s) of the pointfile.
- Choose Select All from the Edit Menu.
- Make sure Show Helpers is checked on the View Menu.
- If you see an origin helper appear at the pointfile, you know that's the problem.
If you have an origin helper causing a leak, you can select the object and manually move the origin back into the world, use the Center Origins command from the Tools Menu, or simply right-click on the origin helper and select Center on entity.
Mismatched entity origins usually occur when a brush entity with one of these helpers is moved while in Solids mode. Moving a brush entity in solids mode does not move the entity's origin helper.
Translucent geometry
Brushes with translucent materials, like glass, can cause leaks in one circumstance. That being, when a brush with a translucent texture is facing the void. It doesn't matter on which side the translucent texture is, as having at least one side translucent makes the brush incapable of sealing the level.
In this case your pointfile will go straight through a brush into the nearest entity. Check if it's possible to see out into the void and vice versa through any of the 6 faces of the brush that the pointfile is passing through. Alternatively, this can be easily fixed with the Apply current texture tool with the tools/nodraw texture and then texturing the visible sides with the texture they originally were.
Func_viscluster
func_viscluster can also cause leaks when they cross water material or areaportal surfaces, or are too close to them, so simply avoid func_viscluster from crossing the areaportal surfaces.
If it really does need to be used over water, bring the brush level with the surface of the water on one side, and then create a second, separate func_viscluster on the other side. Never allow a func_viscluster brush to cross a water plane, or very strange things happen.
As a last resort, if it still cause the leak, try to remove or move viscluster far away from areaportals, then compiling it again see if it fixes the issue.
False leaks
Although very rare, it is possible VBSP reports false leaks in your level. If you are sure that there should not be a leak reported by VBSP, copy your map and paste it into a fresh new map file. If it compiles fine, then your old file could have been corrupted.
Not having any entities inside the level
Not having any type of entity inside the level will cause a leak. This is why pointfiles originate at an entity, because VBSP uses entities as a reference point for what is the inside of a map. Your map should always at least have a spawn entity in it.
Uncovered func_detail
Not covering func_detail with solid brushes, can also cause leaks which can be hard to find if someone doesn't realise that it's caused through a func_detail.
Situations that do not leak
There are a number of situations which in fact do not cause a leak, even though it appears an entity is positioned outside the map.
Instances
Instances are not entities - during loading, their contents are merged into the map. This means brushes inside an instance can seal a map, and the location of the actual func_instance entity is not important, as long as any entities in the instance get placed inside the map.
Only the origin matters
Only the origin of the entity is considered when looking for leaks. The actual geometry of a brush or model can be partially or entirely inside the void, as long as the origin point is inside the map. Of course no lights are able to reach the void, so these entities should probably be unlit or invisible.
Entities at the origin and inside brushes
Entities with their origin at exactly 0 0 0
, or with their origin inside a solid brush do not leak. They are effectively ignored when determining the inside and outside of the level.
Conclusion: An ounce of prevention
Using the pointfile tools makes finding leaks relatively painless, but one of the most important ways to fix leaks is by preventing them in the first place. Taking your time when building, and making sure brushes are snapped properly to the grid can go a long way towards eliminating leaks before they occur. The cleaner and more organized your geometry, the more likely you are to be able to spot leaks when they occur, or even prevent them from happening in the first place. You can also help prevent lots of extra work by compiling your level as you go along, instead of building your whole level before trying to compile it. Finding one leak at a time while the map is only partially complete is a lot easier and faster than finding leaks in a complete map that is full of geometry.
What about Source 2?
In Source 2, since BSP geometry has been replaced with Mesh geometry, Source 2 maps are no longer required to be sealed off to prevent leaks. However it will still be beneficial to do so to help the VIS calculation processes during compile.