I solved Unreal Engine's Package Size Problem...

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Unreal Engine games can be really big if you don't know the right settings and a blank project can result in a package size of 321 mbes for a shipping build however there are many ways in which we can reduce the package size and I spent an entire week running countless tests and made new discoveries you're not going to find anywhere else we're going to start out with the rather obvious ones that most people should already know about and then get into the more interesting and obscure methods to demonstrate I'll make a new blank blueprint project in Unreal Engine 5.3 by default it starts up an open world map but to prevent this from ending up in the package I just create an empty level save it and then set it as the default map in the project settings to make a build I just go to platforms windows and here we can see the first important setting that most people will probably know about under binary configuration we can choose between debug game development and shipping to demonstrate I leave this as the default setting which is development and click on package project after it's done we end up with a game that is 692 MB large from a completely blank project what we really want to select here for a finished game is shipping this will lead to a package size of 321 megabytes and it's less than half when you make a development or debug game build they come with additional code that enables debugging features which we're not going to need in a finished game again this is something most people should already know about so 321 megabytes will be our starting point the next setting however is something most people don't know about and it has a huge impact if you plan to release your game on Steam in the shipping build I just created I can go into engine extras redist enus and here I can see an executable for a prerequisite installer that is 48.1 mbes large all Unreal Engine games require certain libraries to be installed to be able to run the game and this prerequisite setup helps with that so in case you want to distribute your game on ich iio or some other Indie sites this can be very useful and should be included however in the case of steam they have their own process for installing prerequisites and will ignore this file anyway in case you want to turn this off you can go to edit project settings and search for prerequisite here you'll want to uncheck include prerequisites installer when packaging the project now we get a file size of 273 mbes this is 48 MB smaller than our last build the next method can also have a huge impact on file size without a lot of work and it involves plugins click on edit and plugins to open up the plugins window on the right side we can click on settings and show only enabled by default unre engine comes with a lot of plugins enabled that will increase your p package size even though you're probably not going to use them some of these are editor plugins that won't increase your package size While others are runtime plugins that will have an impact it's a bit hard to tell these apart and there are also plugins that are critical for making Unreal Engine work properly so it's not recommended to just turn everything off but there are a couple we can turn off safely to make our package size about 50 megab smaller the biggest one that is completely useless for games is the open image D noise plugin this is only used for video production when using a path Tracer and I believe 99.9% of Unreal Engine user users will never need this back in one of our builds we can go to engine binaries wind 64 and see this open image D noise DL file which is 47.4 MB large we can get rid of this for our next build by simply unchecking the open image D noise plugin and restarting the project the new packaged build now is only 225 mbes and 48 MB smaller than the last one there are more plugins which we can turn off to make the package another 50 mb smaller but that comes with certain risks so I'll go over that in more detail during later sections of this video there are also a lot of project settings we can easily change to make the package size slightly smaller some of these are the default now with newer versions of Unreal Engine but it doesn't HT to double check that they are active go to edit and project settings and then click on packaging first you want to confirm that use pack file is active this will package all game content into a single file and save some space next we want to make sure that share material Shader code and shared material native libraries are active this makes sure Shader code isn't duplicated and saves up some space next click on Advanced and confirm that create compressed cooked packages is active this one probably has the biggest impact on file size the next couple of settings are not active by default and can help us reduce the size even more search for exclude editor content when cooking this will make sure that content from the editor folder is not included and saves a few megabytes this can cause issues with missing content however you shouldn't use editor content in your game anyway we can then search for full rebuilt whenever we make a build of a project it will cache certain data to make the next build faster however if you make many changes this could possibly lead to bucks and unused data being packaged when you're just making test builds deactivating this is fine however when making a final shipping build you should activate this even if it leads to longer build times the next settings won't have an effect on a completely empty build but can save you multiple gigabytes if you've been working on your project for a while by default Unreal Engine will not only package all maps that exist in your game but also all assets that are being referenced in any map when you work with assets from the marketplace they often come with demo Maps that can blow up your package size to multiple gigabytes even though they're not used in your game in the project settings we can search for maps and scroll down to the project packaging section under list of maps to include in a package build we can specify exactly which Maps we want to use in our game and only package those for every map you want to package you need to click on the plus icon and then search for the map file in your project folder in my case I only want the map empty in addition we also want to check cook only Maps keep in mind that you need to update this list whenever you add new stages otherwise your game will soft lock if you try to load a stage that isn't packaged in when we package the project now it ends up being 222 megabytes large only 3 megab smaller than our last build this is because most of these settings are active by default now and our project didn't have any useless Maps packed in to begin with but again if you have an ongoing project the impact of this might be much bigger the next setting can save you around 10 megabytes but it will also drastically change the way your game is being rendered in Unreal Engine we can choose between the thir rendering and forward rendering with the thir rendering being active by default forward rendering will disable a lot of cutting edge features such as Lumen and nanite so you should only switch to that rendering mode if you really know what you're doing forward rendering is generally used for 2D games mobile games and VR games to boost performance in my 2D game for example this gave me a performance increase of 7% on my laptop and 33% on the steam deck in case you want to switch to forward rendering go to edit project settings and look for forward shading turn it on and restart the engine when packaging the game now it is 21 mgab large which is 11 MB smaller than the last build all of the methods I've shown you so far are more or less risk-free and I believe most projects could benefit from applying them to easily cut down about 100 megabytes of package size we can still shave off over 60 megabytes with the remaining methods I'm going to show you but things will get a bit more risky so before we get into that let's talk about if we really need to make the game any smaller of course it's nice to make the package as small as possible and optimize whenever we can but nowadays we have an abundance of storage space a available and even games that are many gab large can be downloaded in a matter of minutes many 2D games that were made with unity or other engines outside of unreal are now also 1 gab or much larger so just adding another 100 megabytes on top of that by using Unreal instead is not going to make anybody not buy your game also you need to keep in mind that most storefronts where you upload your games are going to compress them in some way so the amount of data your players will have to download will be about 30 to 40% smaller than the size on disc unless you pull a Call of Duty war zone you really don't have to wor worry all that much about package size in this day and age but there might be some of you with special use cases such as making small games for Game jams mobile games or so on and want to reduce the file size even more fun fact from 2019 to 2022 the Epic Mega Jam had a special category for the tiny award where they crown the best game below a certain file size in 2019 and 2020 the limit was below 100 megabytes and from 2021 onwards it was below 150 mbes but now I'll show you some methods to make your packages even smaller if you're following along with a real project make sure you have a copy of it or better at proper version control setup since things get much more risky from here on out from this point onward I'll switch over to using my minimal 2D game template for demonstration just so I can confirm that these builds are actually working and the packaged game is not broken I only have a few Blueprints and Sprites in here and with the same settings there's only a size difference of fractions of a megabyte so the package is still 21 megabytes and it's not going to influence our size measurement much and as you can see the game starts up and works correctly let's have another look at plugins and what we can try to turn off since this can possibly reduce the file size by another 50 megabytes there are multiple approaches we can take here and one of them would be to turn off all plugins by default and only turn on the ones we want to use this is a more advanced method but I'm going to show it you anyway in case you want to use it to locate the project folder we can open up the epic games launcher right click the project and show in folder here you can right click the U project file and open it up in any text editor you have you could then add the disabled engine plugins by default property and set it to through to disable all plugins but like I said before some plugins are vital for Unreal Engine to run so you then want to add all of the necessary plugins back to this array but it's very hard to know which plugins you actually need they might differ depending on the project and it's easy to miss something crucial so I'm actually not going to use this method and revert back but it's something you could look into more if this seems like a good solution to you the way that I prefer is to turn off plugins little by little and see if the game crashes or not for this again go to edit plugins click on settings and show only enabled I have no plans to do anything related to Android Apple or Linux so I can turn all of these off I'm not going to use chaos physics and can turn off all of that as well B3 is another one I have no plans of using after that I kind of just scroll through the list from the top and disable things that sound useless 10x editor is something I'm not going to use but actor layer utilities actor sequence and AI support all sound important even though I'm not exactly sure what they do a Lambic importer is not necessary and I just keep keep on going through the list and only get rid of things I'm pretty certain aren't needed and leave everything on that sounds like it could be important or I don't know what it does by the way oodle Network and oodle texture are actually plugins that help with compression so turning them off would make the game bigger after reaching the end of the list I restart the engine and now have about 84 plugins left packaging the game like this leads to a size of 198 mbes which is 13 MB smaller than the last build and the game still starts up and works just fine if your game already broke you might want to be a bit less aggressive when turning off plugins however I can now go back in and try to turn off a few more plugins to try to reduce the size even more the more you turn off the riskier it gets so you might not want to overdo it after turning off more plugins and restarting I have 27 plugins left and this is about how far I'm willing to go the packaged game is now 168 MBT large which is 30 megab smaller than the last build you could probably take this even further and go down to about 10 plugins but I'm not willing to take the risk so let's get into the next method we can create a config file to adjust the pack file rules and tell Unreal Engine specifically which files to not include in our package for this we again need to open the project folder and this time go into config right click here and create a new text file called default pack file rules.in double click to open it up to know what you have to write here please check the write up I attached in the video description and click on default pack file rules here you can see a written version of what I'm talking about right now and you can open up this drop down to see the recommended settings I found in a forum post by Neo future Labs you can then just copy paste them into the in file and make sure to save it these rules basically tell unreal to not include a lot of editor meshes unused fonts and so on and most of this should be fairly safe I'm not quite sure why but in my case I actually have to remove the asterisk after the folder pass for it to work so if it doesn't work on your system you might want to try that as well otherwise just leave it as it is when making a new build now it's 165 mbes and 3 megab smaller than the last one and the game still works just like with the plugins we can now take a few more risks with the pack file in my write up I explained in detail how you can split open a pack file to see for yourself what is in there and what you might want to exclude but for the sake of the video I prepared another two sets of pack file rules that are a bit riskier but make the package even smaller the riskier version gets rid of the default Bloom kernel which will disable Bloom and could cause issues with postprocessing it also gets rid of substrate materials and some unused fonts to free up a total of 17 MB the less risky version only gets rid of substrate materials and frees up a total of 10 MB this is the one I recommend if you have no plans to use substrate and don't want to take many risks I would not recommend the more risky version unless you really know what you're doing but for the sake of this video I'm going to use that one for now this leads to a package size of 153 mbes which is 12 Mb smaller than the last build and the game still works the last thing left is to simulate the compression a Marketplace like steam would apply to game to do this I can just select everything right click Send to compress zip folder this leaves us with a file size of 89.5 mbes of course the compression algorithm will differ depending on what platform you upload the game to but this is just roughly going to show us the effect of compression so in the end that leaves us with a size on dis of 153 mbes and a download size of roughly 89 megabytes which is a lot better than what we started with there is actually one more way to make the package size a lot smaller and that is using an older version of Unreal Engine Unreal Engine keeps on getting new features and this also makes the minimum file size grow simply going from 5.2 to 5.3 made my builds about 10% larger in 4.24 for example a build with default settings was 151 megabytes large compared to the 321 megabytes we have now but by going back to older versions you'll miss out on a lot of features and quality of life updates so I'd only recommend it for special purposes but again I don't think we need to worry about file size too much in this day and age and a lot of these methods are a bit risky so I would mostly recommend to just stick with the basic once introduced at the beginning of the video unless you have a very special use case huge thanks to new future labs and darkness effects for information on the packfile rules thanks to Rocky mullet for showing me this is even possible and big thanks to the Japanese unreal Community for doing a lot of research into this especially o alwe and Waka and as always a huge thanks to my patrons who enable me to do research like this and share [Music] it [Music]
Info
Channel: Cobra Code
Views: 61,163
Rating: undefined out of 5
Keywords: game development, unreal engine, gamedev, game dev, unreal engine 5, paper 2d, unreal engine paper 2d, unreal engine 5 paper 2d, unreal engine 2d game, unreal engine package size, unreal engine executable size, unreal engine 5 file size, unreal engine 5 game file size
Id: f9hMB_50B5o
Channel Id: undefined
Length: 14min 35sec (875 seconds)
Published: Wed Apr 10 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.