Friday 24 April 2015

New Game is on the horizon

Hey There,

So I haven't updated this blog in a while. In truth I have had many other blogs for each individual project I have been working on so its difficult to bring them all together in one blog post.

Saturday 8 December 2012

Shaders in C++

So after a while of not doing much I decided to tackle some shaders in C++, this is to say in GLSL (OpenGL's native Shading Language). The idea was to get some knowledge before going into my third year at university as I will have a module called Advanced Games Programming and in it we would be creating programs with the use of GLSL. So why not get a head start now?

I started off following Swiftless's Tutorials "http://www.swiftless.com/glsltuts.html" , Doing the standard Gouraud shading, then went on to change it into per pixel lighting also known as Phong. Demonstrated in the image below




You can see that Gouraud gives you a bit more of a blocky lighting compared to Phong, this is because Gouraud is done within the vertex shader which deals with the vertices, as the name suggest, and Phong is done within the fragment shader, fragments are possible pixels, so you can see why Phong is sometimes refered to "Per-Pixel lighting".


Adding materials was quite simple aswell, I had to declare a struct for it in the main of my program that took the ambient diffuse specular and shininess values. this allowed me to change the look of the model to a rough material to a very smooth shiny material





I later went on to explore adding textures to the model using shaders, this proved quite easy as all I had to do was declare a Uniform texture2D variable and call in the texture coordinates from the model through the vertex and fragment shaders and setting the texture to equal the incoming texture coordinates. Jobs an easy one.


I also attempted Bump mapping but that Didn't turn out so well.


I am writting this months on and I actually have done the Advanced Games Programming module and I will go on in later blogs to talk about that.


Monday 9 July 2012

Busy.....Doing nothing

So I haven't updated this in a while as I was busy ...doing nothing. To be perfectly honest I lost my self in an MMO again! Also I found that I could not be bothered as it was summer holidays I generally wanted to have fun but as they say "This should be fun for you, it is after all what you want to do for the rest of your life".


Over the course of the last month I have had many ideas for the project I am working on but not had the motivation to put them into practice. So after just sitting around today I decided "Why the hell not start my project"


So with my music blasting in my headphones I set to work, I say work, every time I program I remember why I love it so much, so before I knew it I had set up the basic framework for the project.



Cyan Block - Player
Green Blocks - Ledges
Red Block - Lava
Black/Red Bar - Rising lava level bar

So the codename for this project is project_climb, dumb I know but its a place-holder at the moment. This is being created for Android and is using the 2.2 SDK purely as it is the most widely used version of android used. Had I decided to opt for the use of 4.0+ I would be eliminating a wide variety of potential players. Also the design of this project does not require any of the advanced features that have been placed in the later versions of android, so yeah 2.2 is where I want to be.


Okay on to the  project, simple in design really, the idea is for the player to jump from ledge to ledge as efficiently as possible attempting to keep up the pace to outrun the lava, which is indicated by the bar at the side. If the player does not optimize his jump correctly it will slow him down in the long run, allowing the lava to catch up on him.


The ledges were made at the moment with simple array and randomiser implementations :-


1:      private Random randomX = new Random();  
2:       private Random randomY = new Random();  
3:       private int minX = 0;  
4:       private int maxX = 320;  
5:       private int minY = -200;  
6:       private int maxY = 480;  
7:       private int shuffleX = 0;  
8:       private int shuffleY = 0;  
9:    
10:         
11:       public foothold(){            
12:            for (int i = 0; i < NUMOFFOOTHOLDS; i++) {  
13:                 shuffleX = randomX.nextInt(maxX - minX + 1) + minX;  
14:                 shuffleY = randomY.nextInt(maxY - minY + 1) + minY;  
15:                 base[i] = new RectF(shuffleX, shuffleY, shuffleX + 20,  
16:                           shuffleY + 5);  
17:            }  
18:       }  


I am well aware that this method is far from a efficient design as the ledges are randomised on start-up it would be insane to expect anyone to complete the level or expect them to get to any of the ledges. This randomiser was put in for quickness sake as I had fifty ledges that I was not willing to hard code until I had the specifics of the players jump down, which will prove a necessity when placing the ledges. Currently working on a way to optimise the ledges with minimal hard coding.


I also had the idea to introduce gravity at the standard 9.81m/s^2 , nothing fancy at the moment. This will add an extra element to the project in that originally the player was to jump from ledge to ledge and never fall but now if I decide to add gravity there will be the danger of missing a ledge and falling to their death. Which in turn also means more advanced controls than originally proposed but still simple enough.


As stated before this is only the framework, what is seen in the image above are place-holders, so as it may not look the part at the moment, it will nearer completion. Trust me I am also the art guy on this project .


I'll continue update this blog with my progress on both my projects, I just hope my next entry isn't so far in the future.





Wednesday 20 June 2012

A Brief History

My first trip down the path of a games programmer came when I applied to study it at Reid Kerr College, which is in paisley. The first platform I worked with was XNA 3.1, in which I was given lectures and tutorials in which to advance my knowledge and my programming skills, unfortunately at the beginning I found it all overwhelming and it was a struggle to get to grips with it, but I got there.

The first game I made was titled "Invaders Must Die", Which unfortunately I have lost the source code for. There is a video of it in among a collection of other students work at this like :- 



Another game I had the pleasure of making was one called "Galactic Football" , It was created with Bryan Watson(http://bryanwatson.me). That game is also featured on the YouTube link above.

Going from college to university was a large jump, as the change from a development environment where the code is laid out for you in a template to one where you are literally working on a blank sheet, is very scary.Naturally we were "eased" into programming with C++, The first game I made with C++ was a console based maze game. This game was created in a partnership with Bryan Watson Again.

Later on in the first year of university, we were set a task to make a 2D game created with openGL. The game had to have some basic physics about it. Again I teamed up with Bryan for this, we chose to create a cannon game, in which you controlled the angle of the cannon and based on the angle and power of the shot, the cannonball would follow a certain parabolic trajectory in an attempt to hit a fleeing soldier.


As I advanced into second year, I was to create a game, any game but it had to have multiple levels, power ups, traps and enemies. It was also entered into a class competition in which it came second *sad face*. The game was called Stencil, it was created by Me, Scott Docherty and Barney Randall. The idea of this game is to jump on the platforms, destroy enemies, avoid traps and get the power ups. The games graphics were completely hand drawn by me.


And then came the second semester of second year and there were three separate projects on the go. One project was to create a rocket flight simulator with proper physics, safe to say that one did not go exactly as planned and as such I do not have any pictures or videos to showcase.

Another project I was involved in was on android and it was called Operation: Pure Defensive Warfare. This was a hugely ambitious task Bryan and I had set for our selves in that it was too grand for the time scale we had and along side two other projects was just insane to attempt to create this. We did however create a lesser version but we were unhappy with it. The sole copy is kept on my android smart phone and will not be released but who knows about the future.


Finally the latest game, It was created in C++ and is fully 3D, it is more of a tech demo showcasing my skills in created 3D programs. This again did not turn out as I hoped.


Currently I am working on two projects over this summer. One is for android devices and hopefully will be released on the android marketplace and the other is a 3D game using C++ and openGL. More on them later