Download

[Feature Request] Automatically strip out unused assets.

I’m packaging my game for the first time and I noticed it’s really huge. 32gigs. There should be a way to automatically strip out unused assets or at the very least, mark assets that are being used with a certain color so you can figure out what ones you can manually strip. It’s gonna take ages to sort through all the content, trying to strip this down to a more manageable size.

I started last month and my project has 25,6gb.
I really recommend to use IncrediBuild to speed up the process of packaging project. I already have free Dev license for one year and it work as well.

That might help a bit, but for me it’s art assets downloaded from the marketplace. Some of the asset packs are huge, but I’m only using a few of the assets in the game. There’s no way to quickly tell which ones are being used or not though so it’s a head ache.

Of course, I know how to migrate individual assets. What I’m saying is, sometimes I load an entire kit, not knowing what assets I’m going to use. Once I do finish using assets, there’s no quick way to see which of those are in use. So migration doesn’t help because I’d still have to know which files are being used to migrate only them.

I’m requesting a feature to either filter by assets being referenced anywhere in the project (or more specifically assets NOT being referenced) or a system to simply strip out the ones that aren’t.
You can click on any asset and view its references so why can’t the engine just run a process that strips out all assets without references? Seems like it would be fairly simple to implement and helpful to every project.

That’s exactly what Migrate allows you to do dude.
Try it… Migrate by Levels + Top-level / base pawns.
You can strip projects that are 30GB down to 3GB.

For some reason…

You’ve blinded yourself to the possibilities here??? :wink:

You’re saying you can migrate an entire package including ui , inputs, custom collision channels etc. Without having to know exactly which assets are being used, to a clean project? I thought migration simply worked by right clicking assets in the content browser? I didn’t think there was an ability to migrate entire projects.

No, if you read the post I linked above it never said any of that!
You need to start out by Migrating all the Levels over manually.
Afterwards you may still need to Migrate some Pawns / NPCs.
You will also need to Export / Import INI Project/Editor settings.
But it can all be done in 5 mins if you want to try… Its up to you…

Oooh, I get you. Sorry, I tried to read it, but I was confused because the original topic was completely unrelated.

By migrating the levels, it pulls all of the assets that were used. That’s actually a brilliant idea. The easy solution actually is that I could simply duplicate my project, strip everything but the folders that I know contain the gameplay-related files, then migrate the levels and everything should be good.

Thank you for this, it’s not my feature request but it’s definitely the next best thing. Apologies for being thick :stuck_out_tongue:

There are assets on the market, like Clean Project (not mine: Clean Project in Code Plugins - UE Marketplace), which you can use to delete unused assets and clean up your project.

Thanks for the link spacegojira. That trick of migrating the maps though worked a charm. I can’t believe I didn’t think of it before.

The problem I have with this approach is that it does not account for objects that you spawn into the world (map) during runtime, so you could potentially miss important assets in the migration.

Oh yeah, that’s a good point. I’ll keep clean project in mind for the future :slight_smile:

@TorQueMoD @spacegojira

True… Migrate is definitely not perfect. There are edge cases where Unreal will miss things first time around (Levels). Which is why after Levels I recommend migrating Pawns / NPC’s next, as that can help to pick up on missed components / actors (and you can just hit ‘No All’ to skip the prompts if everything has copied). Overall, Migrate seems to over-copy than under copy (which ofc is bad in its own way as that can bloat new projects). So you’ll just have to play around with it as YMMV. But for BP projects anyway it seems pretty resilient. How about for mixed C++ / BP projects, anyone have any thoughts???

My project is mixed, but the benefit of that is you know the C++ code is contained in either your plugins or binaries directory. I wouldn’t think it would be any harder than a bp project. Least it wasn’t for me.