Let’s talk a bit about our application before we create it. In order to make the development process sequential and least painful, we need to design the application well. The design of an application or the application architecture is the hardest thing to change on later stages of development. Thus it must be well-thought at the very beginning to prevent suffering in the future.
Well, there are number of application architecture’ levels:
The highest level defines which modules will the whole application consist of and what functionality will each of those modules have.
The next level is how the modules communicate to each other, how they work together.
The lower level is the structure of each module - what classes, entities, data structures and similar things will the module consist of.
One of the lowest, yet still very important architecture levels is how files are organized.
From the highest architecture layer point of view, I can advice a very simple architecture:
- a stable, rarely changed core
- a set of assets (models, textures, sounds - any content, made by artists and used to be presented to the player)
- a bunch of scripts, defining all the logic of a game (how character looks like, how the menus are shown and how they react to player’s actions)
The main benefits of such an approach are:
- scripts and assets may be changed at any time
- scripts and assets define what we show to the user and how the application behaves, so we can changes them without the need to re-compile the core
- we can modify the core (for example - optimize some features) without changing the application behaviour
We can make the core so flexible that we may re-use it in the future projects.
We will use Irrlicht engine because of its simplicity. And it satisfies all our needs - it does not need much content preparation; it provides GUI; extending it with IrrKlang will give us very simple interface to sound and music playback.
Newton Game Dynamics engine we will use to simulate physics. It is easy to use and is really powerful - you would be impressed!
The last, not the least, we will use Lua scripting language to write scripts. Lua is a lightweight programming language and perfectly suits that goal.
One of the most beautiful parts of this tutorial, will be the part on making of assets. We will use Blender 3D to create a couple of 3D models.
I also found CMake kind of user-friendly. It is not that handy as any of dependency managers for all
those languages, supporting them (
go get for Go,
RubyGems for Ruby,
for Clojure and many others). Yet it makes your project a little more portable, helps to handle your
dependencies, totally eliminates the need of all those How to configure VisualStudio for OGRE tutorials.
Just try it!
Remember all the three rules for our architecture. And keeping them in mind, let’s get to some coding already!