Categories

Archives

DZgameEngine Project Update

Created new repository DZgameEngine in GitHub: https://github.com/crcarrano/DZgameEngine.git.
I will start pushing to it the code I have already written.
The repository is public and contributors will be welcome, once a sufficient code base will be uploaded.
Stay tuned for updates.

Project DZgameEngine: The Directory Tree

The first thing to keep into account to decide how the directory tree needs to be structured is the kind of information that has to go in there. In this case, I will need to provide a container for source and header files for the engine, all written in C++. In addition to that, I need to provide another container for a test application that uses the engine. Without the test application it wouldn’t be possible to test and measure the capabilities of the game engine. And, finally, I also need to create one last container to host files that are needed for the compilation but that are not really part of the engine itself. Rather, they are files from other open source libraries that the game engine will reuse.

Here is a representation of the directory tree:

Screenshot

src and include are the containers for the source and header files of the game engine.

src_app and inc_app are the containers for the source and header files of the overall application.

src_mod and inc_mod are the containers for the source and header files of the external open source modules needed there in order to compile the whole application.

obj is the location where compiled object files are stored.

bin is the directory that contains the application binary, the one that is called to start the application. Inside bin there are two more directories: config, which stores the configuration files for the application, and assets, which stores the assets used by the application (backgrounds, sprites, sounds, music, and so forth).

Now that the base directory structure is defined, I will proceed on creating a local repository under git control, and then I will create the project itself on GitHub. At that time I will post here a link to the GitHub project repository and I will also point to this blog from GitHub itself. This way, people who would like to follow what I am doing can easily move from one site to the other.

Please feel free to drop me a comment or a suggestion on what you have seen so far.

Project DZgameEngine

I’m working since a while to perfect an idea of mine, just some work done in spare time, nonetheless the dream of my lifetime,  about a modular game engine that can be used for both 2D and 3D games.

The engine is completely object oriented, it is written in C++, and it is platform independent. To achieve this last goal, I’ve been using the SDL library v.2 and I plan to extend it to give full OpenGL support.

Games can be built by providing a list of objects that represent all the possible items used by the game: backgrounds, moveable physical objects, characters, tiles, and so forth.

Each object provides methods to update their status and position in the game, and to draw themselves on the screen. Drawing, in particular, can be achieved with different technologies, which can be plugged in the object classes by the mean of wrappers to the actual graphical interface. I start with providing wrappers for SDLv2 and, later on, OpenGL. More can come later, as the needs (and hopefully requests) arise.

The engine also supports a state machine, which states can represent specific scenarios of the game or game levels. Support will also be provided to play music and sounds, and to access external I/O resources, like keyboard, mouse, joystick, touch screen, and so forth.

All the game-specific objects and rules will be described in a XML configuration file, which is read by the engine during initialization. The engine itself should then be able to run the whole game. Here is how the modularity I mentioned at the beginning applies to this engine: the game developer only needs to take care of defining the various objects that are part of the game, the way they interact with other objects, and the rules of the game. Everything else will be taken care of by the engine.

In order to achieve the best performance, the game engine tries to avoid as much a possible the use of C++ libraries. Instead, the engine provides its own classes for data manipulation and other necessities, that are designed for speed and not for generalized usage. In fact, it is my opinion, supported by several performance measurements I took, that classes like, for example, the STL, pay the price of being too bloated and slow in order to remain highly generalized and usable.

I’m doing the main development under Linux, but given the cross platform portability of SDL and OpenGL, it should be possible to reuse the engine code, as is, on other platforms like Windows, OSX, and Android.

The whole engine will be developed under the GPL-2.0 license and will be publicly hosted on GitHub.

I will welcome any developer that may be interested in contributing to this project by refining its details and expanding its capabilities.

Most welcome is also any comment or suggestion anyone would like to provide.