FSX & FSX: Steam Edition 4 min read

How do I fix the DEM4KM.BGL error in FSX?

Ian Stephens
In short

Fix the DEM4KM.BGL error in FSX by restoring the stock terrain file, correcting scenery.cfg, removing conflicts and rebuilding scenery indexes.

To fix a DEM4KM.BGL error in FSX or FSX: Steam Edition, note the file path shown in the message, restore the stock file through Steam verification or the original installer, correct the Default Terrain scenery entry, then rebuild the scenery indexes. Do not download a loose replacement BGL or delete the stock file.

What is DEM4KM.BGL in FSX?

DEM4KM.BGL is a stock terrain-elevation file that normally resides at <FSX>\Scenery\BASE\Scenery\DEM4KM.BGL, where <FSX> is the folder containing fsx.exe. It provides coarse worldwide terrain data that FSX retains as a fallback even when higher-resolution mesh is installed.

Custom mesh should occupy its own scenery area rather than overwrite the BASE folder. Our terrain-mesh installation and removal guidance explains how that layering should be arranged.

The error means FSX cannot find, read or index the file it expects. The full path in the message is the key clue: a path under Scenery\BASE indicates a stock-file problem, while a path inside an add-on folder points to that add-on.

How do I repair DEM4KM.BGL?

Use the error's full path to repair the correct FSX installation and avoid changing an unrelated copy.

  1. Close FSX and record the path. If boxed FSX and Steam Edition are both installed, they may use different installation and configuration folders. Back up scenery.cfg and any stock files you have deliberately modified.
  2. Check the expected file. Look for DEM4KM.BGL under <FSX>\Scenery\BASE\Scenery. A missing, zero-byte or unreadable file needs restoring. If the reported file is elsewhere, treat it as part of the scenery add-on containing that folder.
  3. Restore the stock file.
    • For FSX: Steam Edition, open its Steam properties, select Installed Files and run Verify integrity of game files. Verification can replace other modified stock files as well, which is why a backup matters.
    • For boxed FSX, run Setup from the original installation media and select Repair if offered. If a complete reinstall becomes necessary, restore the appropriate service-pack or Acceleration installation before adding third-party scenery again.

    Avoid replacement BGL files from unknown archives. They may come from another simulator release, be incomplete or carry the same corruption.

  4. Check the Default Terrain entry. In the Scenery Library, the stock Default Terrain area should be active and point to Scenery\BASE. That is the area root—not Scenery\BASE\Scenery and not the BGL itself. Do not create a second Default Terrain entry or guess new Area and Layer numbers. If the entry is absent or malformed, follow our procedure to repair missing or broken Scenery Library entries.
  5. Rebuild the scenery indexes. With FSX closed, find the active SceneryIndexes folder under %PROGRAMDATA%\Microsoft\FSX or the corresponding FSX-SE branch and rename it to SceneryIndexes.old. Rename only the branch used by the installation producing the error. FSX will create fresh indexes on its next launch, which may take longer than usual.
  6. Test before restoring add-ons. If the error followed a terrain-mesh installation, leave that scenery area disabled for the first test. Once FSX loads correctly, enable affected areas one at a time.

What if DEM4KM.BGL exists but the error remains?

If DEM4KM.BGL is present in the correct folder, the usual causes are a bad scenery path, stale index, unreadable file, damaged add-on or a second FSX installation being repaired by mistake.

Path or symptomAppropriate action
Path ends in Scenery\BASE\Scenery\DEM4KM.BGLVerify or repair that exact FSX installation, then rebuild its scenery indexes.
The path's folder no longer existsCorrect or remove the obsolete scenery entry after backing up scenery.cfg.
The path is inside an add-on folderDeactivate that scenery area and reinstall the add-on version intended for FSX.
The repaired file disappears againCheck security-software quarantine and the drive for file-system or storage errors, then verify the installation again.

If the DEM4KM message is followed by a crash naming Terrain.dll, use our method to isolate damaged terrain and scenery BGLs behind Terrain.dll crashes. Restoring DEM4KM will not repair a separate malformed add-on BGL.

Can I delete DEM4KM.BGL if I use better terrain mesh?

No—FSX still expects its stock terrain base, and add-on mesh supplements rather than replaces it. Removing DEM4KM.BGL can reproduce the error or leave terrain coverage incomplete.

Do not leave a backup such as DEM4KM-old.bgl in the same Scenery folder either. FSX loads files by their .bgl extension, so move backups completely outside active scenery directories. If the unwanted copy belongs to an add-on, deactivate its Scenery Library area before removing or reinstalling it.

AI Assistant New

Still stuck? Ask Fly Away

Ask Fly Away is our AI flight-sim assistant. Ask your exact question and get a direct, step-by-step answer in seconds — free to try.

Ask Fly Away Free preview · unlimited for PRO members