Generating a .res File for Custom Map Content

December 18, 2025 Daemon666 8 min read 3 visualizações

A .res file is the manifest that tells clients exactly which extra files a map needs, so the server can send them and FastDL can host them. Without it, a map that references a custom model or sound will load with ERROR models and silent weapons for anyone who does not already have the content. The .res lives next to the map — maps/de_mymap.res beside maps/de_mymap.bsp — and lists every custom file the map pulls in. This is how you build one correctly.

1. Know what belongs in a .res

The file lists game-relative paths, one per line, to every custom asset the map references that is not part of stock CS:

  • Models under models/ (custom props, view models)
  • Sounds under sound/ (ambient_generic, custom weapon sounds)
  • Sprites under sprites/ (glows, custom HUD art the map spawns)
  • The overview under overviews/ (.bmp + .txt) if you made one
  • The skybox files under gfx/env/ if the map uses a custom sky
  • Detail textures and any custom .wad you ship externally

You do not list the .bsp itself, and you do not list stock content every client already has — that just wastes bandwidth. Paths are relative to cstrike/.

2. Build it automatically with RESGen

RESGen is the standard tool for this: it scans a .bsp, finds every entity that references an external file, and writes the .res. Point it at your compiled map:

RESGen.exe de_mymap.bsp

It produces de_mymap.res with the models, sounds, sprites and sky it detected. RESGen reads the entity data (ambient_generic sound paths, cycler/env_sprite model and sprite paths, the skybox name) so it catches things you would forget by hand. Always open the result and read it — RESGen finds referenced files, but it cannot know about content your map only loads indirectly.

3. Write or fix one by hand

A .res is plain text; you can author or patch it in any editor. The format is a list of quoted, game-relative paths, and comment lines start with //:

// de_mymap.res
"models/props/mymap_crate.mdl"
"sound/ambient/mymap_wind.wav"
"sprites/mymap_glow.spr"
"gfx/env/mysky_up.tga"
"gfx/env/mysky_dn.tga"
"gfx/env/mysky_lf.tga"
"gfx/env/mysky_rt.tga"
"gfx/env/mysky_ft.tga"
"gfx/env/mysky_bk.tga"
"overviews/de_mymap.bmp"
"overviews/de_mymap.txt"

Add any file RESGen missed, and delete lines for content that is actually stock. Each path must match the real file on disk exactly — wrong case or a typo means that one file never downloads.

4. Include the skybox and overview

Two things mappers forget: the six skybox faces in gfx/env/ (named after your sky with the up/dn/lf/rt/ft/bk suffixes) and the radar overview in overviews/. If the map uses a custom sky set in light_environment and skybox, all six faces must be listed or players get a plain sky. List both the .bmp and .txt of a custom overview.

5. Place it and let the server use it

Drop de_mymap.res in cstrike/maps/ next to the BSP. The dedicated server reads it when the map loads and offers each listed file to connecting clients; FastDL then serves those files over HTTP if sv_downloadurl is set. The .res is the bridge between your map and the FastDL packaging step.

6. Keep the .res in sync as the map changes

The most common way a .res goes wrong is drift: you add a new ambient sound or swap a model in a later build and forget to regenerate the manifest, so the old .res silently omits the new asset. Make regenerating the .res the last step of every compile-and-ship cycle, not a one-time job. Re-run RESGen on each new .bsp, diff the result against the previous .res, and add anything new. If you maintain the file by hand, keep it open next to your entity work so a new ambient_generic path goes into the manifest the moment you place the entity. A stale .res is indistinguishable, from the player's side, from having no .res at all for the files it forgot.

Common errors

  • Players get ERROR models or silent sounds — the asset is not listed in the .res (or the path is wrong). Add or correct the line.
  • Sky is plain / wrong for players — the six gfx/env/ faces are missing from the .res. List all six.
  • One file never downloads, rest work — a case or spelling mismatch between the .res line and the file. Match it exactly.
  • RESGen produced an empty or tiny list — run it on the compiled .bsp, not the .map; it reads entity data from the BSP.
  • Listed stock files too — harmless but wasteful; the client re-downloads content it already has. Trim stock entries.

Verification

The real test is a clean client with none of the custom content. Connect it to a server running the map with FastDL configured and watch the download screen — every file in the .res should transfer, and the map should then show its models, sounds and sky correctly. If something is still missing, compare the missing asset's path against the .res line for a typo. Then move on to packaging the whole map for FastDL.

Colaboradores: Daemon666 ✦
Compartilhar: