Перейти к содержимому
Streaming custom assets

Streaming custom assets

Add custom vehicles, clothing, props, maps, MLOs and sounds to FiveM: the stream folder, data_file entries, YDR, YFT, YTD, YMAP and YTYP files, naming rules and size limits.

Эта документация пока на английском.

Last updated

“Streaming” means sending game assets (models, textures, maps, sounds) from your server to players and loading them into the game. In FiveM it is mostly automatic: put the files in a resource’s stream folder, add the right data_file lines for metadata, and ensure the resource.

Plays from youtube-nocookie.com after you click.

The two halves of an asset

  1. Binary assets go in stream/: .yft (vehicles and fragments), .ydr (props), .ydd (clothing and ped parts), .ytd (textures), .ybn (collisions), .ymap (placements), .ytyp (archetypes), .ycd (animations) and friends. Everything under stream/, including subfolders, is registered with the game automatically.
  2. Metadata (.meta XML files like vehicles.meta) goes anywhere else in the resource, listed in files and registered with a data_file line. This tells the game what the new things are.
Text
my_asset_pack/
├─ fxmanifest.lua
├─ stream/           binary assets, auto streamed
│  ├─ mycar.yft
│  ├─ mycar_hi.yft
│  └─ mycar.ytd
└─ data/             metadata, registered with data_file
   ├─ vehicles.meta
   ├─ handling.meta
   ├─ carcols.meta
   └─ carvariations.meta

Common data_file types

data_file File For
VEHICLE_METADATA_FILE vehicles.meta Vehicle definitions (model name, handling id, layout, class)
HANDLING_FILE handling.meta Driving physics
CARCOLS_FILE carcols.meta Mod kits, sirens, lights
VEHICLE_VARIATION_FILE carvariations.meta Colours, liveries, extras, kits per model
VEHICLE_LAYOUTS_FILE vehiclelayouts.meta Seat and entry animations (custom layouts)
DLCTEXT_FILE dlctext.meta Text labels
SHOP_PED_APPAREL_META_FILE <ped>_<collection>.meta Add-on clothing collections
DLC_ITYP_REQUEST *.ytyp Custom archetypes (props and MLOs)
WEAPONINFO_FILE, WEAPON_ANIMATIONS_FILE, WEAPONCOMPONENTSINFO_FILE weapon metas Add-on or edited weapons
AUDIO_GAMEDATA, AUDIO_SOUNDDATA, AUDIO_SYNTHDATA, AUDIO_WAVEPACK audio .rel data and .awc folders Custom sounds and engine audio
TIMECYCLEMOD_FILE timecycle modifiers Visual effects and interior lighting

Every data_file path must also be in files { }, or clients never download it.

Vehicles

fxmanifest.lua
fx_version 'cerulean'
game 'gta5'

files {
    'data/**/vehicles.meta',
    'data/**/handling.meta',
    'data/**/carcols.meta',
    'data/**/carvariations.meta',
}

data_file 'VEHICLE_METADATA_FILE' 'data/**/vehicles.meta'
data_file 'HANDLING_FILE' 'data/**/handling.meta'
data_file 'CARCOLS_FILE' 'data/**/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/**/carvariations.meta'

client_script 'names.lua'
names.lua
AddTextEntry('mycar', 'My Custom Car')   -- the name shown in game

Things that break vehicle packs:

  • The modelName in vehicles.meta must match the .yft file name.
  • The handlingId in vehicles.meta must exist in handling.meta.
  • kits in carvariations.meta must reference a mod kit ID that exists in carcols.meta, and mod kit IDs and siren IDs must be unique across all your packs. Clashes make tuning parts or sirens show up on the wrong car.
  • Duplicate model names across two packs: one silently wins.

The Vehicle Pack Validator finds these broken links in a whole vehicle resource. The Vehicle Handling Editor edits handling from a UI, and the Vehicle Sirens Editor edits carcols.meta sirens and finds free or clashing siren IDs. Installation steps for server owners are in Vehicle packs.

Clothing

There are two ways:

  • Replace clothing: files named like the game’s own (jbib_003_u.ydd) replace a base game item for everyone. Simple but destructive, and conflicts between packs are common.
  • Add-on clothing (recommended): a new collection that adds new drawables on top of the base game.

An add-on clothing pack for the male freemode ped looks like this:

Text
my_clothes/
├─ fxmanifest.lua
├─ mp_m_freemode_01_mp_m_mypack.meta      collection metadata
└─ stream/
   ├─ mp_m_freemode_01_mp_m_mypack.ymt    ped variation data
   ├─ mp_m_freemode_01_mp_m_mypack^jbib_000_u.ydd
   └─ mp_m_freemode_01_mp_m_mypack^jbib_diff_000_a_uni.ytd
fxmanifest.lua
fx_version 'cerulean'
game 'gta5'

files { 'mp_m_freemode_01_mp_m_mypack.meta' }
data_file 'SHOP_PED_APPAREL_META_FILE' 'mp_m_freemode_01_mp_m_mypack.meta'

The file names encode the ped, the collection, the component (jbib = tops, lowr = legs, feet, accs, hair…), the drawable number and texture variants, and the .ymt must match the drawables exactly. Getting this right by hand is tedious, which is why most people use a tool: community tools like Durty Cloth Tool or grzyClothTool build whole packs, and the YMT Creator generates the .ymt for a pack from its drawable and texture file names. Server owner steps are in Maps, MLOs and clothing.

Props

A custom prop needs:

  • the model .ydr (and its .ytd if textures aren’t embedded) and usually a .ybn collision,
  • a .ytyp that defines the archetype (name, bounding box, LOD distance, textures),
  • a .ymap if you want it placed in the world, or CreateObject from a script.
fxmanifest.lua
fx_version 'cerulean'
game 'gta5'

data_file 'DLC_ITYP_REQUEST' 'stream/my_props.ytyp'

Create the .ytyp with the YTYP Creator, which calculates the bounds from your model’s XML, and find base game props to reuse in the Objects / Props List.

Maps (YMAP) and MLOs

  • A .ymap places entities (props, buildings) with position, rotation and LOD distance. Drop it in stream/ and it loads with the resource.
  • Map resources traditionally add this_is_a_map 'yes' to the manifest.
  • An MLO is an interior: a .ytyp with rooms, portals and entity sets, plus a .ymap that places it, plus models and collisions. Most MLO resources declare their .ytyp with DLC_ITYP_REQUEST.
  • Many MLOs replace or edit parts of the base map, so two MLOs in the same spot conflict. Only use one per location.

Build simple placements with the YMAP Builder (props by coordinates, with correct rotations, extents and LOD distances), or use CodeWalker for full map editing. The Interactive Map helps you find coordinates.

Sounds

Custom sounds in FiveM use the game’s native audio system: an .awc wave bank plus .dat54.rel data, registered with AUDIO_WAVEPACK and AUDIO_SOUNDDATA entries, then played with natives like PlaySoundFromEntity. The Native Audio Builder turns WAV, MP3 or OGG files into a ready resource (bank, data, fxmanifest.lua and Lua). For simple UI sounds, NUI audio (an <audio> tag in your page) is often enough.

Textures

  • .ytd files hold textures. Every texture uses video memory on every client that loads it.
  • Most “texture loss” (blurry or missing textures when many players and cars are around) comes from oversized textures, typically 4K textures on add-on cars and clothes.
  • Edit or replace textures inside a .ytd export with the Texture Editor.

Keep it light

FXServer prints a warning when an asset uses a lot of physical memory (“oversized assets can and WILL lead to streaming issues”). Take it seriously:

  • 2048x2048 is the practical maximum for most textures, 1024 or 512 for small parts. Nobody sees the difference on a door handle.
  • Use DXT1 for textures without alpha, DXT5 or BC7 with alpha, and generate mipmaps.
  • The YTD Optimizer shrinks many .ytd files at once: caps texture size, picks compression, rebuilds mips and shows the memory saved.
  • Keep proper LODs on your models, so far away objects are cheap to draw.
  • Every MB you stream is downloaded by every player on first join. Remove packs nobody uses.

Workflow summary

  1. Get or make the asset (Blender with Sollumz for models, CodeWalker for maps, a clothing tool for clothes).
  2. Put binaries in stream/, metas in data/.
  3. Write the manifest (the fxmanifest Generator has a vehicle pack preset with all the data_file lines).
  4. Validate, optimise textures.
  5. refresh, ensure, test in game, check the server console for warnings.

The video archive has full courses on streaming vehicles and clothing, CodeWalker and Blender with Sollumz.

Next: Publishing a resource.