[FREE][ENG | 日本語] Oversized Assets Logger

oversized assets error messages

Are you tired of tracking down all the oversized asset that are shown on server console? Well, this could be your lifesaver. This script automatically exports the names of oversized assets and save it into one txt file. You do not have to scroll up and down the entire server console to read through error messages anymore!

download from github

Usage

Simply download the script and put it into resource folder. It will do the rest of the work for you.

However, you need to keep in your mind that this script need to start BEFORE the oversized assets start. You can change the order in server.cfg.

Let’s assume you have oversized ytd files and ydr files in [vehicles] and [defaultmaps] categories. Your server.cfg might look like this:

ensure [qb]
ensure [standalone]
ensure [voice]
ensure [vehicles]
ensure [defaultmaps]

In this case, you need to ensure the script before those…

ensure [qb]
ensure [standalone]
ensure [voice]
ensure NB_OversizedAssetLogger
ensure [vehicles]
ensure [defaultmaps]

and restart the server.

After the server restart, you will see the Oversized_assets.txt on root directory, which is:

D:\txData\QBCoreFramework_XXXXX.base\Oversized_assets.txt by default.

サイズが大きすぎるアセットログ出力スクリプト

FiveMのサーバーに何も考えずに車やMLOを入れると大抵以下のログがコンソールに出てくると思います。

Asset ~~~.ytd uses 100.0 MiB of physical memory. 
Oversized assets can and WILL lead to streaming issues (such as models not loading/rendering).

このログは直ちにサーバーのパフォーマンスに影響することはないものの、積み重なるととんでもないラグや低VRAMのクライアントでテクスチャ抜けなどを発生させるため、調整が必要です。

しかし、リソース数が多くなるにつれて、コンソールでログを追うのが難しくなります。私のサーバーでは500近くのリソースが動いていますが、コンソールはあっという間に流れるので追うのが大変です。

そこでこのツールでサイズが大きすぎるアセットのログのみを出力して、ファイルサイズの調整を行いやすくしましょう。

使い方

ダウンロードしてリソースフォルダに入れておくだけで勝手に動いてくれます。ただ、ensureする順番が非常に重要です。サーバーを起動する前にserver.cfgを編集して、リソース開始の順番を変更しましょう。

ここでは [vehicles] と [defaultmaps] カテゴリにオーバーサイズのytdファイルやydrファイルを格納していると仮定します。server.cfgではこんな感じになっていると思います。

ensure [qb]
ensure [standalone]
ensure [voice]
ensure [vehicles]
ensure [defaultmaps]

この場合、リソース開始の順序を下記のように変更しましょう。

ensure [qb]
ensure [standalone]
ensure [voice]
ensure NB_OversizedAssetLogger
ensure [vehicles]
ensure [defaultmaps]

サーバー再起動をすれば完了です。

再起動が終わると、rootディレクトリに Oversized_assets.txt が生成されます。デフォルトの場所は

D:\txData\QBCoreFramework_XXXXX.base\Oversized_assets.txt です。

REGISTER_CONSOLE_LISTENER - FiveM natives

License

You can do whatever you want with this. Credits are always appreciated tho.

15 Likes

EDIT: Thank you so much for those who reached out to me and downloaded the script! I have few things to say regarding my oversized asset logger:

  • This script only helps you find oversized asset names. What it does is just find logs containing “oversized” and extract them to txt file. You need to optimize them using other tools.

  • To optimize the texture files, you have multiple options.

  1. Use photoshop
    The best option IMO. You rarely encouter bugs when manually extract dds and edit them in photoshop. Photoshop can be very useful if you customize your vehicles and MLOs so I can assure you that learning photoshop is beneficial for vehicle developers (such as me), MLO creators or any FiveM server owners in general.

  2. Use resize tools
    It seems XnResize is very popular among Cfx.re community. You can easily find dozens of articles on how to use it, so go ahead and read one that you like.

  • Tips on resizing texture
    Looks like a lot of you encounter the texture flickering bug when you resize the texture. I know the pain because I have done that multiple times lol. However, the reason why this happens is because you resized the textures that are already very small alongside with large texture files.
    You need to keep in your mind that you need to extract ONLY OVERSIZED TEXTURE FILES, RESIZE THEM, AND PUT IT BACK TO YTD OR YDR FILES. This way, you can minimize the risk of the bug.

Hope this helps!!!

NickyBoy - Lead vehicle developer @Flecity_Network