BSP Protection & leaks

BSP Obfuscation Explained: What It Does for GMod Maps

BSP obfuscation changes a compiled map so it still runs normally but is harder to reconstruct. How it works, what can go wrong and where it stops.

BSP obfuscation changes how a compiled map is represented, so that the engine still loads it normally while reconstruction tools produce less usable results. It does not make a map unreadable and it is not copy protection. Its purpose is to make convenient decompiling and further editing more laborious.

What obfuscation means for a BSP

You may know the term from program code: an obfuscated script does the same as before but is hard for people to follow. For a map the idea is similar.

A BSP contains two kinds of information. The engine needs the first kind to render and simulate the map. The second kind mainly helps people and editors: descriptive paths, editor IDs, leftovers from the working process.

Obfuscation targets the second kind and can work in several steps:

  • Reducing information. Whatever the engine does not need can go. That includes editor IDs on entities as well as source files, compile logs and backup leftovers that ended up in the pakfile by accident. This part is also called cleanup.
  • Changing the representation. The file is rebuilt so that it maps less directly back to a comfortable editor version. Material paths are a clear example: a descriptive path becomes a neutral one, and the references in the map are adjusted to match.

What obfuscation makes harder

  • Automatic reconstruction. A decompiler produces less clean results that need more manual work. BSP decompiling explained describes what a decompile normally gives back.
  • Orientation. Without descriptive names and paths it takes longer to understand someone else's map.
  • Reuse of content. Renamed materials are harder to identify and carry over into other projects.
  • Insight into your workflow. Removed source files and logs no longer reveal anything about folders, tools and intermediate versions.

The map still has to run

The most important condition for any obfuscation: the map has to load and play exactly as before. That limits what may be changed.

AreaWhy it has to be preserved
Entity names (targetname)Map logic and server scripts address entities through them
Connections between entitiesDoors, buttons and triggers depend on inputs and outputs
Entity classesThe engine creates objects based on the class name
References to materials, models, soundsEvery reference has to point to an existing file
Header, lump table, offsetsWithout a consistent structure the map will not load

If a material path is renamed without all references following, you see the checkerboard pattern for missing textures in the game. A serious method therefore validates the output again after processing and does not release a file that fails that check.

A structural check does not replace a test in the game, though. Before an obfuscated map goes live, go through it once on your server:

  1. Load the map on a test server and check the console for errors.
  2. Walk through the map and look at textures, models and reflections.
  3. Trigger doors, buttons, triggers and teleporters.
  4. Check addons that remember map entities, for example door assignments or permanently placed objects.
  5. Join with a second client that receives the map through your normal download route.

Point 4 applies to every new version of a map, by the way, including after an ordinary update.

Limits of obfuscation

The engine has to be able to read everything it needs for loading. That results in fixed limits:

  • An obfuscated map stays analysable in principle.
  • Decompilers keep evolving. A high barrier today may be lower tomorrow.
  • Given enough time, any map can be rebuilt by hand.
  • Obfuscation does not stop the file from being copied unchanged and used on another server.
Obfuscation helps againstObfuscation does not help against
convenient decompiling and further editingcopying the finished file
quickly understanding someone else's mapuse on other servers
carrying content over into other projectsa rebuild by hand

Other tools cover the right-hand column. A fingerprint makes copies traceable, and a Server-Exclusive map only runs in full on a licensed server. Protect your GMod map from leaks explains how the parts fit together.

Obfuscation on bspmarket.de

In bspmarket.de's BSP Protection, Obfuscation is a protection level of its own. The site explicitly describes the goal not as unreadability but as making typical reconstruction paths harder. The following points are publicly documented:

  • Obfuscation works in several controlled layers.
  • Only material paths are renamed. Entity names and targetnames are preserved so server scripts keep working.
  • The output file is validated again. If that fails, there is no result instead of a broken map.
  • The original file is not modified, protection creates a separate output.
  • You are only charged for a successfully completed job.
  • A test on the target server is still recommended before release.

The protection guide explains which details are deliberately not published and why.

FAQ

Does obfuscation change how the map looks or plays?

It is not supposed to. Functionally relevant names and references are preserved, and the output is checked structurally. A short test on your own server is still worthwhile.

Does obfuscation make decompiling impossible?

No. It hinders typical decompile attempts and reduces usable editor information. For Source maps a decompile cannot be ruled out.

Can I still edit an obfuscated map later?

You do not edit the obfuscated BSP. You edit your VMF, recompile and protect the new version again. So always keep the VMF and the original BSP safe.

Do I need obfuscation if I already use a fingerprint?

They solve different problems. The fingerprint makes a copy traceable, obfuscation makes further editing harder. Together they cover more than either measure alone.