Ogre dependencies... Can I cut down?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
cadence
Gnoblar
Posts: 12
Joined: Thu Apr 28, 2005 7:32 am

Ogre dependencies... Can I cut down?

Post by cadence »

I running ogre under mingw using codeblocks. Is there a way to cut down on the runtime .dll's it uses?

I know Irrlicht uses one, and most games use maybe 2 or 3. Currently I'm using maybe 20 mb of runtime libraries for ogre.

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Ogre has:
- DevIL (and image libs). If you want to provide your own means of loading images, you can change a configuration option in OgreConfiguration.h to stop the dependency on DevIL and any image libs. You need to register a ImageCodec for your own format though. If you provide all textures in DDS format and only use D3D you can even live without any image library at all (I assume, this is untested)

- Freetype2, for fonts. if you don't want font rendering, which I think is kind of non-practical, you can strip this.

- zziplib. For zip file access. If you store all resource files in your file system, or register your own Archive type you can do without this.

- CEGU and XercesI; this one isn't even a dependency of the Ogre core, it's only needed for one of the samples, and if you need a full fledged GUI in your game.

- Cg; needed for Cg language shaders. Just for convience because Cg can compile to both D3D and GL. Living without Cg is no problem if you use no shaders or want to use any of GLSL, HLSL, or the assembly languages (those are integrated into the driver)

There is not one *required* dependency here. (although you really want freetype2 in most cases :-)

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: Ogre dependencies... Can I cut down?

Post by sinbad »

cadence wrote:I know Irrlicht uses one, and most games use maybe 2 or 3.
Clearly you've never looked in the 'System' folder of any of the Unreal engines. UT2004 uses no less than 29 DLLs.

A minimal release-mode DLL setup of OGRE weighs in at about 5Mb. If you add all the optional plugins (which you don't need for an application since you're likely to be using just one or two of them), it comes to about 9Mb. You were probably counting debug mode.

User avatar
joshcryer
Gnome
Posts: 351
Joined: Wed Oct 13, 2004 8:22 am

Post by joshcryer »

GCC creates fairly larger .dll's than MSVC, it's just something you have to accept for a free (highly cross platform) compiler. Getting rid of the plugins only helps marginially. (Heh, any in any case, debug versions of the dll's weigh in at 20 megs EACH, so he's not compiling in debug mode.)

If you want size and optimization and you have a commerical project, you can develop on GCC (man, GCC 4.0 is blazingly fast at compiling these days, just wait for MinGW to adopt it!) until you are up to snuff, and buy a license for MSVC. Then again, the aformentioned GCC 4.0 is only set to improve (both in code size and speed) with the new changes (as far as I understand, it has yet to benefit from the tree-ssa architecture, look for much better improvements in the 4.x series). =)

cadence
Gnoblar
Posts: 12
Joined: Thu Apr 28, 2005 7:32 am

Post by cadence »

That answers it. Thanks. It was just odd because I had just finished messing with Irrlicht and Torque, and was happily surprised at the size of the files. Irrlicht needed one .dll, and Torque needed 2 I think. I thought that they would be quite large.

I'm new to compiling large apps, grabbing from several libraries etc., and was quite confounded how the things work. I still am to a degree.

So I can take some dll's out at the cost of losing some functionality depending on what I need. Fair enough. Thanks.

I guess I'll need to get a little more familiar with what I need and don't need. I'm not really sure which I do or don't. So far I've just followed the Tutorials on the Wiki. That's where I got my 20 or so mb.

And no I haven't looked at any of the unreal sys folders. That is alot.

Thanks again.

--Arvin

User avatar
IoN_PuLse
Goblin
Posts: 220
Joined: Mon May 31, 2004 5:54 am
Location: Canada
Contact:

Post by IoN_PuLse »

If you're worrying about deployment size I would check out 7-zip for compression, it's .7z format using LZMA or bZip2 is almost always much smaller than zip, even when making a self-extracter so it will work anywhere. NSIS, a free open source installer system also uses LZMA and does a great job with compression. I know that UPX can compress executables, but I remember something about it being able to compress DLLs as well, I would check that out.

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Yeah, you can hack a fair amount off the DLL size with UPX, but it's kind of pointless since it just has to be decompressed on loading - if you're deploying you'd normally have archived the DLLs up for distribution anyway which will give you just as good compression. Hard disks are super-cheap these days so it's better to have things uncompressed on disk for faster loading and just distribute compressed.

cadence
Gnoblar
Posts: 12
Joined: Thu Apr 28, 2005 7:32 am

Post by cadence »

Wow, you guys really go all out on the info. Thanks!

After researching my files it looks like it is probably mingw causing the large .dlls. I assume the demos were compiled with vc of sorts? The demo .dll's were about 6 mb in size, the devc++ dll's were 16mb, and my compiled ones using codeblocks and the windows source was 20+mb.

User avatar
joshcryer
Gnome
Posts: 351
Joined: Wed Oct 13, 2004 8:22 am

Post by joshcryer »

CEGUI (and Xerces which alone takes up 3 megs) take up about 5 megs, which isn't included with the Dev-C++ DevPak (but will be next time). TinyXML with CEGUI should shave that down quite a bit, but I dunno when that move is going to happen.

But... yeah. It's all MinGW/GCC's fault. =)

cadence
Gnoblar
Posts: 12
Joined: Thu Apr 28, 2005 7:32 am

Post by cadence »

That explains 5 mb difference. Thanks.

Post Reply