Runtime V/P/W models
Load local first-person, held and dropped cosmetic models without consuming server precache slots.
The opportunity
GoldSrc's traditional model table has a finite server precache budget, commonly 512 model entries. A managed client can load a cosmetic model through its native model loader and substitute it locally in first-person (v_), held/player (p_) and dropped/world (w_) draw paths without adding that model to the server's precache table.
This can let a managed client display a much larger cosmetic collection over time. It does not expand the server's model table or remove every GoldSrc resource limit.
What has been demonstrated?
Native Linux x86 GoldSrc build 10211 has recorded runtime tests for all three draw paths:
| Draw path | Observed result |
|---|---|
v_ first-person | Custom knife loaded after map start, switched off/on; server model index remained 191 |
p_ held/player | Custom knife replaced a bot's held knife, switched off/on; server weapon model index remained 131 |
w_ dropped/world | Custom dropped Deagle model switched off/on; server model index remained 94 |
The P/W tests used debug controls in private sessions. They demonstrate local runtime substitution after map load, not a completed production pipeline for every weapon, host or late-joining player. The recorded Windows test also demonstrated an unprecached first-person knife. Windows P/W, NextClient P/W, dynamic player/item mapping, drop/pickup continuity and map transitions need their own runtime validation.
World-relative chrome on first-person weapons
A chrome surface on an authorized first-person weapon catches a broad highlight as you turn or swing. The surface normals determine the shape of the highlight. Its direction is fixed in world space, and its strength varies with map lighting at the camera. Walking from a shaded corridor into sunlight can brighten the same idle pose.
Give the reflective mesh its own 64 x 64 indexed texture. Supported GoldSrc material flags are chrome (0x02), chrome with additive blending (0x22), and the flat-shaded, chrome, full-bright, additive combination (0x27). The helper supports up to four eligible textures per model. Other materials keep their authored appearance. Models over the limit use their original chrome.
The helper samples the local map light at most ten times per second during eligible draws. It reuses the uploaded chrome map while the sampled brightness and camera heading stay in the same steps. If the renderer cannot supply a light sample, the material still responds to camera turns. The effect runs automatically through the managed recipe flow.
In-game verification. In a private Windows CS 1.6 build 4554 session on de_dust2, the experimental knife and M4A1 both drew using the original server model indices. Walking from shadow to daylight changed the sampled RGB from (15, 15, 16) to (185, 185, 130). To check a new model, compare a slow turn in place with a straight walk between differently lit areas. Linux and NextClient visual playback and low-end frame cost still need measurement.
Approved delivery flow
- The backend decides the player's entitlement and required cosmetic recipe.
- The launcher fetches its approved manifest and immutable assets.
- Paths are constrained to approved roots and SHA-256 hashes are verified.
- The native worker prepares the authorized catalog for the session.
- The server selects a recipe already in that catalog.
- The native draw path validates session, endpoint, source model and sequence before substituting local presentation.
- Missing/unknown/expired selections retain the normal model.
The server's entity model index stays authoritative. A cosmetic selector never submits results, grants ownership or changes gameplay rules.
AMXX recipe interface
Download papamo_cosmetics.inc.
#include <papamo_cosmetics>
// In plugin_init:
papamo_cosmetics_init();
// Once your platform has authorized/staged this exact recipe:
papamo_cosmetics_select(id, verifiedRecipeId);
// Return to normal presentation:
papamo_cosmetics_select(id, "");verifiedRecipeId is a 32-character lowercase hexadecimal recipe ID, not a model path, skin UUID, signing key or arbitrary hash of your choosing. It must match a recipe already staged by the approved launcher pipeline for this player/session and source weapon.
The existing 16CSticker protocol is used for these verified recipes. Refresh selection every 250ms while applicable; native selection expires after 750ms. papamo_cosmetics_available(id) reports recent capability only. Unknown recipes fail closed even if the server sends them. Avoid multiple plugins writing this selector for one player.
The .inc selector does not create a partner entitlement API or authorize new recipe manifests. A platform needs an approved backend/launcher integration before using its own assets. Source delivery and signing remain separately controlled.
What still needs server precache?
The server's own entity models and ordinary stock/web client paths still use models supported and precached by the active map/server. Managed viewers can render local v_, p_ and w_ replacements when they have the verified assets and correct player/weapon/entity mapping. Every viewer needs that integration to see the same cosmetic; a local replacement does not change the server model table or transmit an appearance to other clients. Keep a stock fallback.
The client still has memory, model-format, texture-size and rendering budgets. Load approved content in bounded amounts, reuse cached assets and validate on low-end hardware.