Skip to content
FIVECRATE

How to Optimize an MLO for FiveM: Textures, LODs, Collisions

How to optimize an MLO for FiveM using the Cfx.re docs, Sollumz and CodeWalker: texture size and compression, LODs and lodDist, collisions, rooms, portals.

Environment artist reviewing an interior with wireframe and room-portal overlays beside material samples
Author: FiveCrate
Published:
Updated:
Read time: 15 min
Applies to
FiveM Legacy and FiveM for GTAV Enhanced servers, with or without a framework (Qbox, ESX, QBCore or none). Cfx.re assets manual, Sollumz docs and CodeWalker README as read on December 2, 2026; FXServer size check from the FiveM source at commit 8cbec36a01
Last verified

Direct Answer

To optimize an MLO for FiveM, measure it first, then work on four parts in this order. Measure: read any Asset ... uses X MiB lines in the server console and open strmem in the client. Textures: power-of-two .dds files, compressed (DXT1 for models), with mipmaps, no larger than 2048, shared through a texture dictionary under 16 MiB. LODs: add Medium, Low and Very Low meshes and set a sensible LOD distance. Collisions: build the .ybn from primitive boxes, apply a flag preset and set a Room ID per room. Then check rooms, portals and occluders, regenerate _manifest.ymf and measure again.

What an optimized MLO is in FiveM

An MLO is an interior: an MLO archetype in a .ytyp that holds rooms, portals and the entities inside them, placed in the world by a .ymap. Its look comes from drawables (.ydr) and texture dictionaries (.ytd), and its floors and walls from collision files (.ybn). The CodeWalker README sums up the split: archetypes “define objects that are placeable, and Entities define where those objects are placed”.

Two separate systems see the cost of those files:

  • FXServer reads the declared size from the header of each streamed file when the resource starts and prints a warning above 16 MiB.
  • The game client loads and unloads the files through the GTA streamer as players move. The server’s own warning text names the risk of oversized files there: “models not loading/rendering”.

An optimized MLO keeps both small: each file under the server’s warning line, and no more detail loaded than players can see. Nothing in this guide depends on a framework. A map resource is a stream folder and an fxmanifest.lua, so the steps are the same on a roleplay server running Qbox, ESX or QBCore, a PvP or racing server, a zombie server or a server without any framework.

How to measure what an MLO costs

Measure before you change anything, so you can compare afterwards.

Server console: the asset size lines

When a resource starts, FXServer checks the physical and virtual size of every streamed file and prints a line in the form Asset <resource>/<file> uses <size> MiB of physical memory. (or virtual memory). The thresholds come from ValidateSize in ResourceStreamComponent.cpp:

Declared sizeConsole colour codeExtra sentence
16 MiB or lessno line printednone
above 16 MiB, up to 32 MiB^4none
above 32 MiB, up to 48 MiB^3none
above 48 MiB, up to 64 MiB^3“Oversized assets can and WILL lead to streaming issues (such as models not loading/rendering).”
above 64 MiB^1the same sentence

The check runs twice per file, once for physical memory and once for virtual memory, so one file can print two lines. The full explanation of these lines, and how to shrink a .ytd that prints one, is in the guide to the FiveM oversized assets warning.

Client console: strmem, strlist and strdbg

Open the client console with F8. Three developer commands show what the streamer is doing:

  • strmem true “Shows a listing of streaming memory used by specific streaming assets, as well as a global overview.”
  • strlist true is “a graphical interface showing the entries registered in the GTA streamer, and their current status.”
  • strdbg true shows “what is currently being loaded in the GTA streamer”, which helps “when the world stops loading.”

These need client developer mode. On FiveM Legacy, launch the client with +set moo 31337 or use a non-production update channel such as Beta or Latest. On FiveM for GTAV Enhanced the +set moo 31337 argument was removed: the server must set sv_devMode true in server.cfg. Enhanced also has con_streamingMonitor true, which shows the Streaming Tool dev tool; the Cfx.re docs list it among the variables “only available in FiveM for GTAV Enhanced”. Walk through the MLO with strmem open and note what its files take, then compare after each change.

resmon opens the resource monitor, which “monitors the CPU usage and memory usage for each resource”. Use it for the door, elevator or entity-set scripts that come with an MLO; the resmon and profiler guide explains how.

CodeWalker: look at collisions and LODs

In the CodeWalker World View, the Selection tab of the right-side panel switches selection from Entity to Collision, which lets you click a collision and read its .ybn name. The README also explains that CodeWalker picks the level of detail for each branch of the LOD tree by its distance from the camera, so you can move the camera away from the MLO to see its LOD models.

Optimize MLO textures: resolution, compression and mipmaps

The Sollumz docs and the Cfx.re assets manual agree on the basics.

Resolution: power of two, 2048 at most

Sollumz states that texture resolution must be a power of two, for example 16x16, 32x16, 512x512 or 512x16, and that the file “needs to be .dds and not jpg, png, or any other file format.” Its FAQ adds: “Maximum recommended size for textures is 2048 to ensure your model is optimised.”

Sollumz’ own interior tutorial keeps the set small: one set of textures per room, with a roof, a wall and a floor.

Compression: DXT1 for models

The Cfx.re assets manual asks for “Textures compressed in the .dds format” and names NVTT (Nvidia Texture Tools) as a tool to create them. The Sollumz FAQ says to save “in dds format with mipmaps and as a dtx1 for models.”

DXT1 is the Direct3D 9 name of BC1. Microsoft’s block compression docs give the effect: BC1 “reduces the memory required from 48 bytes” to 8 bytes for a 4×4 block of colour data, and BC3 (DXT5) reduces 64 bytes to 16 bytes for colour with alpha. Block compression works on 4×4 texel blocks, so a compressed texture must be a multiple of 4 in all dimensions; a power-of-two size of 4 or more satisfies that.

One exception: textures named script_rt_... must stay uncompressed. Sollumz’ Enhanced conversion notes, in their answer to an ERR_GFX_STATE crash, say the game expects D3DFMT_A8R8G8B8 for them, saved “without mipmaps.”

Mipmaps

Save normal textures with mipmaps (the Sollumz FAQ asks for them, see above). They are also required for HD texture dictionaries: Sollumz exports textures marked HD “to a +hi.ytd at full resolution, while the base .ytd contains half-resolution versions. For this, it is necessary for the textures to have mipmaps.”

Texture dictionary size: shared .ytd or embedded

A texture can be embedded in the model or stored in a texture dictionary. Sollumz explains the difference: “Compared to embedded textures, texture dictionaries allows you to share textures between multiple models and reduce asset file sizes.” In an MLO, where many props and room shells reuse the same materials, one shared .ytd avoids storing the same image in every .ydr.

Keep each dictionary under the 16 MiB line of the server check. If one dictionary for the whole interior would cross it, split the textures over several dictionaries (for example one per floor or per room group) and point each archetype at its own dictionary in the Texture Dictionary field of the .ytyp.

Two settings control HD textures:

SettingWhereWhat it does (Sollumz docs)
HD toggle per textureSollumz Tools > Texture DictionariesExports a +hi.ytd at full resolution and a half-resolution base .ytd
HD Texture DistanceArchetype in the .ytyp“Distance at which the HD Textures (+hi.ytd, +hidr.ytd) load”
Suppress HD TXDsArchetype flag“High detail texture dictionaries are never streamed in, useful for props never seen close up”

An HD dictionary must also be listed in _manifest.ymf under HDTxdBindingArray.

MLO LODs and lodDist

A LOD (level of detail) is a simpler version of a model drawn when the camera is far away. The .ydr format holds up to four: Sollumz lists “4 LOD levels: High, Medium, Low, and Very Low”, and the CodeWalker README says a drawable “can contain a Texture Dictionary, and up to 4 LODs of a model.”

Add Medium, Low and Very Low meshes

In Blender with Sollumz, a converted drawable starts with only its High mesh. Assign the other levels in Mesh Properties > Sollumz LODs. For a first pass, Sollumz Tools > Drawable > LOD Tools has an Auto LOD tool that uses the decimate modifier; Sollumz warns that “the decimate modifier does not work well for all topologies”, so check each level. The Sollumz FAQ also advises using face count, not vertex count, as the measure: “Number of faces is more representative of the model quality/performance.”

LOD distance: archetype and entity

Three fields decide when a model unloads:

FieldWhereMeaning (Sollumz docs)
LOD DistanceArchetype (.ytyp)“Distance at which the object unloads”
LOD DistanceEntity (.ymap)Override; “The default -1 uses the LOD distance defined in the archetype.”
Child LOD DistanceEntity (.ymap)Override of the LOD distance of its children in the LOD hierarchy

Neither the Cfx.re assets manual nor the Sollumz docs give recommended values; Part 6 only says to set the LOD entity’s distance to an “increased value based on desired streaming distance”. Set the distance to what players can actually see: a small prop inside a closed room does not need to stay loaded from far down the street.

HD and LOD entities in YMAPs

For a large exterior that should stay visible from far away, Part 6 of the Cfx.re assets manual links an HD model to a separate LOD model through the YMAP LOD hierarchy:

  1. Make two models in Blender: an HD model (full detail) and a LOD model (simplified geometry and materials). Convert both to drawables and add both as archetypes to a .ytyp.
  2. Create the HD YMAP in the CodeWalker project window. Place the HD entity and set Flags to LOD in Parent Map and LodLevel to LODTYPES_DEPTH_HD.
  3. Create the LOD YMAP. Place the LOD entity at exactly the same coordinates and set ChildLodDist to the HD entity’s LodDist, LodDist to a larger value for the distance you want, and LodLevel to LODTYPES_DEPTH_LOD.
  4. Link the two. Set the LOD YMAP’s file name as the Parent of the HD YMAP. In the LOD Hierarchy tab, set the HD entity’s ParentIndex from -1 to 0 and the LOD entity’s NumChildren to 1.
  5. Generate the manifest with Tools > Manifest Generator and save _manifest.ymf.

The game’s own map works the same way on a larger scale: the CodeWalker README describes a hierarchy of “up to 6 levels of detail”, from a few large models at the root to detailed objects at the leaves. The FiveM mapping tutorial covers YMAP basics.

Sollumz can split a map for you: in Auto partitioning mode it creates child containers for entities and car generators (strm), entities with large LOD distances (long), critical entities (critical), interiors (milo) and grass, with the LOD entities left in the parent YMAP.

Optimize MLO collisions

Collision lives in .ybn files. Sollumz describes three kinds: normal ones, hi@ versions “for weapon bullets” and ma@ collisions used to spawn grass and objects such as street litter.

  1. Do not reuse the visual mesh as is. Sollumz’ static collision tutorial says primitive shapes (“Bound Poly Box”, “Bound Poly Capsule”, “Bound Poly Sphere”) “should be used for majority of your collisions”, because this “is more performance friendly and reduces unnecessary asset size.” Use a mesh only where a shape cannot be built from primitives.
  2. Apply a flag preset to the Bound GeometryBVH. Sollumz calls a missing preset “A very common mistake”, “resulting in the collision not working in game.”
  3. Assign collision materials so footsteps and gunshots behave as intended, matching the visual material of each surface.
  4. Give each room its own floor material so its Room ID can be set: “The floor material need to be different for each room so the room ID can be set to the material.”
  5. Use world coordinates for a separate .ybn. The Cfx.re manual says new collision objects go “in World Coordinates” and must be parented to the correct Bound GeometryBVH. For a collision embedded in a model, it uses Collisions > Create Bounds with a Bound GeometryBVH.

If players fall through the optimized interior, the MLO collision guide lists the causes.

Rooms, portals, occluders and entity sets

Rooms and portals. The MLO archetype defines the rooms, including a limbo room, and the portals between them. In Sollumz you create the limbo room first, then one room per space, and set each room’s bounds from the collision with Set Bounds From Selection. Portals are drawn over the four corners of each doorway, from inside to outside; Flip Direction turns a portal whose arrow points the wrong way, and the tutorial stresses: “It is very important to go out from inside when limbo is one of the parts.” Wrong values show up quickly: the Sollumz FAQ says an MLO that disappears in first person but not in third person usually has “the wrong Room ID in the floor’s collision material or the portals are incorrectly assigned.”

Occluders. Sollumz describes occluders as “a rendering optimization to determine which objects are hidden from view and avoid rendering them”, stored as box occluders or low-poly model occluders.

Entity sets. Sollumz supports entity sets in MLO archetypes. A script switches a set on or off by name with the natives ACTIVATE_INTERIOR_ENTITY_SET and DEACTIVATE_INTERIOR_ENTITY_SET, and can read its state with IS_INTERIOR_ENTITY_SET_ACTIVE. Neither the native reference nor the Sollumz docs state how much memory an inactive set saves, so measure it with strmem rather than assume it.

Step by step: optimize an MLO you already run

  1. Record the baseline. Restart the resource, copy its Asset ... uses lines, then walk through the MLO in game with strmem true.
  2. Check that you can edit it. Asset Escrow prevents others from modifying or accessing protected files, and it supports Lua, YFT, YDD and YDR files. Escrowed models have to be optimized by their creator.
  3. Open the files in CodeWalker RPF Explorer and Blender with Sollumz.
  4. Fix the textures: power-of-two .dds, DXT1 for models, mipmaps, 2048 at most, shared dictionaries under 16 MiB.
  5. Add LODs and set LOD distances in the archetypes.
  6. Simplify collisions with primitives, a flag preset and one floor material per room.
  7. Check rooms and portals, then add occluders where large parts are hidden behind walls.
  8. Recalculate and regenerate. In CodeWalker select the YMAP and click Calculate Extents and Calculate All Flags, then generate and save _manifest.ymf.
  9. Restart and measure again, with the same walk through the MLO as in step 1.

FiveCrate’s MLO catalogue lists the interiors it publishes.

MLO optimization on FiveM for GTAV Enhanced

FiveM for GTAV Enhanced loads a stream_enhanced folder instead of stream when a resource has one; stream still works without it but is deprecated. The official converter, Alchemist, converts YDR, YTD, YFT, YPT and YDD from Legacy (Gen8) to Enhanced (Gen9) and needs Windows 11. Sollumz can export native files or CodeWalker XML for Legacy (Gen8) or Enhanced (Gen9). Sollumz’ Enhanced conversion tutorial also warns that “GTAV Enhanced has a limit of 128 materials/geometries per file and exceeding that value leads to crashes”, so keep material counts low when you optimize for both platforms.

Troubleshooting

The MLO disappears in first person

Check the Room ID in each room’s floor collision material and the portal assignments; the Sollumz FAQ names these two causes.

The new collision does nothing in game

Apply the General (default) flag preset to the Bound GeometryBVH. For a separate .ybn, Sollumz also says to apply world coordinates to the poly mesh.

The optimized MLO shows in CodeWalker but not in game

Generate _manifest.ymf again from the CodeWalker project window with the MLO, YMAP and YTYP in it, as the Sollumz FAQ advises.

HD textures never load after splitting a dictionary

The +hi.ytd needs mipmaps and an entry under HDTxdBindingArray in _manifest.ymf. Also check that the archetype does not carry the Suppress HD TXDs flag.

Props are dark or glow pink inside the MLO at night

Vertex paint is missing. The Sollumz FAQ: “The very basic rule for Vertex Painting is GREEN for inside MLOs, and RED for outdoors.”

The console warning stays after resizing textures

See the oversized assets guide for the cases where the declared size does not drop.

Next Steps

Browse MLO & interior maps

MLO interiors and maps for FiveM servers: houses, mechanic shops, cafes, restaurants, shops and islands.

Browse catalogue →

Official documentation and repository references