How to safely exclude a level from the build?

Hi guys, I've started fiddling with the project recently and actually managed to add, remove levels and build the game.
I've got rid of level_01 and testlevel with no problems, built and played the game, no biggy.
When I removed level_00, I screwed up the registries of some prefabs and wasn't able to fix them.
Is there any way safe to exclude levels from the build without screwing the asset registries ?

EDIT: When I said "removed levels" I meant removed those scenes folders and commented their references on MainMenu.cs

Just curious, what size did you build end up as?

EDIT: I tried to exclude Level_01 from the build using its LevelInfo component and unticking "Include in build".

It seems like the level is still included in the build if done this way.

Thanks for the tip karstenv! Didn't noticed that tick.
Build ended up with 4Gb+.

Ok mate so I gave it a try and actually managed to exclude Level_01 from the build.

So, after unticking "Include in Build" you have to build the game from "Project Tools" tab first and then build the game for the desired platform.

Oh man thanks a lot ahah

Cool, Will try this later :-)

I just did a new build and ended on 700+ mb.

So you should remember to delete (or rename it) your old build folder first.

Then rebuild the assets in the project tool.
Then single build your own levels.
Then do a Build game.

This should give you a very reduced build folder size.

I automaticly thought that building the game would delete the old stuff but it makes sense that it doesn't as the old resources are just present in the folder.

Generally I immediately rename the new build folder, saved myself another headache trying to figure out why the levels were still there :P

Did you kept the main menu? my last build only included the menu scene and my own, ended up with 1.5Gb +-
I presume most of that is from the assets used in the menu scene, 2 characters, background, animations and sound.
Now you got me curious why the 700Mb :P

Yeah I have kept the menu scene for now but it is fairly big so I'll delete most of the content from it at some point.

Well my 700+ is actually 790 mb but still.
I only excluded Scene_01 and then added 2 small scenes of my own so...

1 Like

Nice work guys!
De-checking "include in build" on the level_info for each level, should exclude it from the builds.

AS for registries! These things are fun, lol... If you delete a pre-fab that is registered in on of the registries, before you un-register it. You are screwed.

Same goes for if you copy a prefab that is registered, before un-registering it, that pre-fab-copy will go ahead and try to slam it self into the registery and screw it up too!

It best when creating, to add all the stuff and not copy, then register it correctly as new. FPS 1.1 (prior registries were done differently)

So you will need to go into each pre-fab that is not going to be used, and de-register it, to cleanly delete it... Well, and be sure all references to those prefabs are no longer called... You can do that, by going directly to the registries and tracking down each item that is registered in each register and un-registering it before you delete it.

BE SURE YOU DON'T NEED IT, and are not referencing it anywhere, before you do this. Or its going to be a bad time... :smile:

The registry's are stored here : Bundled Resources\Shared**