The Eyes! The Eyes!

At some point previously, I must have mentioned the EyeList. If not, just pretend I did. It’s a simple system: in the creatures Head object is a List of Eye objects. Every Eye object handles a number of things related to itself in much the same way that every Limb handles its own drawing and statistics: each Eye object contains an EyeType, and EyeTexture, a few Eye specific stats like size and location-on-head, and a routine to draw the Eye model in the right positions.

EyeList has served me well, but at a certain point I came to an important decision and took the ol’ fella out with me behind the shed. A few moments later, the loud sharp *BLAM* of a shotgun blast echoed around the farm. Immediately followed by a bunch of swearing and a second shotgun blast. Seriously, it was like 5cm away, how the hell did I miss?

Rest in Peace, EyeList.

Introducing its replacement, the FeatureList.

The theory is that FeatureList is a more generic and versatile system than EyeList, and that Features can do several things that Eyes could not. Contrary to logic, common sense, and indeed sanity, “being something other than eyes” is not one of those things: if I had wished I could have easily created Eye objects that were horns, ears, noses or shrunken voodoo heads: albeit horns, ears, noses or shrunken voodoo heads that either did nothing or inexplicably improved the creatures vision.

One thing that Features can do (well, okay: should be able to do, in the long run. This hasn’t been implemented yet…) is attach to body parts other than the head: primarily the torso and tail. Because the FeatureList is contained in the root Creature class rather than in the Head class inside the Neck class inside the Creature class (My Object Orientated Programming-fu was weak when I designed the Eyelist), I have a lot more freedom as to where I put them.

Another thing that Features do that Eyes didn’t is attach to procedurally generated locations on the head. The eyeList used a group of dummy objects (invisible objects that I manually put in in 3ds max), to specify the locations of the eyes. This worked, but it was slow and limiting to have to put these dummy objects on the model for every possible head model.

So now the program works out where to put the dummy objects by casting rays inwards towards the model and determining where they hit: I don’t even have to include them in the export anymore! This frees up time to spend on more important things, like modelling more head shapes.

An interesting side effect of this is that it allows me to orient the eyes so that, instead of pointing straight ahead, they look ‘out’ from the head surface. You can see the difference fairly easily if you compare early screenshots (or Development Video # 1) to later ones (or Development Video # 3): the eyes in later screenshots aren’t always pointing forwards.

This simple change drastically changes the visual style of the creatures. Where before they had ‘googly’ eyes and looked kind of cutesy, like cartoon characters, now they appear far more animalistic. And while I do kind of regret the loss of personality for many creatures, I’m of the opinion that this actually suits the game far better. This isn’t Spore or Viva Piñata, and cutesy isn’t the visual style I had in mind. Colourful and vibrant, sure: life is very colourful, after all! But not cutesy.

This change also opened up fascinating new possibility: orientation of eyes having an effect on the creatures eyesight, and thus survivability. Eyes pointed outwards will logically increase FOV, while eyes pointed forwards will improve Range.

Finally, and probably the most important thing that Features do, is change the appropriate stats for the creatures that own them, rather than being limited to vision. Horns will increase attack damage and scariness, plates will increase armour, eyes improve vision, voodoo heads will increase the power of arcane spells while sapping the power of divine spells, that sort of thing. This means that features are not just decoration: they’re functional and thus, like everything else in Species, influenced by natural selection.

Oh hey, it also means I can do away that that useless “TailTip” class and replace the Tail Tip with a feature attachment point. Please excuse me while I get the shotgun out again.

Qu

Umm... vampire mouse? Well, at least it's not sparkling...

*BLAM*

“Oh wow. The blood just goes everywhere, doesn’t it? That’s horrible.

… Hang on don’t you faint at the sight of-“ *thwump* “… yeah. Yeah, that’s what I thought.”

Advertisements

, , ,

  1. #1 by Shaggy on March 7, 2012 - 1:02 am

    Out of curiosity – are the creatures going to graphically change and/or get a more varied animation as time goes on, or have you mostly set on the current look?

    I guess it’d be too complicated to get skin, scales, and hair mechanics working for a one-guy operation, yeah?

  2. #2 by ququasar on March 7, 2012 - 7:28 am

    Actually, I plan to improve as many visual aspects as I can without hurting the performance of the game. Scales and skin would probably just be textures (it’s a bit hard to see because the colour drowns it out, but if you look closely at the creatures in the screenshots you can see a huge variety in body covering), but I’d need to look into a dedicated fur-shader for long fur.

    A bigger priority for visual improvement is animation. Movement adds a lot of life to the game, so I definitely need to add a few animations other than just the walking animation. Getting the creatures to procedurally glance around (like mobs do in Minecraft) will help a lot by providing a better illusion of thought, but it will also have an influence on how their perception needs to work, which is a pretty big job.

    I’m hoping to have a ‘wriggling’ movement animation for legless creatures set up by the time I release the alpha, but further visual improvement may have to wait for a bit after that…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: