Cue the Dramatic Music

Here we go: statistics that affect a creature directly.

I’d very much like to preface this by saying I thought out the various Selection Pressures thoroughly and with much aplomb prior to implementing them. I’d like to, but I won’t, because that would be lying, and I’m fairly honest except to heroes who ask me where the doomsday device is hidden.

It’s not that I didn’t give this any thought: I did. But by the time I came to code it, I’d corrected so much in the way of redundancies and stats that were unintuitive, impossible to visualise or ridiculously trivial that the final result bore little resemblance to the original design.

I’m letting you know this to provide context for the mess of massy stats connected by weird, overlong algorithms that I’m about to attempt to describe. All of what I’m about to say is an oversimplification or a metaphor or possibly an unintentional lie, because even I barely understand some of this. I don’t intend to rework it entirely, but making it simpler and more intuitive while hanging onto the quirks that make it interesting while also eliminating nonsensical outcomes is an ongoing and unwieldy process, much like this sentence.

Stats can be broken down into three varieties: moment-to-moment, genetic, and derived/lifetime stats.

– Moment-to-moment stats are things like Energy and Health. Actually, come to think of it, I’m pretty sure Energy and Health are the only moment-to-moment stats, unless you count things like their position and current behaviour. Oh, and metabolism now too! But I’ve already gone into detail about those things.

– Genetic stats are self-explanatory: anything a creature passes on to it’s descendants. This consists of discreet values like headType and floating point values like shoulderWidth. But I’ve already blathered on about that too. So let’s move on to the variety of stat I want to talk about here:

– Derived stats. These are statistics that are affected by genetic variables, or that exist as a combination of them, but aren’t genetic in-and-of themselves. They are generally derived when the creature is born, so the calculations for them are only done once (to save CPU).

As an example, EnergyMax directly limits the amount of energy a creature can store at any moment: the creatures’ fat-stores, if you will. It is determined from StomachWidth multiplied by StomachHeight (among other things).

There are lots of derived variables: often they exist to combine genetic variables into a usable value. For example, BicepWidth can’t directly be used to determine anything, but it can act as a modifier on the AttackDamage derived variable, along with a whole variety of other things. Here’s a few of the most obvious variables:

Health Max – Determined from creature size and torso width, mainly. Chunky or wide body parts like thick limbs will increase this value.
Energy Max – Fat stores. Height is a larger factor than width for this variable, but otherwise the two maximums are often similar.
Attack Damage – One of the more complex variables in the list: the damage of each arm, leg and head is calculated separately, and added together to give the creature an ultimate damage per second value, with additional modifiers for things like horns and fangs and, of course, size.
Movement Speed – The type, number, size and thickness of legs and feet will determine this. There’s also a ‘streamlining’ value that makes thinner, sleeker creatures faster.
Stamina – Uses many of the same modifiers as speed, but often in different ways. Many things good for speed are terrible for stamina. (Note: Currently stamina is deactivated and moving has no cost. This will be fixed as soon as I work out how the move-cost should compare to the likes of the metabolism and growth costs)
Growth Cost – A cumulative value from the energy cost of every body part on the creature; this is the amount of energy that must be spent to grow the creature from childhood to adulthood. Generally this is the balance variable: if a part has abnormally high stats, it will often cost a lot to grow.
Metabolism – an interesting value that establishes a lifespan for creatures, Metabolism is the energy required to keep a creature alive at any particular moment. It increases over time, costing very little when the creature is young but spiralling out of control as they age, eventually overcoming their ability to feed and causing death… which is rather horrible if you think too hard about it.

These are just a few of the derived variables. Some things, like arm-range, have only subtle effects on creature behaviour and are the result of one-or-two variables multiplied out. Other things, like Scariness, affect how other creatures react to this creature and are the result of a massive algorithm. Still other things, like the per-limb damage values, are only used as intermediate stages to calculate other derived values. Some genetic values affect behaviour directly, like the 4 psychological values I still haven’t told you about.

The goal for all of this unexpected complexity is to make it intuitive: the effects of any particular change should be predictable, even if you know nothing about the game. If a creature looks dangerous, with horns and fangs and claws, it should be dangerous; if it looks fast it should be fast; etc.

But I’m also planning to have the UI explicitly state the effect of each variable: hover over Attack Damage and you’ll see all the positive and negative modifiers contributing to it, hover over Bicep Width and you’ll see everything it affects, and how it affects them. The long and short of it is that if I’m seeing a certain trend in the way the creatures are evolving, I want to be able to dig down and quickly find out why they’d doing that with the minimum of work.

That sort of thing, convincing the player to wonder “why” of their own free will, is where the potential educational value in Species lies. I have no intention of shoving facts in peoples faces: that’s edutainment, which is… well… um… *shudder*. But the underlying mechanic of Species is the underlying mechanic of biology itself: it’s going to be hard to avoid learning under those circumstances. But that is an entirely different topic entirely, and this post is already redundant enough as it is.

At this point, all the fundamentals of the simulation are done. We have reproduction, mutation and selection pressures. If left on their own, the creatures evolve. Admittedly they don’t do it very well: at this point there were still plenty of energy leaks I hadn’t gotten around to dealing with, the AI was still fairly broken, and several aspects of their physiology didn’t actually do anything (heck, they still don’t), and in truth it would still be several months before it would be working well enough to actually observe non-random, selective changes over the course of time. At this stage, thanks to the aforementioned energy leaks, creatures would either go extinct in 5 minutes or completely overpopulate the world and crash the computer.

But that’s all polish. What was important at the time was that all the vital elements were in place. They’re evolving. Cue the pretentious choir music, the simulation is live.

More random screenshots! (because context relevance is for wimps)

Signing off,
Qu

“Bored now. Next week we rag on antievolutionists again, okay?”

Advertisements

  1. Behavioral Evolution « Species Development Blog

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: