JTA Designs
12 Oct 2010 Leave a Comment
I’ve decided to revamp this blog a little, since it has had little attention from me for the past year. A couple of weeks back I redesigned my web portfolio JTA Designs; please check it out.
Gravity Runner
12 Oct 2010 Leave a Comment
It’s weird to see that I haven’t posted for over a year! It’s late news (that I should’ve posted earlier), but during my latter days in the studio of We Are Colin I created Gravity Runner with my close friend Dave Leverton. Your typical runner – with the addition of being able to switch gravity across a number of death-defying levels.
It features 25 levels alongside 3 secret levels, in addition to a never-ending endless mode. It is available on the iPhone or iPod Touch only for 59p! If you would like to know more about this awesome game, check out the official website out here.
Cavemen VS Aliens
17 Oct 2009 Leave a Comment
I know that this blog has been due for a long post; but as you would imagine I have been very busy with many other things, including my new job which I started in June at a newly found independent game development team.
We Are Colin specialises in XBLA titles and IPhone titles. Currently I have been working on a new Real Time Strategy game; I have not always been a fan of RTS’ until recently, and creating this game has really helped me to love the genre even more. The RTS I have been programming on is Cavemen VS Aliens. Yes, the name of the game and the two opposing teams may seem like an odd combination, but when you view our media gallery we have distributed for your viewing pleasure I hope you will see its potential.
In a nutshell, this game is aimed at everyone; which means anyone should be able to master the game’s ‘pick up and play’ gameplay and dive into the game’s action straight away. Don’t worry; this doesn’t mean the game is entirely easier than your standard game. It just means that its easier to pick up and play but has a good learning curve to follow through the game’s duration. Instead of me trying to sell the game to to you, why not just view the following trailer and see what you think.
Thankyou for watching and reading and I will be adding more updates on the game’s progress up to its release on October 30th which isn’t far away at all.
W7: Walking over terrain
15 Mar 2009 Leave a Comment
I finally fixed the issue I was having with getting the camera walking over the terrain. I ‘think’ the error was that I wasn’t translating onto the x-z plane at the beginning of my GetHeight(float x, float x) function properly. I said ‘think’ because I redid all of my functions that got the height of the terrain. Sometimes its best to start over again instead of continuously trying to re-edit something that doesn’t work. It’s a relief finally getting this fixed, as I have wasted a lot of time trying to get this to work.
In addition I managed to add a zombie into my engine by doing this untidily within one class. I am now trying to implement this the proper way to ensure that it is easier to add other assets to the engine. However I am currently having problems constructing my WorldObject class (that manages all objects within the world; i.e. their position, orientation) and my ResourceManager class (checks to see if a mesh or texture has already been loaded, to stop it from being loaded again when these resources are used on multiple objects for example).
As you can see I have added a texture to my terrain. All that was required at the time for this to work was one simple line.
D3DXCreateTextureFromFile(gd3dDevice, “grass.jpg”, &mTexture);
Within my time of frustration trying to get the camera to walk over the terrain I cleaned up a lot of the code and removed unnecessary parts of my engine. This should make it easier for me to implement future additions.
W5: Floating Point Numbers
09 Mar 2009 Leave a Comment
There are different number types, such as natural numbers (positive numbers), integer (positive and negative), rational (1/2, 1/3, 1/4), irrational (sqrt(2), e, PI), real numbers and complex numbers.
In my code I constantly use floats, without considering how it works. This week was spent making our own floating point calculator to add, multiply, subtract and divide floating point numbers using the IEEE 754 Standard.
There are different ways of representing numbers the same way. For example…
93 x 10^ 6 is the same as
0.00093 x 10^10
This is a problem as one number can be expressed in different ways. Normalised form is a way of dealing with this problem for example 9.3 x 10^7 is the normalised form of the above examples. This can be evaluated into the following:
(sign) mantissa x base ^ exponent
In IEEE 754 the normalised form expressed earlier is incorrect, since this standard uses base 2. So…
9.3 x 10^7 = 1.386 x 2^26
The IEEE 754 standard is expressed in the following form:
(-1)S x (1 + F) x 2^(E – bias)
S = Sign; F = Fraction; E = Exponent
Single Precision (in this standard) is 32 bits and is expressed as:
0|10110101|11010101001010101011010
1 Sign | 8 Exponent | 23 Mantissa
Multiplication is the easiest arithmetic to do with floating point numbers. To do this you add the exponents and multiply the mantissas. Afterwards the result is rounded and normalised. Division is similar but is a lot more complicated.
Addition is quite tricky. If you have two different exponents you must first make them equal. Afterwards you then add the mantissas and multiply them by the same base^exponent. Subtraction is done identically, however you must subtract the mantissas instead of adding them.
W5: De Blob
09 Mar 2009 Leave a Comment
I successfully created user input with the camera. However, I have been having some troubles making the camera walk across the terrain. For some stange reason, my camera appears to go up invisible hills when moving around. I’m guessing that the camera’s position hasn’t been set to the terrain’s position, so when the camera is supposed to go up a certain part of the terrain (that is visible) it would; instead of going up terrain a mile away from the hill.
I have added statistics in the top left of the screen which was quite an easy task to do.
I created a state manager for my application, which makes it a lot easier to handle my application. Currently there are only two states; the loading state and terrain state. I have also made start on implementing a resource manager, which will make it easier to handle resources loaded into the application. Currently I have no resources in my engine.
Our lecturer has given us details on our assignment task. For my assignment I must recreate ‘De Blob’. This will be a very tedious task. Hopefully I can recreate De Blob to a good standard in the time I have left for this semester.
W3: New Framework
25 Feb 2009 Leave a Comment
This week I managed to implement a camera system; allow input with the mouse, keyboard and Xbox 360 controller and I managed to implement height-based lighting.
However, to begin with I had to put everything I had into a new framework. To be precise I placed my code within Frank Luna’s framework (from his Introduction to 3D Game Programming with DirectX 9.0 book). This framework was well structured since it made it easier to handle the device; for example when my program is running, if a user changes program, my program will still be running in the background. This becomes a lost device and once the user goes back to re-open the program the program must be reset.
To implement this I performed a SAFE_RELEASE() on all of the buffers I was declaring such as the vertices buffer and the index buffer. This stopped the program from crashing when the user tried to resize the window or changed the main application being used to another one.
The book helped me understand how to implement a camera for my terrain. However setting up a camera would be quite useless, without some form of input so this was tested using the mouse and keyboard first. I created my own class to handle input from the mouse and keyboard which was quite a tedious task. Then I assigned keys and mouse movements to the camera movement.
Afterwards I did the same for the xbox 360 Controller. It took me a while to get the control system I wanted within my engine and I think it still needs some tweaks to be perfect. The left control stick moves the camera left, right, forward and back; whilst the right thumbstick rotates the camera’s position. Deadzones had to be applied to the thumbsticks so that when the thumbstick was still, it wouldn’t apply any input into the engine.
I then attemped height based lighting. Which simply changes the intensity of the colour depending on the height of the vert on the terrain. Higher areas are lighter and lower areas are darker, which is not exactly an accurate way of lighting for terrain.
- This involved getting the heights (y value) of the verts.
- Comparing the heights to the max and min values; so changing the max and min values if the vertices height was higher or smaller than the current max and min values
- Finding the difference between the max and min height value
- Storing a colour for each vert by taking away the height of the vert by the min value and dividing this result by the difference in step 3
W2: Terrain
18 Feb 2009 Leave a Comment
For this week, I had to create terrain and implement different terrain types and lighting.
Firstly I rendered a large grid on screen and then created a list of vectors to store the y value of the terrains height map at different positions. I loaded a RAW file (which are typically used to store height maps) into the program and this was the result.
Afterwards I implemented Fault Formation. Fault Formation involves the following steps:
- Compute a random line to split the map into two sides
- Add a height value to the elements of one side and subtract this value to the elements on the other side
- Repeat this process with a set number of iterations
This is the end product…
Midpoint Displacement is another type of terrain generation. Here are the steps:
- Divide a grid into regions
- Change the height of each corner to a random amount
- Divide each region into smaller regions and change the height by a smaller random amount
- Repeat this process with a set number of iterations
Here is the end product:
I also added lighting to the terrain. This is hardware-based lighting and currently only has a white Directional Light.
This was achieved by converting the grid into a mesh. By doing this I was able to use the D3DXComputeNormals function, which computed the normals of the mesh for me.
W2: MIDlets
15 Feb 2009 Leave a Comment
I produced an insurance form which could be filled in by a user on the mobile phone as part of this week’s exercise.
When the user entered their details and pressed Save it would show the details they entered.
This was created using TextFields (textboxes), StringItems (labels), ChoiceGroups (checkboxes and radiobuttons), Commands and two different forms. The general setup involved creating a new form and then appending any textboxes, labels, etc… that I wanted to appear on that specific form; i.e. form.append(textbox);.
There are three specific functions within the application:
- startApp – what is done at the opening of the application whether starting the app or resuming after a pauseApp
- pauseApp – what to do when the application is interrupted (e.g. phone call)
- destroyApp – how to destroy the application safely
Those functions are used on MIDlet applications. This program is an application using MIDlet, which is a Java Application Framework for MIDPs (Mobile Information Device Profile) typically used on mobile devices.
W1: DirectX Vertices, Shading and Lighting
07 Feb 2009 Leave a Comment
This week has really been a starter into getting grips with DirectX. It amuses me how easy small tasks are to do; the same “small” tasks I found very tedious last semester within the Introduction to 3D Graphics module. It has taken me a little time to adjust to the way DirectX works; but I’m hopefully getting to grips with it.
This simply shows 3 triangles rotating in individual axis; x, y and z. The only problem I came across here was simply translating the triangles before rotating them; so they were rotating around the origin, rather than rotating around themselves.
We were told to set up a cube using vertices and not indices. It was a bit tedious as declaring the vertices of the cube in a wrong order would only make some triangles appear. To set the cube in wireframe mode I simply used this line of code.
g_pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME );
This just shows the simplicity of tasks such as these.
This is the same cube, but with shading and lighting enabled. White Directional Light is coming from the left of the cube and a red Point Light shines directly above the cube.
These are the different settings and customisations that can be made to a light in DirectX.













