What I Have Been Working On -- Engine Layout
If you've been reading my post, you'll likely know that I've been upgrading my game engine to be able to work on both Direct X 9 and Direct X 11 with hopes of future multi-platform capabilities in the future. I've also stopped using the DXUT GUI and built my own system from the ground up with the exception of fonts which uses the bitmap font generation tool from Angel Code. As I've been upgrading my code, I've also been adjusting the basic code architecture a bit. Here is my current road map.
Now let me explain this a bit. This IS NOT
UML, and the boxes are not classes. They represent static libraries and namespaces. Libraries higher on the chart can see and uses libraries connected to them and lower levels. So DSquaredGame can access classes in DSquaredCore, but DSquaredCore doesn't know DSquaredGame exists. Now not everything in a higher level library knows about everything in the lower level ones. Remember, this doesn't connect classes. So the lines stand for "can be seen by". So this show library dependencies more than anything else. It's helpful as it has been forcing a lot of structure on the code. Everything is still a work in progress, and with new versions of the engine,
If you're wondering about the naming convention, the original name for the engine was D'Squared. I changed it because quite a few others were already using it. I didn't want to change the code too much so I just kept the name for all strictly internal code. Squared'D is for all outwardly facing code. After that, I decided to make Squared'D make online game development identity.
Different libraries do different things. For example, DSUtilities is just a basic utility library. It's mostly just for math, but it also includes some string manipulation code and some other legacy code. Later I plan on cleaning it up, removing some of the code, and maybe reorganizing some of the code into other libraries. DSquaredGame's main job is to provide graphical support to the engine. DSquaredNet uses RakNet
add multi-player support.
SquaredDPublic is code that I hope to one day open source. Right now, it's basically just a GUI library and the code that supports it. The GUI on it's own doesn't have any rendering capabilities, but I have written default renderers for it. Earlier GUI screenshots use the default renderers, but the newer ones use an engine supplied one. Both are very similar as I coded both of them. SquaredDPublic needs some work done to it overall, and probably in November or December, I'll try to fix some of its problems. Basically, there's code in SquaredDPublic that doesn't fit and needs to be moved out of the namespace and library.
DSquaredCore has the basic functionality to make a game. I want to be able to make a server only implementation that doesn't require graphics so all the core non-graphical elements are here. DSquaredCore contains the basic game framework. The framework is very component based that uses "plugins"
to add functionality. I designed the engine so programs can be made with it and only include the libraries needed. The engine is not 100 percent composition based, but with every iteration, it so becomes more.
A full game wwill need everything, but a server only game would just need DSUtilities, DSquaredCore, and DSquaredLogic. Most tools need DSUtilities, DSquaredCore, DSquaredGame, and SquaredDPublic. I had to build a very simple subsriber-based event system for everything to work nicely. For example, the code to fire a projectile is in DSquaredLogic, but in a multiplayer game, this will need to be sync'd with the other players. To do this, when a projectile is fired, an event is raised, and any callbacks that have registered to receive the event will get it. This will allow the projectile sync code to be notified when a projectile is fired.
This isn't everything, just a guide. There are a lot of other things such as some middleware
libraries like RakNet
, Nvidia PhysX
, Rapid XML
, and AngelScript
(AngelScript support is still very early). Is this the way you should make a game engine? That's up to you. This isn't a guide. It's just "What I Have Been Working On."