How to optimise a FiveM vehicle: polygons, LODs and texture budget

By Nilo3D · Updated:

A FiveM vehicle is optimised when each streamed file needs 16 MiB of memory or less, the model has lower-detail meshes for distance, and vehicles.meta tells the game when to switch between them. In practice that means textures of 2048 pixels or smaller in a compressed format, four LOD levels under the high-detail mesh, and lodDistances such as 10, 25, 50, 100, 500, 500.

What should I aim for?

FiveM sets no polygon limit. What the server measures is the memory each streamed file needs once loaded, and it warns above 16 MiB per file. So the target is per file, not per vehicle: the .yft, the _hi.yft and the .ytd are each checked on their own. The steps of that warning are in vehicle model files and the oversized asset warning.

FileWhat makes it heavyWhat to do
.ytdTexture resolution and formatResize and compress textures.
_hi.yftTriangle count of the detailed meshRemove geometry nobody sees, reduce dense parts.
.yftTriangle count of the lower levels, plus collisionMake real lower LODs instead of copies of the detailed mesh.

A number from our own work: a sim-racing car we converted arrived with about 512,000 triangles. After the conversion and before any reduction, its model file still needed about 28 MiB of virtual memory, well past the first warning step. Models built for other games are not built to this budget, so expect to reduce them.

How do I measure a vehicle?

  • Server console. Start the resource and read the console. A line naming the file and its MiB appears for every file over 16 MiB. No line means every file passed.
  • Triangles per level in Blender. In Sollumz Tools > Drawables > LOD Tools > Auto LOD, select a Drawable Model and the panel shows LOD Statistics: triangles and vertices of each level that has a mesh.
  • Textures. Memory per texture depends only on resolution and format. The table is in the model files guide: a 2048 x 2048 DXT5 texture is 5.33 MiB, a 4096 one is 21.3 MiB.

Which LOD levels does a vehicle have?

Sollumz gives every Drawable Model five slots. On export the top one becomes the _hi.yft and the other four go into the main .yft.

Sollumz levelFilelodDistances value that ends itStock Sultan
Very High_hi.yft1st10 m
High.yft2nd25 m
Medium.yft3rd50 m
Low.yft4th100 m
Very Low.yft5th500 m

The sixth value is where the vehicle stops being drawn. The distances live in vehicles.meta, not in the model:

<!-- _hi, High, Medium, Low, Very Low, fade out (metres) -->
<lodDistances content="float_array">
  10.000000
  25.000000
  50.000000
  100.000000
  500.000000
  500.000000
</lodDistances>

The stock Faggio scooter uses 15, 30, 50, 100, 500, 500. A mistake we have seen in converted cars is a line like 10, 150, 150, 150, 150, 150: the High mesh is drawn out to 150 m and then the car disappears, so the lower levels are never shown even if the model has them. The field is explained in vehicles.meta explained, and what LODs are in what are LODs in FiveM vehicles.

How do I create LODs with Sollumz?

Open Sollumz Tools > Drawables > LOD Tools > Auto LOD. The tool copies a reference mesh and reduces it for each level you tick, then Generate LODs fills the slots.

SettingDefaultMeaning
Reference MeshThe mesh to copy and reduce. Use the most detailed one.
MethodCollapseCollapse is the general-purpose choice. Un-Subdivide suits meshes made by subdivision, Planar dissolves flat areas.
Decimate Step0.6One uniform step applied for each level.
Per-LOD RatiosOffWhen on, each level gets its own ratio. The defaults are 0.90, 0.70, 0.50, 0.30 and 0.15 from Very High to Very Low, and a level can use a target triangle count instead.
Decimate from OriginalOffReduce every level from the reference instead of from the level above.

Automatic reduction is a starting point. What we check by hand afterwards:

  • Lights. Small glowing parts collapse into nothing first. Keep the original mesh for indicators and taillights on every level, or protect them from the reduction.
  • Parts on different bones. Reduce each model on its own so a door never shares a vertex with the body.
  • Silhouette. The lowest level only has to look right from 100 m or more. Interior, engine and underside can go entirely.
  • Motorcycle wheels. On the two-wheelers we built, the game did not draw the separate wheel model at the lowest level. Stock bikes handle this by putting a simple wheel shape inside the body mesh of that level, and we do the same.

What texture sizes should a vehicle use?

These are the sizes we use by role. Never upscale: a texture that arrives at 1024 stays at 1024.

TextureSize
Livery, main atlas, lamp lenses2048
Body normal map, tyre1024
Tiling detail textures (carbon, fabric, grilles)512
Small interior parts256
Flat colours4 x 4
  • Format. DXT1 (BC1) without transparency, DXT5 (BC3) with it. A DXT1 texture uses half the memory of the same texture in DXT5.
  • Flat colours. Save 4 x 4 single-colour textures uncompressed. They cost almost nothing, and block compression shifted our dark greys towards purple and green.
  • Shared textures. Specular, normal and dirt maps that already exist in the game's shared vehicle textures do not need a copy in your .ytd.
  • Unused textures. Converted models carry textures no material uses. Delete them.
  • Convert outside Blender. Resize and compress with a texture tool and load the result. Re-saving images from Blender darkened ours.

Can I optimise a vehicle that is already finished?

Yes, from its source file. Open the .blend the vehicle was exported from, add the lower levels and export again. What we avoid is importing a finished .yft into Blender and exporting it back: the round trip rewrote small values in the skeleton, and on one of our vehicles that was enough to break its entry and exit animations in game.

Textures are safer to change afterwards. A .ytd can be opened, its textures replaced by smaller ones with the same names, and saved, without touching the model. The tools for each job are in CodeWalker vs Sollumz.

Optimisation checklist

  1. No texture above 2048, none uncompressed except 4 x 4 colours.
  2. No unused textures in the .ytd.
  3. The model has a Very High mesh and four lower levels.
  4. Lights still show on every level.
  5. lodDistances has six rising values, not the same number repeated.
  6. The server console prints no size line for the resource.

The whole modelling workflow is in how to make a FiveM vehicle in Blender with Sollumz. As a reference from our catalog, the Coil S-Cooter and the three hoverboards ship with four LODs, High to Very Low.

Frequently asked questions

How many polygons should a FiveM car have?
FiveM sets no polygon limit. The server measures memory per streamed file and warns above 16 MiB, so the practical limit is a .yft and a _hi.yft that each stay at or under that size.
What lodDistances should I use for an add-on car?
The stock Sultan uses 10, 25, 50, 100, 500, 500 and is a safe starting point. Each value ends one level: _hi, High, Medium, Low, Very Low, then fade out.
How do I make LODs in Sollumz?
Use Sollumz Tools > Drawables > LOD Tools > Auto LOD. Pick the reference mesh, tick the levels to create and press Generate LODs. Then check lights and silhouette by hand.
What texture size is best for FiveM vehicles?
We use 2048 for the livery or main atlas, 1024 for the body normal map and tyres, 512 for tiling details and 256 for small interior parts, all in DXT1 or DXT5.
Does the _hi.yft count towards the 16 MiB check?
Each file is checked on its own. The .yft, the _hi.yft and the .ytd each have to stay at or under 16 MiB to keep the console quiet.

Sources

Products from this guide

All guides