Asset Streaming (Cars, Maps)
FiveM allows you to stream custom assets (models, textures, data files) from the server to the client automatically. This feature is what allows servers to have custom cars, clothes, weapons, and maps.
Resource Structure
To stream assets, you need a standard resource structure with a stream folder.
my-car-pack/
├── fxmanifest.lua # Resource manifest
├── stream/ # ALL assets go here (yft, ytd, ydr, ymap)
│ ├── adder.yft
│ ├── adder.ytd
│ └── ...
├── data/ # Optional: data files (handling.meta, vehicles.meta)
│ ├── handling.meta
│ └── vehicles.meta
└── client.lua # Optional: scriptsThe stream Folder
Any file placed inside the stream/ folder is automatically scanned by FiveM.
- No definition needed: You do NOT need to list files inside
stream/in yourfxmanifest.lua. - Automatic loading: FiveM detects the file type (texture, model, map) based on the extension (
.ytd,.yft,.ymap) and loads it.
Streaming Vehicles
To add a custom vehicle, you typically need the model files and the data configuration files.
- Models: Put
.yft(model) and.ytd(texture) files in thestream/folder. - Data: Put
handling.meta,vehicles.meta, andcarcols.metain adata/folder (organization preference). - Manifest: You MUST tell FiveM about the data files in
fxmanifest.lua.
fxmanifest.lua for Vehicles
fx_version 'cerulean'
game 'gta5'
-- List the data files
files {
'data/vehicles.meta',
'data/carcols.meta',
'data/handling.meta',
}
-- Tell the game to load them as specific data types
data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'CARCOLS_FILE' 'data/carcols.meta'Streaming Maps (MLO/YMAP)
Streaming maps is even easier.
- Create a resource folder (e.g.,
custom_map). - Create a
stream/folder inside it. - Drop your
.ymap(map placement) and.ydr/.ytyp(models/definitions) files intostream/. - Create a basic
fxmanifest.lua.
fxmanifest.lua for Maps
fx_version 'cerulean'
game 'gta5'
this_is_a_map 'yes'The this_is_a_map 'yes' directive helps FiveM optimize the loading of the map, especially for large MLOs or interiors.
Streaming Clothing (EUP)
Clothing works similarly to vehicles but uses ped data files.
- Put
.ydd,.ytdfiles instream/. - Often, clothing packs are large, so you might see
stream/mp_m_freemode_01/.... - Ensure you are not exceeding the 16MB physical limit for a single file, or players will crash.
Optimization Tips
1. Texture Optimization (YTD)
- Oversized Textures: Textures larger than 2048x2048 cause massive “texture loss” (city blinking/disappearing) for players with lower VRAM.
- Compression: Always compress your textures. Reduce unused alpha channels.
- Split Dictionaries: If a
.ytdfile is >10MB, try to split it or reduce quality.
2. Poly Count (YFT/YDR)
- High polygon models (>200k polys) can cause game instability and FPS drops.
- Use “LODs” (Level of Detail) models so the high-quality version only renders when close.
3. Resource Splitting
- Don’t put 500 cars in one single resource. If you need to update one car, the client has to re-verify the entire pack.
- Group assets logically:
police-fleet,civ-cars-pack1,custom-map-legion.
Common Data File Types
| File | Directive in fxmanifest | Purpose |
|---|---|---|
handling.meta | HANDLING_FILE | Vehicle physics, speed, turning. |
vehicles.meta | VEHICLE_METADATA_FILE | Vehicle models, audio, textures. |
carcols.meta | CARCOLS_FILE | Siren lights, mod kit IDs. |
carvariations.meta | VEHICLE_VARIATION_FILE | Vehicle paint jobs, spawning rules. |
weaponarchetypes.meta | WEAPON_ARCHETYPES_FILE | Custom weapon definitions. |
Last updated on