Littlest Goddess (CSL-I)
published on: July 6, 2009
Littlest goddess [1] was a game I made with Jeiel Aranal [2] for the Pyweek game development competition [3].
It was built from the ground up using the Python programming language and Opengl. The game engine was built around the Open Dynamics Engine and the level editor was built using inkscape and its ability to output svg.
Graphics Engine
The sketch shader uses these three images encoded in one RGB image
The Opengl engine take's advantage of GLSL fragment shaders in a fairly advanced technique to provide a visual look similar to a sketch drawing. There are three different directions of pen stroke stored in an RBGA image. These pen stroke's are then applied to the final rendered image in a screenspace post processing glsl shader. Internally the shader uses the following code to apply this pen stroke effect.:
vec3 saturatedScene = clamp((val - 0.1) * 1.5, 0.0, 1.0);
vec3 negativeSketch = val * (1 - sketchcolor);
float sketchResult = (negativeSketch.r + negativeSketch.g + negativeSketch.b) * 0.33333;
sketchResult = clamp(0.5 + sketchResult, 0.0, 1.0);
val = vec4(saturatedScene * vec3(sketchResult), 1.0);
The glsl shader applies a different brush stroke to each RGB channel in the rendered image, doing this allows for the different colours in the image to appear as if they were shaded with different strokes. This improve's the effect dramatically as the human eye can no longer interpret the brush strokes as noise, but rather individual details.
There is also a 'bloom' shader at work, Bloom shaders are helpful for the human eye as computer monitors are not powerful enough to display bright colours are bright, rather they just look 'white'. Bloom shaders blur the bright colours which helps the human eye recognise that certain parts of the image are brighter than the others.
The engine mostly uses the fixed functionality pipeline.
World Engine
The world engine for this game is mostly powered by the Open Dynamics Engine, A Free Software physics engine. I made this choice early in development as it provided a quick collision detection algorithm and I was not sure at that point how many physically stimulated object's we would need.
The physical simulation came into play in a few parts of the game design but it was mostly just used for collision detection.
Level Editor
The level's are built using inkscape [4]
The level editor was built using a customised Inkscape setup, the level is built inside inkscape and looks like how it does in the game engine. The level is then saved as an XML file which the world engine takes as a specification in order to build the level.
- [1]http://www.pyweek.org/e/CS-L/
- [2]http://zerobyte.deviantart.com
- [3]http://www.pyweek.org
- [4]http://inkscape.org
Article Tags python, pyweek, opengl, csl, games, code, glsl
Leave a reply: