Promuj serwer
68 lines 6.4 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Add Custom Maps to a CS 1.6 Server"
excerpt: "Add custom maps to a CS 1.6 server the right way: where the .bsp and its assets go, the mapcycle, fast download so players actually get the files, and the missing-resource crashes."
category: "installation"
tags: "maps, custom-content"
image: ""
read_time: "8 min read"
---
<p>Adding a map is not just dropping a <code>.bsp</code> in a folder. A map references textures, models, sounds and sprites that must all be present on the server, and — for a public server — must be downloadable by every client that joins. Get the file placement right and the crashes disappear; get fast download right and players stop timing out on the loading screen. This guide covers both.</p>

<h2>1. Understand what a map is made of</h2>
<p>A single custom map is typically several files across several directories inside <code>cstrike/</code>:</p>
<pre>maps/de_mymap.bsp        &lt;-- the level itself
maps/de_mymap.txt        &lt;-- optional MOTD/overview text
maps/de_mymap.res        &lt;-- optional resource list (used by fast download)
overviews/de_mymap.bmp   &lt;-- radar overview
overviews/de_mymap.txt
sound/mymap/...          &lt;-- custom sounds the map plays
gfx/env/...              &lt;-- custom skybox, if any
models/... sprites/...   &lt;-- any custom models/sprites</pre>
<p>Many maps embed their textures inside the <code>.bsp</code>; those need nothing extra. Maps that reference external WADs need those WADs present too, or players see missing textures.</p>

<h2>2. Copy the files, preserving structure</h2>
<pre>cp de_mymap.bsp   /home/steam/hlds/cstrike/maps/
cp de_mymap.txt   /home/steam/hlds/cstrike/maps/
cp overview.bmp   /home/steam/hlds/cstrike/overviews/de_mymap.bmp</pre>
<p>Filenames are case-sensitive on Linux. <code>De_MyMap.bsp</code> and a mapcycle entry of <code>de_mymap</code> will not match, and the server will report the map as not found.</p>

<h2>3. Add the map to the mapcycle and vote list</h2>
<p>The rotation is driven by <code>mapcycle.txt</code> in <code>cstrike/</code>:</p>
<pre>de_dust2
de_mymap
de_inferno</pre>
<p>If you run a map-vote or nomination plugin, add the map to its map list too (commonly <code>addons/amxmodx/configs/maps.ini</code>). A map in <code>mapcycle.txt</code> but not the vote list can be rotated to but not chosen by players, and vice versa.</p>

<h2>4. Set up fast download (this is the part people skip)</h2>
<p>Without fast download, clients pull custom files over the game channel at a crawl and frequently time out. Point clients at an HTTP mirror of your <code>cstrike/</code> tree:</p>
<pre>sv_downloadurl "http://dl.example.com/cstrike"
sv_allowdownload 1
sv_allowupload 1</pre>
<p>On the web host, the directory served at that URL must mirror the layout under <code>cstrike/</code> exactly — the map's <code>.bsp</code> at <code>maps/de_mymap.bsp</code>, sounds at <code>sound/...</code>, and so on. The client requests the same relative path it needs locally. A <code>.res</code> file next to the <code>.bsp</code> lists every asset the client should pre-download, which prevents the "connected but missing sounds" experience.</p>

<h2>5. Compress for fast download (optional but standard)</h2>
<p>The engine's HTTP downloader also accepts bzip2-compressed copies. Ship <code>de_mymap.bsp.bz2</code> alongside <code>de_mymap.bsp</code> on the download host and clients grab the smaller file:</p>
<pre>bzip2 -k maps/de_mymap.bsp    # keep the original, produce de_mymap.bsp.bz2</pre>
<p>Do this for the large assets. The uncompressed file must still exist on the game server itself — the <code>.bz2</code> is only for the download mirror.</p>

<h2>Common errors</h2>
<ul>
<li><strong><code>Host_Error: Map change failed: 'de_mymap' not found on server</code></strong> — the <code>.bsp</code> is missing, misspelled, or wrong-case in <code>maps/</code>.</li>
<li><strong><code>Host_Error: PF_precache_sound_I: 'mymap/x.wav' Precache can only be done in spawn functions</code></strong> or <code>failed to load</code> — a sound/model the map calls is not on the server. Copy the map's <code>sound/</code> and <code>models/</code> assets.</li>
<li><strong>Purple/black checkerboard textures</strong> — a referenced WAD is missing, or the map expected embedded textures that were stripped. Get the complete map package.</li>
<li><strong>Players stuck at "Verifying and downloading resources"</strong> — no <code>sv_downloadurl</code>, or the mirror layout does not match. Test the URL in a browser: the <code>.bsp</code> must download from the exact path.</li>
<li><strong>Map runs but no radar</strong> — the <code>overviews/</code> <code>.bmp</code> and <code>.txt</code> are missing or misnamed.</li>
</ul>

<h2>Verification</h2>
<p>From the server console force the map:</p>
<pre>changelevel de_mymap</pre>
<p>The server must load it without a <code>Host_Error</code>. Then join as a client from a machine that has never seen the map: you should download the assets over HTTP quickly and spawn into a fully-textured level with a working radar. If the download bar crawls, fast download is not wired up; if you spawn but hear no custom sounds, the <code>sound/</code> assets are missing from either the server or the mirror. Once maps rotate cleanly, tie the rotation to player count with your map-vote plugin and confirm entries match between <code>mapcycle.txt</code> and the vote list.</p>

<h2>Batch-adding a map pack</h2>
<p>Adding one map is manual; adding fifty is a script. When you drop a pack in, the failure mode changes from "one wrong path" to "one of these fifty maps is missing an asset and crashes the rotation at 3am". Two habits make a pack safe. First, verify every <code>.bsp</code> is actually present and named as the mapcycle expects:</p>
<pre>cd /home/steam/hlds/cstrike
while read m; do [ -f "maps/$m.bsp" ] || echo "MISSING: $m"; done &lt; mapcycle.txt</pre>
<p>Anything printed is a mapcycle entry with no map file — it will break rotation when reached. Second, mirror the entire pack to fast download in one pass and generate the <code>.bz2</code> copies so clients are not pulling megabytes over the game channel:</p>
<pre>find maps -name "*.bsp" -exec bzip2 -k {} \;</pre>
<p>Do the same for large <code>sound/</code> and <code>models/</code> assets the maps add. The uncompressed originals stay on the game server; only the mirror serves the <code>.bz2</code>. A pack installed this way either boots clean or tells you exactly which map is incomplete before a player ever finds out the hard way.</p>