I have not read this entire thread (as I have been busy for a few weeks and it is quite long), but what would you all think about a more C++ oriented engine. For example, I've been working on one the past year in my spare time (for my purpose, but if anyone wants it...), it uses Ogre, OgreNewt, OIS, OpenAL, Raknet, Python, etc... These are my favorate's in their respective categories, and I honestly hate trying to abstract things like those, so I did not; I rather combined them to work together. My engine right now, the main cpp file consists of the main calling:
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCommandLine, INT )
#else
int main(int argc, char *argv[])
#endif
{
SET_TERM_HANDLER;
try
{
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
Engine::myClassPtr engine = Engine::InitEngine(strCommandLine);
#else
Engine::myClassPtr engine = Engine::InitEngine(argc, argv);
#endif
if(!engine)
OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND, "Engine could not be loaded.", __FUNCTION__);
engine->Run();
}
catch( Ogre::Exception& e )
{
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occurred: " <<
e.getFullDescription().c_str() << std::endl;
#endif
}
Engine::CleanupEngineGlobals();
return 0;
}
The engine first looks in a default.ini file (unless another is specified on the commandline) to do basic init. My file right now is:
[]
[DefaultGameEngine]
[Engine]
GameEngine=DefaultGameEngine
graphicOptionsFile=ogre.cfg
logFile=testering.log
mainName=Testing Game!
pluginsFile=Plugins.cfg
resourcePathsFile=resources.cfg
The [] is the empty section, nothing there, I should have it ignore it when it writes it out. DefaultGameEngine is an engine class that has been loaded, although it doesn't specify it's own config options yet (its the most basic there is). Engine is the base class, that things like DefaultGameEngine inherit from. The notable thing about this is the GameEngine variable, it actually references a class name, could be loaded from dll or wherever, need not be compiled in thanks to a registry/factory/memory_pool/other_things Class system I setup, it allows you to get information on, create new of, etc... of any class that inherits from Object, only requirement for those classes being that they add a single macro to their header. Everything is passed using a modified smart pointer. To specify that something is dead, just call Destroy() on it, it deallocates an internal smart pointer, shuts off all events and such, calls Destroyed(void) so you can reset other pointers you keep a hold of, keeping it allocated for anything that still points to it, eventually returning it to the pool when there are no more references. It currently has replication/scoping/etc... set up with thanks to raknet. Depending on the class flags you pass into the required macro that is put into a class header, sets if it is replicatable, has a script interface (python), can be deleted, etc... etc...
The action/event system is one of the first things I created for it. It uses 'pipes', and things can register any function (member/static/anything) to it, as well as register new events. You add events by stringname, can create links between events (so one calls another). I have a set of base things linked to all input keys, mouse moves, joystick, etc... In this way OIS is abstracted, the only abstracted part in the system. Since an input action causes a base event to be called (things like "KEY_A" and such), any events linked to it will also be called, things like when "KEY_W" is called, it could call linked events like "walk" or whatnot. Classes can also register new events and trigger them, and other things can listen for those events. Any node in the thing can be called by any number of others, and can trigger any number of others. I am currently setting them up so they can also broadcast across a network as well.
There are quite a few other things I've stuck in as well, but need sleep. Is what you are creating like this in any way? In the very least I can try to contribute code when I have spare time.