SyntaxHighlighter

Wednesday 30 June 2010

A note on organisation


Just wanted to mention something I came across last night. I originally had my Utility functions inside a class called AEUtilty.

All of the functions (random number generators etc) were static functions so that I didn't have to have an instance of AEUtility.

Then I came onto creating some simple Timers, which are a class, and I hit a problem. I wanted to group utility functionality together, but obviously nesting the class within the AEUtility class wouldn't be much use.

So I decided to change AEUtility to a namespace, and add a class of AEUtilFunctions to hold the static functions. However intellisense went bonkers, insisting that AEUtility was still a type. So I had to ignore the intellisense and rebuild the library anyway to convince it to behave.

As I'll no doubt be doing plenty of refactoring into namespaces as I go along, I'll have to keep an eye out for this one in the future, as it cost me a good half hour of trying to figure out the problem.

Lesson learnt: just because intellisense says there's an error, doesn't mean the compiler will agree!

Monday 28 June 2010

Introducing the Alta Engine!


Welcome to my development blog for the Alta Engine.

I'm going to quickly go over what the Alta Engine is (or rather will be), the reasons for it's creation, and a quick outline of it's features.

I'm aiming to update this blog fortnightly, but that will vary depending on how much time I get to spend on this project vs my other gaming projects.

So let's begin.

The Alta Engine is to be a fully featured game engine based on the XNA framework. It will run on both the PC and the Xbox 360 (via XBLIG) and will handle both 2D and 3D games.  I'll talk more about the proposed features later.

Why am I building a game engine? Well the obvious answer is that I want to! But its more than that. Together with a friend of mine (who is very into game design) I am part of a new start up Indie games studio. As we haven't officially launched the studio I won't give any more details here just yet.

Anyway, we were looking around at the game engines available at the moment, and focus fell on Unity and UDK.

Now, we fell over ourselves in amazement at UDK, with how easy it was to use and how incredibly beautiful the results were. We pretty much decided that it was for us and were ready to commit to it. Then I started looking at UnrealScript.

Perhaps I've lead a sheltered coding life, but I've never come across a language/ api with a steeper learning curve than UScript. I will be persevering with it, but it's thrown a real spanner in the works, and there is a risk that it will undo a lot of the dev time savings from using UDK in the first place.

Then we found Unity. Now Unity is an unusual beast. On the one hand its criss platform, very well supported, established, and has a lot of good features. On the other, it has upfront costs associated with it ($1200), the graphics aren't amazing, and its missing some very important features like occulsion culling. Now a lot of this is being addressed in the next update, but there is still the price tag to consider, and the lack of Xbox support (its a damn big market to ignore).

However there is a free version of Unity and its still pretty good if graphically hobbled. In fact we've come to the conclusion that it'll probably be our prototyping engine, and we may make some simple web games using it.

So we were left with no ideal solution, and so I proposed writing an engine based on XNA. Having used XNA before I know that it strikes a good balance between the low level control of directx and the accessibility of something like Unity. My CSharp is pretty good, and I've always been interested in game engine programming.

And so I've embarked on developing the Alta Engine.

And now for its proposed features.

As I said, the Engine will support both 2d and 3d games. For 2d it will feature the usual set of blending and shading techniques e.g. additive blending, parallax scrolling, a tile engine, 2d editor. The 3d features will include options of either forward or deferred rendering, built in occlusion culling, dynamic light and shadows, a full 3d editor, middleware physics, animation support, and many more. Other items on my list of features I want to implement are a 'scene animation' editor like unreal matinee and a visual scripting system like unreal kismet, but in the shorter terms I'll be including the facility for csharp scripting.

Now before anyone goes 'woah, you'll never do all of that' you may be right, but this isn't a short term project.

Ultimately the Alta Engine will be the core of our game studio. My intention is that everything will be abstracted from the xna framework, so that eventually I can port the engine to c++ and both directx and opengl.  The ultimate vision is for almost any game to be created without writing a single line of code. Ambitious, me, never! Deluded perhaps...

I will be developing the engine using 'game driven development' i.e.  I will make a series of games, and each one will develop the engine in some way.

To get me started I have a list of classic games to clone, so that I can start using the core engine in other games. I've already created classics such as pong and Breakout which have given me the core game state machine, and I'm currently cloneing Tetris which will give me the beginnings of the tile engine. I'm also starting work on the input library, which will abstract out input to a map created by the game, allowing the gameplay programmer to just check is the player has pressed 'jump' for example, rather than checking space bar, A key on gamepad etc. It will also allow easy user customised controls.

Okay, that's a massive entry to start, I promise future posts will be shorter.