Sep 21 2010

2D Shadow Mapping Project

Hello Everyone,

after looking at the trailer for  Cryptic Sea’s : “Hitlers Must Die!”,

I noticed the absolutely fantastic 2d dynamic shadow mapping,  since this is a feature I would love to add to a project of my own at some point in the future, I set out working on it. My own implementation is unlikely to use the fantastic “blocky” artistic style used in “Hitlers Must Die”, so I decided to try to create basic soft shadows.

I intend to write a full article on this subject at a later date, when I am happy and have a full sample to show off.

I will also create a simple library and release it here for people to play with.

My implementation basically works by iterating over all of the points of every polygon in the scene, since the polygon is created with a set winding order, the direction of the edge is predictable. The shadow mapping its self is quite simple, the geometry is created by extruding the edges that face away from the light source. The facing direction can be computed by calculating the inner(dot) product between the edge normal and the position of the light source.

The length of the shadow is the next issue, after looking around for a while I found “Salt’s” fantastic article on TigSource:

He proposed that the projected point ” p’ ” is equal to the vector between the position of the light ” L” and the position of the edge point ” P ” + the position of the point P.

Once the shadow volume has been drawn, I am left with quite a convincing hard edge shadowed effect.

This is great, but real world shadows are not hard edged, and this is an issue I wanted to take care of, since I might wish to have a more realistic look to the game.

I managed to find a fantastic article by “Orangy Tang” on Gamedev.Net entitled  Dynamic 2d Soft shadows, his approach was to generate “wings” to represent the penumbra of the outer edges of the shadow.

I liked this system, but it seemed overinvolved for what I wanted, while “Orangy Tang’s” shadows are acurate mathematically, I felt that they didnt need to be, and the additional steps have a cost association.

My alternative, was very simple,  I added shader support to Haaf’s Game Engine (HGE), then drew the shadows seperately to a  render target, generating a shadow map.

I can then apply a pixel shader to the “shadow map”, and do a number of screen space special effects.In this instance I chose to use a very simple box blur filter, this essentailly “smudges” the shadow map, giving soft edges.

This isnt mathematically accurate but it is simple and robust, and it generates fantastic looking results. Another advantage is that the degree of the blur and the alpha blend are both very simple variables,  making it possible to create a range of effects, to suit the artistis direction of the game being made.

Thanks for reading -Anthony Littlewood

Aug 29 2010

Ogmo Editor Loading Library Released

During Ludum Dare, I created two library’s onee for loading files from the No-Tiles Editor, and one for loading frm what I feel is the best tile based 2d map editor available: Ogmo.

I feel Ogmo is very intuitive to work with, and very extensible, for this reason I decided that If I wanted to do a tile based 2d game it would probably be the best editor I could choose, so I created a library for loading its files into any application, feel free to use this library as you wish, the included main.cpp has an example application that simply dumps all of the information in a map out to the console.

Feel free to use however you wish,

I hope you enjoy using it as much as I enjoyed making it.

Thanks -Anthony Littlewood

Aug 22 2010

No Tile Editor Import Library

It was Ludum Dare Weekend again this weekend. Unfortunately,  I have some very persistent friends and was unable to participate, after making a good start in the first few hours, an old friend basically commandeered the rest of my time.

so instead I decided I should spend one day, developing a library that would be useful for next time, then release it so everyone can benefit from it.

Some Time ago, A man called Javier Lopez Lopez, created a fantastic Tutorial on creating a No-tile 2d level editor a lot like the ones used in Braid and Aquaria:

He used IndieLib. I have read through the tutorial plenty of times, but have found his version offers everything I needed, plus  a lot more, and have never been able to justify any improvements, I also felt that IndieLib was not the library I wished to use for my game, and creating an interface across multiple libraries could become problematic.

Since its such a good editor, I decided to use it for LD, and figured that the key issue I should resolve first is the creation of  a file parser for the xml format exported by No-Tile’s.

I did so and have now decided to release it to the community so everyone can make games using Javier’s fantastic tool, as a map editor.

The Lib works based on a derived callback method, this sounds a lot more complex than it truly is, and the whole library is deliberately fast and easy to implement and use, I managed to get the whole pipeline including tinting, rotation and collision detection working with HGE in under an hour.

Again all credit for the editor goes to Javier Lopez.

I hope you enjoy using this library as much I as I enjoyed building it.

Thanks -Anthony

No Tile Editor Import Library Download

Aug 16 2010

Verlet Petri – Dish

Verlet Petri Dish:

The Petri Dish is a sample implementation I developed whilst studying Verlet integration.

The Very Simple Underlying Equation for Verlet is:

X’ = x  + x – previous_x;

Y’ = y  + y – previous_y;

What it means is that this doesn’t need the time delta that Euler does. This makes it incredibly stable.

I built a framework of components around it, including controllers and simple constraints, and added them to the HGE rendering engine.

The Sample Contains 8 Differant scenes all demonstrating various features and merits of the implementation.

1: Ballon On a String

2: Klackers

3: Balloons

4: RagDoll Man

5: Verlet Cloth

6:  Newtons Cradle

7: Verlet String Test

8: Tentacle Arm

I am currently tidying the code up so that it can be used in future projects, and will post it here as soon as I am happy with it.

Until then, please feel free to download and try out the Petri -Dish and see if it inspires you to create anything.

I hope you enjoy playing with it as much as I enjoyed building it

Anthony Littlewood’s Verlet Petri Dish

Thanks -Anthony.

Aug 13 2010

Newest Project – The Verlet Petri Dish

Anyone who knows me knows that I spend a lot of my time doing research.

My office is literally full of books.

After reading countless articles on “Verlet Integration”, and writing my article “Maths Behind Movement”

I decided it was time to write my own verlet system, I have been conceptualising it in my head for a while now, and have been working on it over this week, I have received some very impressive results for my effort.

The verlet integration method is documented all over the place, and I even cover it slightly in my own article, so I will not re-iterate that hear, as I feel many articles already available discuss it far better than i would.

And for anyone who is interested in implementing their own system I have included a number  of good links I used for research at the bottom of the page, and will eventually release my source code for referance aswell.

The main underlying advantage Verlet  has over Euler,  is stability.

The stability in Verlet means that points can be simply repositioned, where this would break the simulation in an Euler model,  this means that simple tensors and springs are very easy to implement, and other mathmatical laws can be implemented into the model trivially, it also has implecations for collision detection and responce.

My system differs from others in that it also includes support for node controllers, these mean that certain nodes can exibit behavior, and basic Ai or simple predefined animation, this can be used allongside the physics system in order to create ragdolls that will have behavior for example.  I am currently adding this into my new samples, and hope to have some impressive demo material for the finished application.

The scene loading is working very well, as is the core implementation.

I am mainly working on refactoring and polishing at the moment.

I am  hoping for between 8 and 10 scenes in one demo, and have received great feedback from the people who have seen the current scenes.

Thank you to the people who have taken the time to test the application and give me feedback.

I have put some simple screenshots on for you to look at.

Thanks -Ant

Verlet String Scene

Low Resolution Verlet Cloth Implementation

Jul 8 2010

Ants Archive Library – “AAL”

Some time ago I had a requirement for resource file/archive support in a game I was working on,

I considered a number of options including reading the raw data from an xml file, and also looking at existing archive librarys, but struggled to find anything that met my needs, so I built my own,

I decided to call it Ant’s Archive Library or “AAL” for short,

It is basically a wrapper around ZLIB, it means tthat the person using the library does not need to worry about any of the low level archive code and instead can simply include either the source code directly into their project, or build AAL as a library, they can then attatch packages to the system, and extract resources from it, using an abstract linked list datastructure.

  • allmost comically easy to integrate and use
  • a nice system for resource management
  • uses an optional callback system for error handling’
  • Very clear example code included

Download Ants Archive Library -AAL

May 16 2010

New Article Written Maths Behind Movement

I have written a new article: The Maths Behind Movement, if anyone finds any mistakes please let me know, I still need to update with source code links and some more pictures.

Maths Behind Movement

Apr 28 2010

Angry Stan And The Island Of Doom

Ludum Dare is an absolutely great idea, the starting theme for Angry Stan  was islands,  I was a bit stumped at first, but just dived in, and ended up with a game I am pretty happy with, “Angry Stan And The Island Of Doom”.

since I didn’t expect it to be particularly good given the deadline, I focused on making sure  I finished it, and making it funny.

its a really short game and a small download, but its pretty fun I felt it was of good enough quality to share with others, and as a celebration for reaching the 70 download’s marker, I have promoted it to it place in my portfolio:

Since I received so much great feedback, I decided to release the source code,  I hope it helps someone to learn, but remember that this is 48 hour code.

note: there is an issue where the terrain simply shows up as a shadow, this is due to a core problem in the allegro library and there is nothing I can do about it.

Angry Stan And The Island Of Doom Download Link

Angry Stan And The Island Of Doom Source Code Download Link

Apr 22 2010

Ludum Dare 17 This Weekend

Ludum Dare 17 is coming up this weekend, I cant wait,  last “LD” I had loads of work to do for uni but now I can finally participate,  I think ill have a go with allegro, haven’t really used it as much as SDL but I suppose it cant hurt. I  need to start preparing and desperately hoping that we get a good theme.

good luck everyone who’s taking part

Apr 14 2010

Matt, Games Design and Horror Design

My good friend Matt,  is a game designer/writer

and has recently started a blog, it goes into a good deal of detail about a recent project, of a narrative driven survival horror game,  it seems like a really nice idea and id recommend anyone who is interested in games or horror, should check his blog out

Matt’s Blog

Thanks -Ant

Apr 14 2010

New Portfolio Website Now Live,

New Portfolio Website Now Live,

I have been working for a few days now, and am finally happy for the new website to replace my old one,

Here’s to the future. And the future projects

Thanks -Anthony

Apr 8 2010

A Differant World – Game Mod

This was one of my earliest game development projects, it was a zombie horror mod built upon Max Payne 2.

After completing Max Payne 2 I found myself being fascinated by the structure of the game, primarily its focus on scripting, and found myself making a number of mods to the game, including various perspective modifications and weapon packs. Eventually, I wanted to take on a larger project with others.

And found a person who wanted to work on “A Different World” I joined and we recruited 2 other people and a webmaster, “A Different World” was born.

I had a great time working on this project handling the vast majority of the coding/scripting work, in doing so rebuilding the AI, creating a gore system,  getting melee weapons to work, and implementing some awesome gun and particle emitter changes.

Unfortunately we were never able to complete it and were only able to release an early development video that proved far more popular than I had ever expected, we didn’t have overly high expectations for the mod nor did we wish to break new ground with it, we simply wanted it to be enjoyable and re-playable. Based on this we succeeded but found ourselves up a dead end in terms of storyline and development direction and were eventually unable to continue.

Now that I look back on the project I realise how unimpressive most of it is, but as one of my first games projects my portfolio website would not be complete without it.

Link To Video

Apr 8 2010

Shadow Over Innsmouth – Games Demo

This project was though of after reading the story

“A Shadow Over Innsmouth” by H.P. Lovecraft.

I felt the ambiance of the story, the setting, the characters and the story its self,

would fit very well into a game.

I wanted to work in collaboration on a project again after “Warscathed” had gone so well, and met ‘Max’.

Max had a very strong grounding in 3d art, writing and in 3d level creation, this obviously made him a perfect teammate.

The original idea of the project was to create a “Virtual Innsmouth” where the player would be able to walk around the town and collect pieces of the story.

After working on some large sections of the world, we felt that an open world was too free to interpretation, to really follow what Lovecraft had envisioned, or be scary enough to keep the players interest to completion and instead we collaborated on a new storyline.

Max took care of the majority of the writing and level creation where I handled the engineering side of development, including tools and rendering.

We felt that we needed an environment that seemed large but claustrophobic at the same time, after thinking about this we came up with the idea of being trapped on a ship in the middle of the ocean, this also provided a very nice explanation for the “wet-look” that normal mapping tends to give.

We Created a large section of the ship that the player could walk around in, by prototyping in hammer then rebuilding and re-texturing before importing back into the game.

Apr 8 2010

FPS Demo Prototype – Warscathed Project

When I started development and design, I wasn’t really certain what we needed,

I worked with the team leader “Tyler Trevell”, and we determined what would be useful and what areas would need to potentially change.

The development proved challenging but rewarding,

and vastly improved my understanding of OpenGL, as well as forcing me to take a back seat with the development of the game, and refer ta  designer for guidance. I feel this led to a far greater result in the long run.

Also prototyped here is a “free-aim” system, that I developed to quite good effect, this improved immersion significantly and definitely improved the overall “feel” of the game.

The screenshot shows testing of the prototype “HUD”, of weapons and the city is an art asset.

For the “Warscathed” project we needed a prototype fps game we could use for testing gameplay possibilities.

Artists could also use it to test assets, with out needing to port to engine specific formats, and programmers/designers could use it to determine what engine features would be most useful.

The system was developed from scratch with OpenGL, I chose OpenGL as I was most confident with it at the time, I also wanted to leave the option of cross platform development open.

Apr 8 2010

Personal Project – Emergent Patterns in Artificial Intellegence.

The system I developed made use of two key agents in a hierarchy, the lower agent or “primary” would use the system listed above to discover information about its surroundings, a higher agent or “secondary” could then use the data from the primary in order to make higher level decisions, using a planning system such as STRIPS, the obvious advantage of this is that a number of the agents could have there knowledge of an environment “pooled” into knowledge they could all act on.

The demonstration I developed was to have two rival species competing over resources in an open environment for supremacy, however the violent nature of the simulation wasn’t really suitable for Expo-tees and had to be revised.
My alternative demonstration was to place a number of agents in the world and present them with the opportunity to simply advance freely. Given the exact same core programming a number of agents will all behave differently, and fully autonomously. I found given enough time, the agents would exhibit some very unusual and otherwise hard to implement character traits.

Practical Project Report

Apr 8 2010

Anarcarny -Team Deadweight

For one of my final year university Modules, we formed a group and produced a game during the space of the year, it was a 3d side scrolling Platformer, I built the engine and did the game programming and integration and graphics programming.

The Screenshot shows the main characters of the game in front of the “menu-level” they are rendered using the cell shader I developed. A bloom shader is used give the billboards on the front of the stalls the “glowing look” and the stones on the floor are rendered with a normal mapping shader to give the appearance of high resolution depth.

We had a number of technical and time related issues which meant that the project could not be totally completed. But we made very good progress given the short time span we had to work in.

The Screenshot above was taken at an epic moment of development, the moment when the fabled “stilt-walkers” took their first steps, actually designing and building these characters took an unbelievable amount of effort from Chris, the two of us spent about a week just trying to get a working version of the character into the game, after various issues, and it took a lot of engineering work to get them to work as well due to the difference in animation techniques and physics necessary, also the AI for them was a pain to write, since the stilt-walkers have a very over-elaborate method of turning that is simply genius (nice one again there Chris) . eventually after all of this work, I spawned in a number of stilt-walkers, and they all turned and ran away into the distance, in all their perfectly animated and programmed glory.

The game features 2 levels, menu’s music/sound and physics.

All of the menu’s in the game are basically game levels, for the in-game settings etc, the player walks to the correct stand and is presented with the appropriate options.

In the two screenshots below you can see the main menu with its glowing “Settings” sign and on the editor with the smooth shaded protagonist in front of the stall.

Game Development Group Report : Download Link

Apr 8 2010

Little Red Riding Hood -Interactive StoryBook

As a way of practicing my lua skills I produced ‘Little-Red’ this project is intended to be an entertaining, production aimed at children.

Little-Red is intended as a run-time storybook, for young children, made using the LOVE games engine, and written entirely in Lua, Little-Red is a simple re-intepretation and re-write of the old fairy tale. It is intended to have a simplistic parallax layer, based “shadow-puppet-theatre” style.

Apr 8 2010

The Cell

Using Ogre3d as a  rendering engine, and newton for physics Cell is a short Horror game set in a network of chambers known as “The Cell”

I decided to create The Cell after playing the game Penumbra by Frictional Games Link.

I wanted to attempt something similar, The Cell doesn’t feature gameplay as such, it is graphical demo.

The player can explore the set of chambers and find a way out, while I do have a story for “The-Cell” applying a storyline to it railroads the player and stops them from being able to freely explore.

My intention is to create a second version of The Cell that is purely story driven, and maintain this version as a research platform.

In order to make The Cell I had to develop a new framework to incorporate gui, state’s, menu systems event management shaders and scripting.

The Cell went through a number of revisions, originally starting out on paper as a first person shooter, while I got all of this working, I found the game to be quite generic, I then rebuilt it as a 3rd person action adventure game, and much preferred it, I then removed the weapons from the game, instead favoring an exploration and adventure based approach to the game.