Sep 21 2010

2D Shadow Mapping Project

Hello Everyone,

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

http://crypticsea.blogspot.com/2009/05/hitlers-must-die.html

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:

http://forums.tigsource.com/index.php?topic=8803.0

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.

http://www.gamedev.net/reference/programming/features/2dsoftshadow/page4.asp

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

OgmoEditorLibrary.zip


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:

http://gametuto.com/in-game-c-map-editor-tutorial-with-indielib-engine-that-dosent-use-tiles-but-pieced-images-like-in-braid-or-aquaria-games/

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 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


http://www.gamedev.net/reference/programming/features/verletPhys/

http://www.gotoandplay.it/_articles/2005/08/advCharPhysics.php

http://www.aquinhasa.com/?p=56

http://www.gamasutra.com/view/feature/2904/advanced_character_physics.php

http://www.gamasutra.com/view/feature/3916/ragdoll_physics_on_the_ds.php

http://www.gamasutra.com/view/feature/4383/the_secrets_of_cloth_simulation_in_.php?page=2

http://www.gamedev.net/reference/programming/features/verlet/


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 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

Rebuilding Website With Twitter Connection

Rebuilding my website and adding a twitter post to it while I’m here.


Apr 8 2010

Welcome

Hello and welcome to my portfolio Website,

I decided the old website was quite impractical and very hard to update,  as someone from an IT background it makes no sense for me to use such an archaic approach to web-development, so I updated to a CMS.

I’m glad I did, but of course it means that I have to spend some time updating everything, and migrating it across to this new system.

Thanks -Anthony Littlewood