Original Post
In a follow-up to my last post, I''d like to get some ideas on the best way to implement a game engine with a very modular approach.
My idea is to use shared libraries as the modules. This is not a new or revolutionary idea by any means; it is used all the time in regular programs and it is used in games for things like graphics APIs.
For example, the game could define and abstract base class like "Enemy". The module writer would sub-class the enemy class creating a child class like "Soldier" which would implement the enemy class interface. Then, the module is compiled into a shared object (aka DLL) and loaded during runtime.
There are many technical hurdles to over come with this approach. For example, loading classes from shared objects at run time requires a little bit of tweaking (using a loading function or proxy class, etc). I know this works well on UNIX systems, but I don''t know if it is possible on Windows or Mac systems. Also, I don''t know if this would be fast enough.
Is this method used in any commercial games? What are some other advantages and disadvantages of this method? What other methods would you suggest when trying to implement a module system? Thanks for your help.