Is there a project cleaning tool ?

Hey everyone,

I have noticed how large my project can quickly become (logs, PIE builds, temporary files, and so on) and how drastically smaller it becomes again after each version migration.

I’m talking going from 15 Go to 5 Go here, so pretty important when it comes to saving it now and again. Uploading 15 go is not like uploading 5.

So i was wondering if there exists (or if epic could make) a tool to clean a project. A “clean project” button in the editor would be super nice. Or maybe at least somewhere in the docs a list of the directories i can safely delete before saving my project on the net ?

Thanks

Cedric

I’m not sure if your aware but you onyl need /content/ and yourGame.uproject to run a regular BP only game (/config/ helps too if you have configed options like maps and gamemode but its not nessecary) EVERYTHING else will be regenerated locally. Thus when uploading to the web, cloud, source control, or backups you can delete everything else. I generally delete the /saved/ and /intermediate/ folders.

Also plugins, if you compiled them from source, will have /intermediate/ folders also which can become large, but you didint mention c++.

But you can safely delete everything except /content/ and yourgame.uproject and it will run anywhere with UE4 isntalled. there are no tools that I’m aware of but you could create a bat file (make a .txt file and save it or rename it so the extension is .bat) something like

@echo off
echo Deleting Junk
echo .
echo ..
echo ...
rmdir /s /q /saved/
rmdir /s /q /saved/*
rmdir /s /q /intermediate/*
rmdir /s /q /intermediate/
rmdir /s /q /config/*
rmdir /s /q /config/*
rm *.log
rm *.sln
rm *.whateverelse
echo Project at minimum size
echo Goodbye
ping google.com -n 6 google.com > nul

The echos print lines, @echo off removes the C:\ part and the ping at the end its just a makeshift pause command with no output. Edit it to your needs. I create these sorts of bat files for my project forexample I make one like backup.bat that has a menu for say backup maps to any directory, backup entire /content/ folder to any directory etc.

you can use

:myfunction
echo this is my function
:myfunction2
echo this is fucntion 2

and then you can use goto myfunction2

Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.

1.Create a new project

2.In you old project, migrate the levels to the new project

3.Use the new project, modify some settings. such as project settings - input, start map … and so on

For a C++ project I am seeing many variants of “Game-Number.dll” files that grows pretty quickly. It’s hard to tell which, if any, are necessary. Need to be able to purge the unused ones!

@Nsomnia Sure i can run this bat on my project? i have an insane amount of ~120gb on intermediate and saved folders, this come handly for saving some disk space.

In order for Unreal Engine to work faster, it makes a lot of cache files. It seems even after removing content, the cache relating to said content still remains on disk. What I encountered was, the mobile game I was working on, was perfectly deployable after a proper clean up with the project size of 2.5GB. However before the cleanup, the project size was 10GB! Of course I ran a lot of trial and error with the world composition. Something like Importing and deleting hundreds of landscape tiles and building and removing LODs, etc.
Now this is what I have tried couple of times to reduce the size of the project to the minimum amount possible. This is also what I do when I need to migrate the project to a newer engine. It works with projects running C++/Blueprint.
Before you start make sure your .uproject file should have a blue icon. If not, first look into how to associate your uproject files.


[How to associate the .uproject files in ue4 - Getting Started & Setup - Epic Developer Community Forums][1]

Then follow these steps:

  • Make a copy of your project.
  • You are safe to remove these files, so go ahead and remove them: .vs, Binaries, Build, Intermediate, Saved, [name].sln
  • Right Click on .uproject and click “Switch Unreal Engine Version”
  • Select your desired engine version (or your current one) and watch the project files getting generated.
  • Open up the project in the UE4Editor and if it asks for a rebuild, let it rebuild or just rebuild it in visual studio in case you are using C++

Now you have a clean project. However you gonna see a lot of shader builds.