Plug-in Architecture

Started by
12 comments, last by Drew_Benton 18 years, 8 months ago
I knew that my question is quite complicated. Thanks to all for exposing some light on that topic, I hope that the right decision ain't far away for me :)
I would rather stick with interfaces for now and avoid using messages. Thanks to all again for help, it's really appreciated.
Advertisement
As far as half-life goes, the game dll exports a certain set of functions that the engine requires exist, next it has macros that link entity names in the maps to the entities in the game dll by creating functions and exporting them. So, when the engine loads a map, it can find all the entities fairly easily. and it can control what classes are used to create certain objects (like the players, what game rules to use, etc) based on the config files and/or command line (it's a dethmatch game so load the deathmatch rules, the deathmatch rules spawn default players, etc). Essentially, it uses a hard coded interface while allowing extreme flexibility, so long as you play within the confines of the engines limits.
You may want to look up the Ogre3d documentation, which includes class designs etc. It's got pluggable parts of the engine as you described in the original post.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Here's some resources.
Using Interfaces with Dlls
Creating a Simple Dynamic-Link Library
Using Run-Time Dynamic Linking
Adding Plug-ins To Your Application

And 3 of my old threads that contain some helpful responses:
Using classes as plugins via dlls
Plugins - .DLL/.LIB question
Plugins 2.0 Updated

This topic is closed to new replies.

Advertisement