Hey there, we have a quite annoying problem regarding building in batchmode.
The situation is as follows: We have nightly builds that we run on our build server, with a build server license. Those builds run in batchmode, without an UI.
We are using static batching, which helps a lot with rendering performance. Unfortunately, building in batchmode somehow doubles our build size when compared to building with UI.
As an example:
Our windows build, with static batching enabled, is 3.26 GB when building with UI on the build server and 5.78 GB when building in batchmode on the build server. Both builds use the exact same player settings and both are using the same build script function. If we disable static batching, the difference is no longer as big between the two versions (the difference then is like 100 MB or so), so we guess it is a bug with building a project with static batching in batchmode.
I did some checks to see what exactly boats the build size so much, and I see a huge difference when looking into the built Game_Data folder. This is the folder where it puts sharedassets.assets, resources.assets and the level files. The level files are WAY bigger when building in batchmode. Random example: There’s a file called level25.resS from the batchmode build that is 334 MB. In the build with the UI open, the same file is only 17 MB.
I know that static batching puts the meshes of static assets in scenes together so they can be rendered in one batch, increasing build size but helping with performance. But in both builds, static batching is enabled and in both builds, static batching works. It’s just that the batchmode build packs way too much in those level files and it seems like a bug to me.
Has anyone encountered this before? Why does building in batchmode lead to such a different resulting build with otherwise the same settings?
Here’s the command we’re using to build for windows in batchmode:
&$unityPath -projectPath $repoPath -quit -force-driver-type-warp -batchmode -buildTarget Win64 -executeMethod $buildScript -logFile $logFile | Out-Null
Unity Version is 6000.0.31f1
Any help would be greatly appreciated!

