Rethinking storm3d.dll

Jack Claw was in development between 2006-2008 and was released in the Humble Frozenbyte Bundle for the community to play and build upon.
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Rethinking storm3d.dll

Postby alt_turo » Thu May 26, 2011 12:52 pm

Currently when compiling on MSVC the game generates a separate storm3d.dll which contains renderer-specific parts and then various game/editor executables which use it.

On Linux/Mac/Mingw the editors are not supported and the game is a single monolithic binary with everything in it. This is because using a library has no obvious benefits and does have some drawbacks.

The drawbacks of using shared objects on Linux are:
1. The build system gets more complicated
2. 32-bit libraries must be built with -fPIC making them slightly slower than without it.
3. It makes LTO less efficient. Not a big concern yet but if we want to wring all possible performance out of the code it becomes significant.

The drawbacks on Windows are:
1. Same point about LTO as on Linux
2. On Windows objects allocated in a DLL must be released in the same DLL or Bad Things happen. This leads to some complexity since you have to keep track of this. Since this a not a concern on Linux (not sure about Mac but probably not there either) it's easy to accidentally write code that breaks horribly on Windows.
3. The library is not loaded at runtime so it's not really easy to switch between different renderers this way.

For the record Trine uses a monolithic binary on all platforms.

So I propose we move to monolithic binaries on all platforms. Mostly this requires changes to MSVC project files.

Questions? Comments? Flames?
Turo Lamminen
Alternative Games

Posts: 8
Joined: Wed Apr 20, 2011 6:16 am

Re: Rethinking storm3d.dll

Postby dublindan » Sun Jun 05, 2011 10:15 pm

Sounds fine to me.

Not a big concern yet but if we want to wring all possible performance out of the code it becomes significant.

I've only taken a brief glance at the code so far, but it seems to me that if/when this becomes an issue,t here are other areas that could possibly be improved for performance, eg, allocating dynamic memory from memory pools. I don't know if it will ever get to the point where every last bit of performance matters, but there are certainly options available if it does.

Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: Rethinking storm3d.dll

Postby alt_turo » Mon Jun 06, 2011 12:04 pm

If there is a rough consensus that we should do this then the only thing we need is someone with MSVC to update the project files and test that everything works. Please mind the version you're using. The current project files are for MSVC 2005 and for the time being I'd like to keep that working.
Turo Lamminen
Alternative Games

Posts: 12
Joined: Sat Jun 18, 2011 8:32 pm

Re: Rethinking storm3d.dll

Postby AndySmile » Mon Jun 20, 2011 3:39 am

Hey @all,

well, maybe it's really an issue to think about it when we got to the point that we need some more performance. But library files
have a one big advantage for this current situation. On this way we can split that project in some view logical pieces like:
- engine
- physics
- scripts
- editor
- media
- DirectXRenderer
- OpenGLRenderer

just as an example. On this way it is more organized and it's possible to create groups for the separated parts (maybe not for every module ;)) For the editor developer it makes it easier to implement it to the specific os environment like cocoa on mac os x, because just the interface methods have to be set on the specific events (like clicking on a specific menu event or something), and all the core algorithms are stored in the editor module, that can be used for every platform without really big changes. On this way, new features can be implemented or altered and just compile it for every platform without any changes and it's done :).

Maybe I miss something, but for now, it makes sense, what do u think?

see ya
Andy =)

Return to “Jack Claw Feedback & Development”

Who is online

Users browsing this forum: No registered users and 1 guest