People ignore design when design ignores them

KoalaBr8 – ActionScript Development


Originally created by Mark Overmars and Jacob Habgood, Koalabr8 is a puzzle game in which you simultaneously navigate three koala’s around a variety of maps, avoiding hazards and solving problems. The game was originally designed in GameMaker and is available over at yoyogames.com, however as an assignment for my ‘Introduction to game development’ module we had to port the game into actionscrip 3.0. Due to WordPress’s reluctancy to allow  user to embed flash files into their blogs, I’ll have to make the swf. available for download. I’ll update this post with a download link and improved demo later on in development.

SpudRun Gameplay Video


Matrix Transformations in Excel


Matrices are used in computer graphics to help us transform points around in 2D & 3D space. Manipulating points in virtual space is a fundamental concept of computer graphics and thus computer games. Although many software packages allow users to over look the underlying maths by allowing visual manipulations, it is always important to understand what you are doing below the surface. The following transformations can all be done by the use of matrices; translation, rotation, scaling, shearing, reflection and perspective. Below are some examples of matrix manipulation using Microsoft excel.

Abstract 1.0

I was never meant to be an architect, but here is a hybrid between the Sydney Opera house and the taj mahal… or something like that.I have drawn it  from an orthographic front view, then used matrices to rotate it about the point (6,3) in an anticlockwise direction through an angle of 55 degrees. Then reflected the image across the line 3y=x+3.

Abstract 1.1

In this version I have drawn a standard cube in excel, then used matrices to rotate around the y-axis through an angle of 25 and then translate downwards by 2.5 units. The image is then projected onto the viewing plane z=0 and viewed from the point (0,0,3) giving an isometric representation of a 2D image.

x86 Assembler


I have recently been working on a data decryption program in x86 Assembler language. This being my first project involving assembler language has really taught me the value efficiency.

The original program took in a standard cstring and applied an encryption routine to it, I was then asked to write an assembler routine that would decrypt the new string and return it to its former self, only all lower-case.  I found the lessons learnt while messing around with the assembler code invaluable, as they lead to me learning some great optimisation techniques which could make all the difference when applied to a large complex program. The routine I was working on was not large enough to see massive gains in performance from the optimisation I was implementing, however knowing how to speed up code that may have to be called thousands of times a second is a vital skill to learn in game development. All though the code may be fairly elementary, I’ve found a real passion for this type of programming and would definitely like to develop my knowledge in this area.

void decrypt_chars (const int ARRAY_LENGTH, char EKey)
{  
	_asm{
		////////////// For Loop - Setup /////////////////////

		push	eax					;//Save Registers
		push	ecx					;//...
		mov		eax, 0				;//Initialise loop counter

		//////////// For Loop - Jump //////////////////////////

forloop:							;//Label
		cmp		eax, ARRAY_LENGTH	;
		jg		endLoop				;//(EAX > ARRAY_LENGTH)
		movsx	ecx, EChars[eax]	;//Get and store encrypted character

		//////////////// Setup Parameters/Stack ///////////////

		push   eax					;//Save regsiter values to the stack
		push   ecx					;//...
		movsx  eax, EKey			;//Store 'EKey' in EAX register


		///////// Modify Encryption Key /////////////////////

		and		eax,0x3C			;//Bitwise AND 'EKey' with '0x3C'
		ror		eax,1				;//Rotate right EAX, Halving 'EKey'
		ror		eax,1				;//Rotate right EAX, Halving 'EKey'
		add		eax,0x01			;//Increment 'EKey'
		mov		edx,eax				;//Store modified EKey in EDX register
		pop		eax					;//Restore character to be encrypted in EAX

		///////////// Apply Decryption  /////////////////////

		rol		al,1				;//Undo ror al,1
		xor		eax,edx				;//Undo xor eax,edx
		sub		eax,edx				;//Undo add eax,edx

		//////////////// To Lowercase //////////////////////

		cmp		al, 0x41			;//ASCII values 0x41 - 0x5A represent Captial Letters, Upper Bound
		jl		done				;//Not in range
		cmp		al, 0x5A			;//Lower Bound
		jge		done				;//Not in range
		add		al, 0x20			;//Lowercase equivalent is + 0x20 in ASCII table
done:								;//Label
		
		mov	   bl,al;				;//Store encrypted character in bl
		pop    eax					;//...

		/////////////// End For Loop  - Setdown //////////////

		movsx  cl, bl				;//Store decrypted character in CL
		mov    DChars[eax], cl		;//Move decrypted character into DChars[index] array
		add    eax, 1				;//Incremenet loop counter

		//////////// For Loop - Jump //////////////////////////

		cmp    eax, ARRAY_LENGTH	;
		jle    forloop				;//( EAX <= ARRAY_LENGTH )
endLoop:							;//Label

		///////////////// For Loop - Exit //////////////////////

		pop   ecx					;//Restore Registers
		pop   eax					;
	}
	return;
}

Unity Development


Having spent the year butchering games in c++ and ActionScript3, I am now experimenting with the Unity Game Engine. Unity allows scripting in three languages; C#,  JavaScript and boo. Having had experience of both C# and JavaScript, I intend to use a mix of both of these two languages, primarily using C# due to the diverse range of  plug ins and resources available. My development in Unity will be ongoing, but I aim to have completed a game by the fall of this year in Unity.

The initial engine comes with the resources to help build a game called Lerpz, which I completed earlier this month.

This is a 3d platform game that I have created using Unity’s inbuilt assets library.

The player can control the character using the usual WASD keys and use space bar to activate the jetpack. There are collectables and traps set around the world that you can interact with at your will.

I am currently reading ‘Game Development with Unity’ by Michelle Menard which is a very useful book that allows you to quickly access the information you require.

So far I have found Unity very intuitive, much more so than some of the previous development tools I have used in the past. It has great support for various files types and it’s easy to import/export between various programs with instantaneous updates.

I will be posting again when I have developed further games in Unity3D and look forward to creating my very own game over the summer.

 

Spud Run Alpha


SPUD RUN

‘Spud Run’ is a platform game I created on Game Maker 8, I unfortunately made all the artwork and assets myself; which explains the lack of eye candy. The player takes control of a convict potato who in order to successfully escape eternal doom, must journey across hostile and violent terrains. The games purpose was principally to test out a platform engine I was working on and the actual game content is pretty transparent.

Screenshot’s from my latest game in development.

Download the game here.


Video games influence on society


Festive Console App


A little C++ application that attempts to draw a Christmas tree to get you in to the festive spirit. Random colour generation and a random item on top… what more could you ask for? A decent program? yeah I guess so…

PS. I wasn’t allowed to use parameters so don’t shoot me for using global variables!


#include <iostream> //for cin >> and cout <<
#include <cassert> //for assert
#include <iomanip> //for endl
#include <windows.h> //for colour


using namespace std;

//declare constants: symbols used for the drawing

const char BLANK( ' ');
const char LEAF( '#');
const char WOOD( '|');
const char EOL( '\n');			//end of line symbol

//declare variables
int treeHeight; //height of the tree
int branchLine; //loop counter for each line of the foliage
int numSpaces(1);
int numLeaves(1);
int trunkSpaces(0);
bool reDraw(false);

int main()  //draw Xmas tree
{
	//Prototypes
	void getValidHeight();
	void drawBranches();
	void drawTrunk();
	void reDrawTree();
	void drawStar();

	cout << "Jonathan Collinge - Nov 2011" << EOL << EOL;
	do
	{
		numSpaces = 1;					//Reinitialize variables for repetition
		numLeaves = 1;
		trunkSpaces = 0;
		bool reDraw = false;


		getValidHeight();				//Promt user input

		cout << EOL;
		cout << EOL;

		drawStar();
		drawBranches();
		drawTrunk();

		cout << EOL;

		reDrawTree();					//Redraw the chistmas tree?
	}

	while(reDraw == true);				//Test for redraw

	cout << EOL;
	system( "PAUSE"); //hold the screen until a key is pressed

	return( 0);
}



void getValidHeight()				 //get valid height for the tree
{
	//assert( TO BE COMPLETED );

	cout << "Enter the size of the tree (4-20): ";
	cin >> (treeHeight);

	while (treeHeight < 4 || treeHeight > 20)		// Validate input
	{
		cout << "ERROR: Invalid height! Enter the size of the tree (4-20): ";
		cin >> (treeHeight);
	}
}


void drawBranches()					//draw foliage
{
	assert( treeHeight >= 4 && treeHeight <= 20);
	numSpaces = (treeHeight - 1);			// set numSpace dependant on user input
	void drawABranch();
	for ( branchLine = 1; branchLine <= (treeHeight - 2); ++branchLine)
		drawABranch();					//draw one line of foliage

}


void drawABranch() //draw one line of foliage
{
	srand((unsigned) time(NULL));		//Seed Random function
	for (int i(1); i <= numSpaces; i++)
	{
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0);		//Set text colour to black
		cout << BLANK;
	}
	for (int j(1); j <= numLeaves; j++)
	{
		int randomColour(( rand()%10)+6 );		//generate random colour
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), randomColour);		//Set text to random colour
		cout << LEAF;
	}
	cout << EOL;
	numLeaves = numLeaves+ 2;   //Set the number of leaves needed on the next branch to +2
	numSpaces--;				//Reduce number of blank spaces on next branch
}


void drawTrunk()  //draw trunk
{	
	assert( numSpaces == 1 );
	trunkSpaces = (treeHeight-1);		
	for (int k(1); k <= trunkSpaces; k++)
	{
		//prints the blank characters to format output
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0);		//set text colour to black
		cout << BLANK;
	}

	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 6);			//set text colour to brown
	cout << WOOD << EOL;		//output base (level1)

	for (int a(1); a<= trunkSpaces; a++)
	{
		//prints the blank characters to format output
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0);
		cout << BLANK;
	}

	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 6);
	cout << WOOD << EOL;		//output base (level2)

}

void drawStar()
{
	//draws a randomly selected character at the top of the tree
	int starSpaces = (treeHeight-1);			//initialize star location
	for (int x(1); x <= starSpaces; x++)		//add spaces to format output
	{
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0);
		cout << BLANK;
	}

	int randomColour( rand()%100 );				//set new random colour

	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), randomColour);			//set text colour to random colour

	int X = 1;
	int M = 2;
	int A = 3;
	int S = 4;
	//declare min and max constant for random boundaries
	const int MAX = 5;
	const int MIN = 1;
	//initialize z to a number between 1 and 5
	int z((rand()%(MAX-MIN))+MIN);

	char decor;
	//Test the outcome of the random function against 5 different cases
	switch (z)
	{
	case 1 : { decor = '*';}	break;
	case 2: { decor = '&';}		break;
	case 3: { decor = '@';}		break;
	case 4: { decor = 'O';}		break;
	default: { decor = '^';}	break;
	}
	//output result
	cout << decor << EOL;
}

void reDrawTree()
{
	//Allow user to draw multiple trees
	//set text colour to grey
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
	//declare local variable
	char response;

	cout << "\n\n Do you wish to draw another tree?  <Y/N>: ";
	cin >> response;
	//validate input
	while (response != 'n' && response != 'N' && response != 'y' && response != 'Y')
	{
		cout << "\nERROR: Invalid Input! Do you wish to draw another tree?  <Y/N>: ";
		cin >> response;
	}
	//select path
	if (response == 'Y' || response == 'y')
	{
		reDraw = true;
		system("cls");		//clear console
	}
	else 
	{
		reDraw = false;
	}

}

Auction House


I am currently working in part of a 4 man team to develop a solution for a hypothetical auction house. The specification requires computer systems to control the flow of data around the auction house but not to be so involved in other aspects of functionality. I have included a few UML use case diagrams that I have developed, which are by no means the final product just a high level abstract of the functionality required by the system. I will be updating the project once I have developed a dependency diagram, business process model and also  an entity relationship model. Feel free to criticise the models and suggestions are more than welcome!

If Facebook ate Office…


Microsoft Office; a user friendly professional environment for the creation, modification and publication of documents, presentations, databases and transcripts.

Facebook; a social network of online user profiles connecting photos, videos, posts, interests, events and jobs.

Say theoretically Facebook ate Microsoft Office…

Well already Facebook is beginning to implement document hosting along with the ability to embed files.

However if live streaming technology such as the content hosted on the sites ( justin.tv, ustream and twitch.tv) just to name a few, was manipulated to allow real time interaction between multiple users. To what benefit? well imagine an online meeting staged between a developer and their client. In most cases the developer uploads the content to a server, where the client then downloads or previews the content and then has to try and communicate their response either via the phone, private messaging, webcam etc etc… If both users could connect to a centralized server where they were both granted access to interact with the document while hosting an integrated web conference allowing access to audio visual communication, then the client could clearly explain their forever changing specification  allowing for a dynamic work process to be developed and cutting all the time wasted barking up the wrong tree. The system would create a more efficient working environment and relationship between both parties.

Post meeting, you can return to your companies virtual HQ with the document you  and your team spent all night polishing, covered with annotations and symbols from the client. You can quickly host it on a virtual white board for your team to digest and even add sticky notes interpreting the clients new criteria.

Obviously a hierarchical system for users within a team would have to be implemented to allow for the digital counterpart of the big boss sat in their oversized office starring admirably into the mirror.

This dynamic office environment allows for the ever growing indie developers out there to access a domain where all the files they need to transfer between themselves and the office are hosted.

Multi national users can now interact in the office environment; attend web conferences, download team documents, collaborate on documents with other team members, promote themselves professionally, access their social network (family & friends), promote jobs, recruit candidates, advertise products, publish their portfolio and much much more, and all this from one location.

All this being said… We all know that with Microsoft next release of Windows, they will have in fact eaten Facebook and implemented your public documents onto a sharing network, have live chat built in along with all the other function integrated on the OS, conveniently placed under their watchful eye… deeming this whole article pointless and social networks obsolete.

Linux anyone?