Game Development Community

Different sizes on Windows and Mac build

by Andre Lind · in Torque Game Builder · 04/10/2007 (4:20 am) · 12 replies

I just want to check this with the rest of you...

When I'm build my game, I end up with widely different sizes of the executable.

My windows .exe file is around 2.2MB
My Mac executable (under Contents/MacOS) is 34MB!!

Is this a known "issue" for the Mac builds or have I done something really wrong?
I've just added an xml-parser to the otherwise standard 1.1.3 build...

#1
04/10/2007 (9:46 pm)
If you have access to the source, you can recompile the Mac version of TGB with the following settings:
"Strip Linked Product" checked & "Deployment Postprocessing" checked

While this certainly reduces the size of the executable, GarageGames itself has not endorsed this action; so there might be problems with doing this.
#2
04/11/2007 (12:51 am)
Additionally unless you disable unified, you have 2 different TGB within your app for which reason it will be at least twice the size normally.
#3
04/11/2007 (1:33 am)
Marc: Yes, that I can understand... But 34MB vs 2.2MB is a really big difference!

There can't be so much extra stuff in the Mac version, can it?
#4
04/11/2007 (3:30 am)
If you open the .app you can check out whats in. Its a folder.

The file most likely has everything in you have as DLL as extra part on the windows side you need to install.
#5
04/11/2007 (7:01 am)
Ok, but if I check the complete folder on my built windows-game it weighs in on 4,5 MB
So that's with all dlls n stuff!

And I checked the executable file under MacOS-folder in the .app
The complete app is 37 MB...

I wanted to do a game that was under 20MB in size, and I can... but only on Windows it seems :(
#6
04/11/2007 (5:02 pm)
FWIW, my executable is 4.5MB for PPC only and 9.7MB for the universal.

On the other hand, my debug PPC version is 25.5MB.
#7
04/12/2007 (11:21 pm)
I built a non-debug version of TGB 1.1.3 using Xcode (Build Target: "Torque Game Builder") and got a binary size of 32.5 MB (that's going into the TGB Package using "Show Contents"). The included frameworks and such bring the total to 36.2 MB.

Is there a debug flag hidden somewhere that one can tick? Does maybe changing the build target for TGB to 10.4+ and not 10.3+ change anything?

I checked and the Torque_Debug preprocessor isn't used in the non-debug version (as expected).

@Ken: how exactly are you building your programs? The sizes are tiny (comparatively). Are you doing something in Xcode?

I've only added one resource to my project: the console XML resource. I wouldn't expect that thing to blow up the size of the final binary, though.
#8
04/16/2007 (7:25 am)
Did some tests with the base 1.1.3 release:

Turning off "Generate Debug Symbols" dropped the size dramatically.

Changing the Optimization level to "Fastest, Smallest" actually made the binary very slightly larger.

The "Strip Linked Product" Don mentioned above is already checked, while activating "Deployment Postprocessing" dropped the size another 30%.

Turning on "Dead Code Stripping" dropped another 200K or so.

Changing the Mac OS X Deployment Target to 10.3 (or higher) had no effect.

Final executable sizes: 3.1MB (PPC) and 6.0MB (Universal Binary). For comparison, the original, out of the box UB executable was 32.9MB.

Zipping the Applications themselves to compare approximate download sizes: New 3MB, Old 8.5MB.

Perhaps GG needs to include a more striped down release version of the final application for those without the source code. I don't think any of these optimizations should cause any problems. Personally, since I do a fair amount of changes to the C++ code, I leave the debug symbols in until producing the final release code just in case I've done something to make TGB crash and I need to see more info in the debugger.
#9
04/16/2007 (4:53 pm)
@Ken: Awesome, thanks for the info! I have unchecked "Generate Debug Symbols" and checked "Deployment Postprocessing" in the non-debug Target ("Torque Game Builder"). I will rebuild and see how the changes affect the size.

UPDATE: The build process just finished. New base size for my .app is 10.4MB (Universal). Awesome! Thanks a lot Ken!
#10
04/16/2007 (8:58 pm)
@All: all you really needed to do was to check "Deployment Postprocessing" in the release target. This is off by default to aid in debugging during the development process.

See: tdn.garagegames.com/wiki/TGB/BuildingMacTGB

Share and Enjoy.
/Paul
#11
04/17/2007 (1:15 pm)
Some of prefer to do things the hard way :)

Thanks Paul. Excellent reference doc!
#12
04/17/2007 (5:31 pm)
@Paul: Awesome reference. I feel like that information should be included in the TGB Documentation that's shipped with it!

Any resource like that for Linux/Windows you could recommend? I did a quick search and didn't find anything...

Update: Just saw this. Sweet.