Poom Poom Shop Pass · 29.99€/mo

Mapping

YMAP, YTYP, YBN, YTD: the FiveM map file types decoded

NXBy Team NolX
· 4 min read

Grapeseed Cottage

Open the stream folder of any MLO and you get a wall of files with strange extensions. Once you know what each one does, debugging a map gets much easier, because most bugs point straight at one file type.

The quick reference

Extension What it holds Think of it as
.ymap Placements of objects in the world The floor plan
.ytyp Archetype definitions, MLO rooms, portals, entity sets The catalogue and blueprint
.ybn Collision geometry What you can touch
.ydr A single model One object
.ydd A dictionary of several models A box of objects
.yft A fragment model (breakable or with physics parts) Objects that move or break
.ytd Texture dictionary The paint

Now the longer version.

.ymap: where things go

A .ymap lists entities and their positions, rotations and settings. "Put a chair model here, rotated 90 degrees." It also holds the placement of the MLO itself in the world, plus things like car generators, timecycle modifiers and occlusion data.

Rockstar's map is split into hundreds of ymaps by area. When a mapper removes a vanilla building, they are usually editing one of these vanilla ymaps to delete that entity. That is the reason two maps in the same neighbourhood can conflict, which is explained in why two maps of the same area break each other.

.ytyp: what things are

A .ytyp defines archetypes: the model name, its bounding box, its texture dictionary, its LOD distance, flags. For an MLO, the .ytyp is where the interior really lives:

  • the list of rooms and which props belong in each,
  • the portals linking rooms to each other and to the outside,
  • the entity sets you can toggle,
  • per-room settings such as the timecycle that controls lighting.

FiveM needs to be told to load custom .ytyp files. In the fxmanifest.lua you will often see:

fx_version 'cerulean'
game 'gta5'

this_is_a_map 'yes'

data_file 'DLC_ITYP_REQUEST' 'stream/my_interior.ytyp'

this_is_a_map 'yes' tells FiveM the resource contains map data. The data_file line makes sure the archetypes are registered. On escrowed maps you do not need to touch this, but it is worth recognising.

.ybn: what you can touch

Collisions are completely separate from what you see. A wall can be perfectly visible and have no collision, so you walk through it. Or there can be collision where nothing is drawn: the infamous invisible wall.

Interiors usually have their own .ybn, and MLOs that replace a vanilla building ship an edited vanilla .ybn with the old building's collision cut out. If that edited file gets overridden by another resource, the old collision comes back. The common MLO bugs guide walks through how to spot it.

.ydr, .ydd, .yft: the models

These are the actual 3D meshes.

  • .ydr is one drawable: a sofa, a wall section, a lamp.
  • .ydd packs several drawables together. Common for sets of related props.
  • .yft is a fragment: something with breakable parts or physics, like a fence that snaps, a sign that swings, or glass that shatters.

Each model also carries its LODs, the lower-detail versions shown at distance. A model with bad or missing LODs looks fine up close and pops horribly as you drive in.

.ytd: the textures

Texture dictionaries hold the images models use. A .ytd can be embedded in a model or shared between many.

Textures are where performance quietly dies. A single house with uncompressed 4K textures on every cushion can push players with mid-range graphics cards over their streaming memory budget. The symptom is "texture loss": blurry or missing textures across the city, not just in the new map. If that starts after you add a map, check the size of its .ytd files.

How they fit together

When a player approaches a building, the game roughly does this:

  1. Loads the ymap for that area and sees there is an MLO placed here.
  2. Looks up the MLO archetype in the ytyp, reads rooms, portals and entity sets.
  3. Streams the ydr/ydd/yft models for active entities.
  4. Loads the ytd textures those models reference.
  5. Loads the ybn collisions so the player does not fall through the floor.

If step 5 is slow or a file is missing, you get the "fell through the world on arrival" bug. If a portal in step 2 is wrong, rooms vanish when you look through doorways.

The tools people use

  • CodeWalker is the standard for viewing and editing ymaps, ytyps and collisions directly in a 3D view of the map. Most of the debugging advice you will find online assumes CodeWalker.
  • Blender with Sollumz handles models and collisions: importing, editing and exporting ydr, yft and ybn files.

You do not need to master either to run a server. But being able to open a ymap in CodeWalker and see which entities it removes or adds will save you hours. It is also why we leave our modified vanilla files unencrypted: so you, or whoever manages your maps, can open them and merge when needed.

Keep reading

More from the Journal