Player Models a Quarter Smaller: What We Found Inside CS 1.6 Models
Custom skins are the biggest download on most servers. We looked at how they are stored, found a lot of repeated data, and built a free tool that removes it.
The short version
A CS 1.6 player model is mostly animation, not the character you see. Model compilers store a lot of that animation twice. On four real sets of server skins we cut what players download by 20 to 28 percent without changing a single frame, and by 51 to 56 percent together with gzip compression.
The tool that does it is free and open source: CSB Model Optimizer (Windows app and command line). Below is what we found and how it works.
What is inside a model file
We measured the stock Counter-Strike files byte by byte. Weapon models are mostly mesh and texture. Player models are the opposite: almost the whole file is the animation of about 110 moves (walk, run, crouch, shoot with every weapon, die...).
How GoldSrc stores animation
Each move (a sequence) has a table with one row per bone. Each row has six slots: position X, Y, Z and rotation X, Y, Z. A slot points at a small compressed list of values, one per frame, or is 0 when that bone does not move that way. The compression is a simple run-length scheme: valid values follow, and they cover total frames.
Those two offset sizes matter: they decide what can be shared and where.
Where the waste is
We went through a Zombie Plague model pack and three real server skin sets (about 370 player model files in all). The compression of each value list is already as tight as it gets, and the files have no unused or trailing bytes. The waste is in repetition:
- Whole moves stored again. Many custom models carry the same sequence several times (the same idle or death under different names). Each copy is stored in full.
- The same value list in many places. A bone that holds still has the same short list in every move it appears in, and blends of one move repeat most of their lists.
- Lists of zeros. A list that only says "no movement" can simply be the 0 slot.
- The same animation in different skins. Skin packs reuse one rig: five zombies in the pack had byte-identical animation (8 MB of the same data).
We also found plain mistakes that cost every player a download:
zombie_cubanoT.mdlin a popular Zombie Plague pack is a copy of the model itself, not its texture file. The skin has no textures at all, and every player downloads 1.4 MB for nothing.- Identical skins under two names on one server (for example
werewolfandLobisomem, 2.2 MB each). - A
T.mdltexture file next to a model that has its own textures: the game never loads it.
Fix 1: pack each model
The first fix keeps every model a normal, single file with the same name. Repeated moves point at one table, because that offset can reach anywhere. Repeated value lists are written once. A slot can only point forward and at most 65,535 bytes ahead, so lists are shared inside a chunk of moves that fits in that window. All-zero lists become 0, and values a list repeats at its end are dropped (the game repeats the last value anyway).
This alone takes most custom player models down by a fifth to a quarter, and it works with every client, stock or not, because the format is unchanged.
Fix 2: share animation between skins
GoldSrc has had a way to keep animation outside the model since Half-Life 1: sequence groups (the model01.mdl files). A model can say "my moves are in that other file", and the game, the client and the server all load it by name. We use that to give skins with the same animation one shared file, named after its content: models/player/_anims/<hash>.mdl. A player who already downloaded it for one server does not download it again for another.
Rules we kept to:
- A shared file is only made if no skin ends up holding more animation in memory than before (each model keeps its own copy of the file in memory), and only if the download gets smaller.
- The stock skins (
gign,sas,arctic...) are never touched. Withmp_consistency 1the game checks their size from the animation inside the file and ignores sequence groups, so with a split stock skin the player's game quits while connecting. Every player has those files anyway. - Only
models/player/is split. Weapon models are only packed. - The server must send the shared files with the skins: one line each in
maps/<map>.res, orprecache_genericnext toprecache_model. The tool writes the list for you.
We tested the shared files in game: a slim skin is loaded and posed the same as the original, and a stock (non-kit) client downloaded the shared files from a stock server and joined.
Fix 3: gzip on top
Packing removes repeats that are far apart in a file, or in different files. gzip removes the small ones close together, so the two add up. The tool writes a .gz next to every file. Clients with our kits download those (see Fast Download in kit 8684.8); other clients keep downloading the normal files, which are smaller now too.
How the tool works
The check after each rewrite is what makes this safe. For every move, bone, slot and frame, the tool reads the value the way the game engine does and compares it with the original. It also compares the header, bones, move descriptions, meshes and textures. We ran a second, separate checker (written independently, in Python) over every model of four real sets: no differences.
Results
| Set | Original | Packed + shared | Packed + shared + gzip |
|---|---|---|---|
| Zombie Plague pack | 69.2 MB | 49.7 MB | 33.7 MB |
| Skins server | 266.6 MB | 191.4 MB | 118.7 MB |
| Client skin set | 61.2 MB | 48.7 MB | 30.0 MB |
| Big skins server | 200.1 MB | 146.3 MB | 94.2 MB |
A whole server download folder (1,350 files with maps, sounds and sprites) went from 771 MB to 393 MB of .gz files, in 27 seconds.
Try it on your server
- Get CSB Model Optimizer (MIT license). The page has a step-by-step tutorial.
- Pick your
cstrikeor fast-download folder and press Optimize. It writes an optimized copy; your folder is not changed. - Copy the result to your server and your fast-download host,
.gzfiles included. - If animation was shared, add the files from
shared_anims.txtto your.resfiles or plugin.
Or from the command line:
mdlopt run "C:\server\cstrike" "C:\server\cstrike_optimized" --report report.json
Players who already have the old files keep them; they still work. New players download the smaller ones.









