Sign in to follow this  
alqossam

how to compress dff and txd file

Recommended Posts

how to shrink the size of txd and dff

Share this post


Link to post

As far as I'm aware you can't compress TXD or DFF.

You should compress the images you use rather than the actual TXD. Also don't use huge dimensions for your textures if they are for something that isn't important, or something small. I don't really use many custom TXDs in my stuff but I imagine 512x512 would be the biggest you want your images to be.

Again, you can't compress a DFF. File size is linked with the amount of polys used in your models, so you should work on decreasing them - this is especially true if you're downloading free models from around the web as most of them won't be optimized.

Share this post


Link to post
1 hour ago, CodyJ(L) said:

You can compress TXDs, using magic TXDs; ass for DFFs they can be optimized, but not compressed

Does that actually compress the TXD though or the images?

Share this post


Link to post

With the right settings, the images retain their quality, while the file size drops a crap load. (I got 1.5GB worth of TXDs down to 513mb)

Share this post


Link to post

It is possible to compress dff files, but you'll need to use a Lua library to accomplish that. You can use: https://github.com/brimworks/lua-zip

It's basically a Lua module that allows you to compress files in .zip format, I haven't tested it, but I'm making a wild guess that it works. You'll need to load DFF manually by first using the module to compress it, read the compressed file, send it to the client using

triggerLatentClientEvent

Once the client has received the file, decompress it using the same module, and you'll get a string then use

engineLoadDFF ( "yourDFFStringHere" )

to load the file.You save up to 45%.

 

EDIT: Looks like the module is using C code, I guess you can't achieve it without that. I tried looking for some modules written in pure lua, I couldn't find any of them. Try looking by yourself, you might possibly find one.

Edited by Saml1er
Removed a '\n' character from a line.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.