Jump to content

[Quick Tutorial] Lowering the quality of your compiled assets


Hornete
 Share

Recommended Posts

Hey all, here to give a quick tutorial on how to intentionally lower the quality of your compiled builds, similar to how Klei does it!

Wait, why would I want to intentionally lower the quality of my assets? HD = Good right?

There's a few reasons you might want to do this, some reasons such as

  • Saving on memory, the lower quality the asset, the less RAM the asset takes up (DST is only able to use a small amount of ram, 4 GB per instance of DST can be used at max, now of course a few high quality assets isn't going to blow your game up. However, if you're making a large mod with a lot of assets, all of the assets being HD could take up a lot of memory, this problem is especially intensified if the user enables other mods with lots of assets too
    Edit: The game now has a 64 bit version which means the game can use more than 4 GB of ram per instance which is awesome! Some people will still use the 32 bit version, so if you want to be kind, then you can keep lowering the quality of your assets just so those people can have a better time running your mod, your choice though!)
  • Trying to fit your asset in with others (A lot of assets in DST are unfortunately low quality, and depending on the context and usage of your asset, it could look very strange having a high quality asset next to a low quality asset in your mod so some people might want to intentionally lower the quality of their asset so it can fit in with another low quality asset)
  • The lower the quality, the smaller the atlas's and less atlas's will be made. (Atlas texture files can only go up to a size of 2048x2048 size, and the game tries to fit as many sprites as it can into the atlas's, now luckily it creates more atlas's if it needs more space. Unfortunately, if your build has more than two atlas's, it will break and look very strange and weird in-game, with sprites breaking and animations looking all out of wack, I know someone who got 7 atlas's compiled in one build! and oh man, their poor sprites broke so hard. Lowering the quality of your asset means more sprites can fit in the atlas files and that means less atlas's in your build)

Okay, how do I do it?

You'll need to go to your Mod tools files, the directory there will likely look something like this.

C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\scripts


Go there, and you should see a file named "buildanimation.py"
image.thumb.png.4d617d690529c1f5915b0863243dcfdd.png

Open the file with a text editor, and go to line 503, or somewhere around there, and you should see this part in the file

image.png.fd796e72263e52fe8970292ee404870d.png

That "SCALE_FACTOR" variable is what we want to override, usually it is set to a value of 1 (aka, no change to the quality of the asset). Now you can set your own factor! I believe Klei uses a factor of 0.33 for a lot of their low quality assets(aka, 66% lower quality). Now that you changed it you can compile whatever assets you'd like to be lower quality, if you'd like to revert back, simply replace what factor you put in back with "results.scale", or whatever it was before.


I hope you might find this useful, happy modding!

Edited by Hornete
Corrected a mistake
  • Like 4
Link to comment
Share on other sites

4 minutes ago, IronHunter said:

How do you get your atlas's to compile to 4096x4096? mine seem to default to 2048x2048

image.png.cc3343949721f7ffeed2e6d39913fd1d.png

Oops! I made a mistake, youi're correct 2048 is actually the max size, thanks for comment, I corrected it in the main post now :)

Edit: You can actually increase this size if you want, but I wouldn't reccommend it, I remember a developer saying the game would break if the max texture size was above 2048 and there's a reason they capped it at that size.

Edited by Hornete
  • Thanks 1
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...