İçeriğe geç
YTD Optimizer

YTD Optimizer

How to shrink many .ytd files at once: pick a preset or your own size caps, review the plan per texture, run it and put the smaller files back in stream.

Bu dokümanlar şimdilik İngilizce.

Open the tool Last updated

The YTD Optimizer takes a whole stream folder (or any pile of .ytd files) and makes the texture dictionaries smaller in one go. It caps texture sizes per type, turns opaque DXT5 into DXT1, compresses uncompressed textures and fixes missing mip chains, and shows you the memory saved per file before anything changes. It is for server owners fighting texture loss and FXServer memory warnings on vehicle packs, clothing packs and MLOs.

What it is for

When a resource starts, FXServer checks every file in stream/ and prints a warning for files that need a lot of physical memory. GTA has a fixed texture budget: when a player is near many heavy assets, the game runs out of room and drops things. Textures stay blurry, cars and clothes turn invisible, parts of the map do not render. That is “texture loss”. Smaller dictionaries fix it for everyone, not only for players with weak PCs.

The Physical column in this tool is the number FXServer looks at.

Size What FXServer does
up to 16 MiB Nothing, this is where you want every file.
over 16 MiB Prints “Asset … uses X MiB of physical memory”.
over 32 MiB Same warning, in yellow.
over 48 MiB Adds “Oversized assets can and WILL lead to streaming issues (such as models not loading/rendering)”.
over 64 MiB Same, in red.

The warning is not a hard limit, the file still streams. But it is a good sign of which files to fix first.

Quick start

  1. Make a copy of the resource you want to optimize.
  2. Open the tool and drop the resource folder, its stream folder or single .ytd files. Choose folder and Choose .ytd files do the same. Sub folders are searched; everything that is not a .ytd is ignored.
  3. Pick a preset: Safe, Balanced (default) or Strict.
  4. Look at the file table. After and Saved show the plan. Expand a file to see what happens to each texture and untick the ones you want to keep as they are.
  5. Press Optimize.
  6. Click a texture name to compare before and after.
  7. Press All as zip, extract it over your copy of the resource and restart it.

Rules

Presets

Preset Colour maps Normal maps Spec maps Skip up to For
Safe 2048 2048 2048 128 px Anything players look at up close. Only textures above 2048 shrink, formats and mips get fixed.
Balanced 2048 1024 1024 128 px Most servers. Normal and spec detail is hard to see at 1024, big win on vehicles and MLOs.
Strict 1024 512 512 64 px Crowded servers and big packs (EUP, clothing, vehicle packs with dozens of cars). Check a few close up shots after.

All three turn on Opaque DXT5 to DXT1, Compress uncompressed and Rebuild missing mips, leave BC5 for normal maps off, exclude script_rt_* and use High quality. Changing any setting switches the preset to Custom.

Settings

Setting What it does
Max size Longest side cap for colour maps and everything that is not a normal or spec map (4096 to 128).
Normal maps Cap for normal maps.
Spec maps Cap for specular maps.
Skip up to Textures whose longest side is at or below this are left alone (Nothing, 32, 64, 128, 256 px).
Opaque DXT5 to DXT1 When the alpha of a DXT5 texture is fully opaque, store it as DXT1. Half the memory, pixels stay identical. Not applied to normal maps.
Compress uncompressed A8R8G8B8 and similar to DXT1, or to DXT5 when the alpha is soft.
Rebuild missing mips Adds the missing mip levels, down to 4 px as the game expects. The full size level is not touched.
BC5 for normal maps Stores normal maps as ATI2 (BC5). Cleaner normals at DXT5 size, but many GTA shaders expect RGB normals, so test in game first.
Exclude textures Name patterns, one per line or comma separated. * matches anything, ? one character.
Re-encode quality High or Fast. Only used when pixels really have to change.

Normal and spec maps are recognised by their usage and their name (for example _n, _nrm, _normal, _s, _spec).

Always left as they are: BC7 textures, script render targets and A8 / L8 masks. Nothing is ever upscaled, and a texture is only halved until it fits the cap.

How textures get smaller

Most changes do not touch the pixels at all:

  • Dropping mip levels. A 2048 texture with a mip chain already holds 1024, 512 and so on. Capping it at 1024 removes the top level, nothing is compressed again. Each step saves three quarters of the memory.
  • Opaque DXT5 to DXT1. Looks identical, half the size.
  • Missing mips are added below the full size level, which stays the same.

Re-encoding only happens when the pixels have to change: uncompressed textures, BC5 normals, DXT3, or a downscale of a texture without mips. The plan marks those with (re-encoded).

Name, usage and flags of every texture stay as they were, and the texture count never changes. Files where no texture changes are not rewritten.

Summary panel

  • Physical memory: total before, and the planned (or, after a run, the real) total after, with the amount and percentage saved.
  • Files: files read so far.
  • Textures to change: how many textures the plan touches, out of all textures.
  • Over 16 MiB now and After: how many files FXServer would warn about.
  • Optimize starts the run (turns into Cancel while it runs; finished files keep their result). All as zip downloads the result. Add adds more files.

File table

Sort by Most saved, Biggest or Name. Clear empties the list.

Column Meaning
File File name and folder. Click to expand the texture plan.
Textures Textures to change / total.
Physical Physical memory now.
After Planned size, the real size after a run, or the progress while it runs.
Saved Memory saved.
Largest Size and format of the biggest texture.
Notes The FXServer warning level, plus counts of textures over the cap, with missing mips, uncompressed or not a power of two, and read warnings.

After a run, a .ytd button downloads that single file.

Texture plan

Expanding a file shows every texture with Now and After (size, format, mip count, memory), Saved and What happens, for example 2048x2048 to 1024x1024 (drops 1 mip), opaque DXT5 to DXT1, lossless. Textures that stay the same say why: Already within the rules, Excluded by name, Script render target, BC7 is kept as is, Not above 128 px and so on. Sort by savings puts the biggest wins on top.

Untick a texture to leave it exactly as it is. Unticked textures are copied over untouched.

Compare

After a run, click a texture name to open the compare view: the original on the left and the result on the right, drawn at the same size with pixelated scaling so lost detail is easy to see. Drag across the image or use the Split slider to move the divider, and tick Show alpha to compare the alpha too.

Report

A Markdown report under the table sums it up: preset and rules, textures changed (and how many without re-encoding), physical memory before and after, how many files FXServer warns about before and after, and the 20 files with the biggest savings. Copy for Discord copies it, .md downloads ytd-optimizer-report.md. Before a run it shows the plan, marked (planned).

Terminal
**YTD optimizer report**
Preset: Balanced (max 2048, normal maps 1024, spec maps 1024, skip up to 128 px, opaque DXT5 to DXT1, compress uncompressed, rebuild mips, exclude script_rt_*)
Files: 42, textures changed: 318 of 1204 (291 without re-encoding)
Physical memory: 812.40 MiB -> 401.77 MiB, saved **410.63 MiB** (50.5%)
Files FXServer warns about (over 16 MiB): 17 -> 3

The numbers above are an example layout; yours come from your files.

Output

All as zip is named after the top folder of your drop, for example stream_optimized.zip or my_cars_optimized.zip. It keeps your folder layout and includes every file that was read, changed or not, so you can extract it straight over a copy of the resource.

Put the files back

  1. Extract All as zip over a copy of the resource (or copy the single .ytd downloads into stream/, same names).
  2. Restart the resource and look at the server console: the memory warnings for these files should be gone.
  3. Drive around, look at a few cars, clothes or interiors up close.
  4. Keep the originals until you checked the result in game.
server.cfg
ensure my_cars

No manifest change is needed: the files keep their names and stay in stream/.

Tips

  • Start with Balanced. Go Strict only on packs where memory is the real problem, like 50 EUP uniforms.
  • Emissive and livery textures with text or logos suffer first. Add them to Exclude textures (for example *_livery* or *_sign_*) if they get too soft.
  • Sort by Most saved: often a handful of files hold most of the memory.
  • Rerun on the same files after changing the rules; press Optimize again and the new rules apply to the originals.

Common mistakes

  • Optimizing the only copy. Always work on a copy and keep the originals until you checked the result in game.
  • BC5 normals without testing. Many GTA shaders expect RGB normal maps. Leave BC5 for normal maps off unless you tested it.
  • Mixing old and new files. Extract the zip over the whole folder so no old .ytd is left next to a new one with a different path.

Limitations

  • Only .ytd files. Textures embedded in .ydr, .ydd or .yft files are not changed.
  • Files protected by the Cfx asset escrow are encrypted and can not be read.
  • BC7 textures, script render targets and A8 / L8 masks are left as they are.
  • Everything runs in your browser. No files are uploaded.