Monthly Archives: September 2011

Emotional Colour Map

This is the emotional colour map for Germination X. It’s a 22 by 8 sized image, with 8 colours for each OCC emotion (those we haven’t done yet are white).

From left to right, these represent: LOVE, HATE, HOPE, FEAR, SATISFACTION, RELIEF, FEARS_CONFIRMED, DISAPPOINTMENT, JOY, DISTRESS, HAPPY_FOR, PITY, RESENTMENT, GLOATING, PRIDE, SHAME, GRATIFICATION, REMORSE, ADMIRATION, REPROACH, GRATITUDE, ANGER.

It’s primarily based on a set of colours Lina has been working on. She found it useful to group the emotions into positive and negative sets. Something I think is significant is that these colours were made with the colours of the plants and the general feel of the game in mind. I think the problems I found with this exercise was a lack of context – perhaps thinking too abstractly about this is a bad idea.

It’s great to see this work being picked up by the Life project by Evan Raskobb at Space Studios – looking forward to seeing more of where they go with this.

BetaBlocker DS test tones

After a week of heavy development on Germination X, and with a fast approaching performance, it seemed the time to dive back into Gameboy DS homebrew and get the bits and pieces of assembler code I’d been playing with together into something I could build more sounds from.

After getting the low level stuff working properly, I got busy making a bunch of audio scenes that I can trigger from Betablocker DS code.


Sounds hosted by archive.org

Mostly I’m doing wavetable based things, with lots of frequency and ring modulation. I was also pleased to find this simple resonant filter thanks to the ever fabulous musicdsp archive (and thanks to Paul Kellett for originally posting it):

// set feedback amount given f and q between 0 and 1
fb = q + q/(1.0 - f);

// for each sample...
buf0 = buf0 + f * (in - buf0 + fb * (buf0 - buf1));
buf1 = buf1 + f * (buf0 - buf1);
out = buf1;

The next step was to read Jasper Vijn’s excellent explanation of fixed point maths which I’ve used a bit on the Android but not really totally understood before. Mobile devices tend to only have integer maths at the hardware level, so if we restrict the calculations to fixed point it’s much faster and kinder to batteries than the floating point equivalent. Here is the fixed point version of the filter:

// we are using .10 fixed point (10 bits for the fractional part)
#define FX_SHIFT 10

// convert an int into to it's fixed representation
inline s32 fx(s32 i) { return i<<FX_SHIFT; }

// multiply two fixed point numbers (returns fixed point)
inline s32 fxmul(s32 a, s32 b) { return (a*b)>>FX_SHIFT; }

// f is cutoff frequecy, q is resonance, s is the filter state
void lpf(s16* dst, s16* src, u32 length, s16 f, s16 q, s16 *s)
{
    u32 fb = q+fxmul(q,fx(1)-f);
    for (u32 i=0; i<length; ++i)
    {
        s[0]+=fxmul(f,src[i]-s[0]+fxmul(fb,s[0]-s[1]));
        s[1]+=fxmul(f,s[0]-s[1]);
        dst[i]=s[1];
    }
}

GX – messages, colours and continuous worlds

A big update for Germination X today.

The main new stuff includes:

The process of moving around the world is now more continuous, as the land is split into sub-tiles that are loaded 9 at a time. When you move out of the central tile the 3 at the back are discarded while the 3 at the front are loading. Spirits can also “see” into the tiles surrounding their current one, and so can navigate the entire world slowly, but independently.

Spirit emotional colours – both in their character design and in their messages. I’ll post more fully about this later.

The messaging system has been rewritten and now forms the major information source from the spirits. It’s probably a little too much right now, and some thought is needed on effective ways to communicate some of these things. All the spirit’s messages are triggered by actions driven by the FAtiMA agent. Here is an example of what happens when a “praise” action is received for an object:

(defn spirit-praise [spirit plant]
  (modify :log
          (fn [log]
            (log-add-msg
             log
             ; we can't exactly be sure why the fatima agent
             ; has triggered the praise action, but we can make
             ; an educated guess by looking at the plant
             
             ; if it's not the same type as the spirit
             (if (not (= (:name spirit)
                         (layer->spirit-name (:layer plant))))
               ; we're happy as it's providing a benefit to our plant
               (make-praise-msg 'spirit_helper_praise spirit plant)
               ; it's the same type
               (cond
                (= (:state plant) 'grow-a)
                ; we're happy because a new plant is growing
                (make-praise-msg 'spirit_growing_praise spirit plant)

                (= (:state plant) 'fruit-a)
                ; our plant is flowering (first phase of fruiting)
                (make-praise-msg 'spirit_flowering_praise spirit plant)
                
                (= (:state plant) 'fruit-c)
                ; our plant is fruiting (last phase)
                (make-praise-msg 'spirit_fruiting_praise spirit plant)

                ; i give up!
                :else (make-praise-msg 'spirit_general_praise spirit plant)))))
          spirit))

The Haxe client then reads the messages which consist of these codes and a host of other information (eg. the spirit’s current emotional state and the players involved) and builds the text for display.

New plant spirits and dandelions

A large part of the recent work on Germination X has been finalising the character design for the plant spirits. We need something which can exhibit some connection with the permaculture plant layer the spirit represents along with a way to express emotions with the restrictions of the browser platform. This is an image from Lina’s concept art – many more of which are online here.

After a few iterations we have some ready to use in the game, the colours will be driven by their emotions (more on that later on). These are the ground cover (mulching), tree and shrub layer spirits:

Along with this, all the artwork in the game has been updated, taking Lina’s latest versions and also increasing the resolution. I also had a chance to work on a new dandelion from Lina’s uncoloured version, here are all of the different variations, with growth, autumn and illness stages.

Isometric engineering

The first report from south western Sweden where I am on unofficial residency/hacking retreat in the environs of the Tjärnö Marine Research Laboratory.

This is a great place for my main task, to focus on Germination X, and I’m starting with new isometric ground tiles. I’m aiming for the feeling of roots and interconnectedness with just a whiff of geological process.

Germination X is about thinking by sketching, and this started with a couple of rough drawings playing with different pathways across squares. If the connection points are kept consistent they fit together to build cubes, and automatically, the cubes joined together too.

I also thought that varying the widths of the paths would be more interesting, and built a kind of template from the master Germination X cube.

If I kept to these guidelines the plan should work – but I wasn’t sure how it the end effect would actually look. Using the template (visible underneath the paper, still in analogue mode) I drew five different variations of these pathway cubes.

After a bit of fixing and colouring in the gimp, this is an example chunk of world rendered in the Germination X 2D engine. Although the lining up is still not perfect, I like the roughness. Any combination of cubes will fit, you can swap any one for any other without breaking the pattern. The only tricky bit is that the random number generator is seeded from the position of the cubes, so the same pattern is generated consistently for any part of the world without having to store anything.