Posts Tagged video game

Species 0.4.1

… is Released!


Download the game here: Species ALRE Official Website

From the Development Thread:


Gene Splicing
Radiation Gun
Highlight Colour Filters (basic implementation)
Ultra Time Acceleration (deactives rendering, runs at the maximum speed the computer can handle)
Q/E to make the camera Rise/Fall. (It’s like maaagic)
Head animation and movement. (To make them look like they’re actually thinking. Makes them seem a lot less brain-dead)
Eye animation and movement. (as above)
Animated Cloud Plane.
Tree’s waving in the breeze. (These two should make the Time Accelleration actually feel like Time Accelleration, as opposed to simply putting all the creatures on meth)
Better Looking Corpse/Meat Models (Steaks! Delicious bloody raw steaks! How can they resist evolving into carnivores now?)
Fake Shadows
Basic Ambient Noises (placeholder sounds: check back for a hotfix for them later this week)
Export Creature function
Import Creature function
Mutation Map – Feature Model
Mutation Map – Feature Texture
Mutation Map – Body Covering
Mutation Map – Colour Pattern
Update the Mod Maker to acknowledge new Mutation Maps.
Mark Perception Target. (Head animation already made the creatures a bit easier to read: showing the player what the selected creature is targeting should improve that even more)
Remake the Eyes (Eyestalks and eyelids and light sensing pits!)
Remake the Eye textures (Lenses and Compound Eyes!)
Autorestart option for Mass Extinction (in the Options Menu)


Creatures not wandering even though they say they are. (LIIIIIEES!)
Creatures spinning endlessly in circles around tree’s. (Clearly they’re attempting to rob the planet of it’s rotational momentum. They must be stopped)
Game crashes at some point when you set the population cap to 2000.
Autosave closing any open UI tabs. (My bad guys, I should have fixed that one before release)
Creature’s heads rotating into their own bodies (mostly fixed, still happens occasionally though)
Creatures looking in the wrong direction in the Creature Details Panel.
Fake shadows visible through cliffs.
Fake shadows not orienting to ground properly.
Remove Creature Thumbnails. (currently they’re being taken at birth for every creature on the map, which costs performance. It would be better to take one solely for whichever creature is currently selected)
Deforest the area outside the border
Automatically detect if the player’s graphics card can’t handle Pixel Shader 3.0 and/or > 2048×2048 textures
Deal with all of the AI problems that Mark Perception Target made painfully obvious
Bind the Up, Down, Left and Right keys as secondary movement controls for people who don’t have qwerty keyboards.
Option to save as BMP files, for systems that don’t support saving to PNG (assuming that’s what’s causing the loss-of-terrain problems some people are reporting)
Check Biomass Bar for possible Memory Leak (No way to test it, but I have made sure it won’t try to draw more than 150 scale sprites)

Report any bugs here. (or leave a comment below)
Discuss the release here.
Make suggestions for 0.5.0 here.

You think you know me? You know nothing.

, , , , , , , , ,

1 Comment

Why aren’t carnivores evolving?

Here’s a new type of post: analysing the behavior of Species: trying to work out why things are happening the way they are, and using what we learn to improve the mechanics for the future.

Eventually, I’d like to integrate this sort of questioning into the game mechanics themselves: make science itself a game mechanic. As an example: say you want to know what a specific gene does. The game could require you to earn a certain amount of “data points”, or something equally abstract, and then spend them on that gene to discover it’s function. And that would make for a decent game mechanic, encouraging you to earn data points, which I assume you’d get by performing actions like creature sampling. But it wouldn’t be science, it’d be economics. And no offence to economists and EVE Online players, but unless your entire country is falling into disrepair because of too many short-term investments and cuts by the rich and powerful, economics is boring.

Alternatively, you could take a creatures genome, apply heavy mutation to that gene specifically (via a targetable radiation gun or something equally awesome), then clone a creature from that genome and see what’s changed. You could then go back and label the gene. Observation, hypothesis, experimentation and conclusion: that’s science, turned into a gameplay mechanic. And best of all, the reward is the logical result of the experiment: you can now target that feature specifically when you manipulate genetics.

Of course, the game can take care of some of the slower bits: for instance, an ‘autocompare’ between parent and child, which detects and names the heavily mutated gene for you, would keep the game moving better than if the player had to visually inspect for differences, and then go back and type in the function of the mutated gene themselves. Afterall, I’m not interested in data entry, I’m interested in science. (On the other hand, if naming gene functions is your thing, this would tie in well with the ‘naturalist mode’ idea that Reprieve suggested)

Anyway, I’ve managed to go off track before I even got on the track in the first place. I don’t even think I ever even [i]saw[/i] the track: I’ve been doing donuts in the carpark this whole time. Shorter me: I’ll be looking for any opportunity I can to integrate science and gameplay. In the meantime, I can still do science on the game out here in meta-space.

And what I want to know today is: why aren’t carnivores evolving?

Play the game for a bit and the best you’ll probably get are omnivores, despite all the giant piles of delicious meat lying around. Something’s going on: hunting and scavenging should be viable strategies, so why don’t carnivores survive?

Part of this is simply the power of stupid. Creatures are often too dumb to seek out plants, let alone other creatures, let along dead other creatures. Rest assured I’m working on this for 0.4.1, and future versions will have significant AI improvements on top of it.

But it’s not just that. You may have noticed that probably the most viable strategy among the creatures is to find a large tree and just sit there eating it, staying at max energy and pumping out 10 or more babbies until it’s gone, like the Quiverful movement’s vision of the ideal woman.

So why doesn’t this work for carnivores?

Is it just simple math? I’ve been meaning to check the math for this post, but haven’t gotten around to it (and I don’t have the game in front of me right now durn it), but I’m pretty sure it isn’t: meat energy is highly dependant on the life of the dead creature, but everything they eat during their life is converted to meat, so there should be loads of it in each meat pile.

But there’s another factor. You see, creatures have an ‘eat rate’ value, which differs between vegetation and meat. The malleable, delicious, high-protein meat can be consumed much more rapidly than the tough, horrible, inefficient plants.

Seriously. We really appreciate it.

In theory, this serves as a reward: unlike grazing, creatures can get a lot of energy in a short amount of time from meat. In practice, it became the opposite: the above strategy, where creatures maintain their energy at max by eating from one source until it’s completely consumed, works for only as long as the source lasts. And meat doesn’t last much time at all.

This is an interesting phenomenamnicon in it’s own right: the ecosystem actually encourages slow-eating creatures, which is the opposite of my expectations. But it makes the game less interesting and actually discourages evolution, so I believe a few changes are in order.

There are two approaches I could take to this:

– The balancing approach. Consuming meat faster is preventing carnivores from developing, so I’ll make them consume meat slower. I’m not going to take this approach, partly because it’s illogical, but mainly because it utterly and unforgivably violates my primary design goal. I’m developing the environment, not the evolution: I shouldn’t be ‘balancing’ selection pressures to make the things that I find interesting develop. That’s not what the game is about! Aargh!

– The expanding approach. It’s not consuming meat faster that’s preventing carnivores from developing: it’s that I’ve failed to model the animals eating behavior correctly. It’s logically impossible for them to continue to eat when their stomach’s completely full, so why are they doing so? I need to fix that fundamental bug, rather than working within it to achieve outcomes I percieve as desirous.

Of course, I probably won’t be able to fix it immediately. Making them make a new decision when full is a relatively simple thing to implement, but it will lead to a whole bunch of new bugs to test for, and will have significant implications for their survival (making it much harder on the early, blind creatures, and much easier on the sighted random creatures). So I’ll probably hold off implementing it until 0.5.0, which will also implement grazing, a feeding strategy that doesn’t depend on sight and so makes it easier on the starting creatures.

(EDIT) Actually, you know what guys? Screw everything I just said, I’m implementing it anyway. I might as well: it’s not like I’m not fixing AI bugs already, and with those fixes I’ve already completely screwed over the game balance.

(EDIT Mk2) What the flip. The blind starting creatures are surviving better now? How are they… I don’t even… what is this? What the hell even is this? YOUR GOD DEMANDS TO KNOW.

(EDIT Mk3) Okay, it looks like this might be one of those hilariously unintuitive results the Anthropomorphic Personification Of Evolution is so fond of. I could explain what I think is causing it, but that would deprive you guys of the challenge of working it out yourself. So come on: tell me in the comments why they’re reproducing better now that they leave tree’s alone when they’re full! I’ll post what I think is the answer a few days from now.


“Phenomenon”: singular. “Phenomena”: plural. And the “Phenomenamnicon” is a book used to summon a particularly vague eldritch abomination. Geez, it’s not that hard to remember!

, , , , , , , , ,



Wow, are we really at this stage already? In chronological terms, this post takes place just after Development Video #1. Ahhh, I was so young back then in the summer of 2011… [nostalgia]

… anyway, since I’m a cynical old fart now and clearly nothing like my half-a-year younger self, I’m free to criticise past-me for being a naive twit. And naive twit he was indeed when it came to speciation. He knew… wait… I knew? Gah, pronouns. This would be so much easier with a TARDIS, but I’m not a Time Lord. Past-me was but that was before the accident. Wait… after the accident? Goddamn time travel. Oh well, at least I stopped the Dec-2012 mayan-zombie-apocalypse. Suck it you undead sods, nobody gets to destroy this planet except me.

Back on topic, past-me I knew that seperate species, and thus speciation, was not going to be an easy thing to implement. We can’t even define it properly here in the real world! “Species” as a category usually means “unable to interbreed”, but what about ring species, where there is a continuous spectrum of creatures capable of breeding between two populations that can’t?

But they're still just birds! it's not like they've evolved into flying carnivorous fungi! Therefore evolution is false.

Image Source

This provides an interesting design challenge as well as a coding one. How do I define a species? How do I detect when two species have split?

(I say “detect” above because the existing simulation already includes speciation: what I’m describing here is a passive process that analyses the population, not an active process that forces a speciation under certain conditions)

As already stated, I knew that this was not going to be a simple problem to solve, but I was quite unprepared for the sort of problem it actually was. Coding it turned out to be difficult yes, but for all the wrong reasons. And as it turned out it was the design problems that required the most attention. This wasn’t a case of making it up as I went along (my usual method of coding): I was going to have to sketch out the problem in detail to find a realistic and sensible solution.

However, the game is called Species, so I couldn’t just chicken out on this one. It needs to be able to inform the player when speciation occurs, and allow them to track the progress of new and existing species in the ecosystem.

Initial attempts at defining this were sketchy in the extreme. Here’s something I wrote on the SMRT forum back when I was trying to work this out (because I’m too lazy to repeat myself when I can just copy/paste):

The biggest problem is defining species/populations. Just to give you an insight into the internals: I’ve set up a genetic comparison function which compares two creatures and returns their “Genetic Difference”, and I’m using this to determine mating compatibility (greater than 20 and two creatures can’t mate, and are thus different species). So, in the same generation, you have creatures A, B and C. If A’s genetic value is 10, B’s is 25 and C’s is 35, you can see the problem: A can mate with B can mate with C, but A cannot mate with C. Thus A and C are seperate species: but how do we define B?

This would be fairly simple to deal with if it weren’t for speciation. In a large population of many B’s and a few A’s (we’ll call them all “Species 1”), a C is born. What do we do? Do we mark the new C and all it’s descendants “Species 2”? Do we modify the existing populations label, making the B’s a mix of 1 and 2 depending on who’s closer? Or do we change the label and call all the B’s “Species 1.5”?

Despite the difficulties it causes, though, it’s kinda cool I’m dealing with the same issues taxologists have to deal with when trying to categorise animals…

My naivety shines through a little bit in those early comments, and later designs incorporated what I learned about ring-species and subspecies from the answers to my queries above. My second design had a system of ‘sub-species’ underneath ‘species’: a subspecies would be a group of creatures all of which were genetically compatable with one another, and a species would be the larger group that contains all subspecies, linked by those creatures that were genetically compatible with more than one subspecies. It took a few attempts at defining how this would work before I realised that my concept of a series of semi-mutually-exclusive subspecies simply wasn’t possible: the group of compatible mates is different for each creature, so any algorithm to determine this would end up with almost as many subspecies as creatures.

Eventually I dropped the concept of subspecies entirely and just stuck with a solid definition of “species”: a species is a group of living creatures from which a genetically-compatible path exists from any creature to any other creature within the Species. So despite the fact that the subspecies on either end of the ring species above cannot interbreed, the game would consider them all to be part of the same species

This solution brings up several more problems to solve: how do we tell if two creatures can interbreed? How and when do we work out if speciation has occured? And how much of a performance hit is this analysis of every creature going to be?

The first problem was, luckily, one I had already solved. While I was implementing mating, creatures had to check to see if they could mate in the first place. For reasons detailed in the previous post I couldn’t use the genetic string for this, so they instead compare their associated genetic values. Differences in floating point values increase their genetic distance proportionately to the difference, while differences in discreet values provide a constant (but dramatic) increase.

The end result is a floating point number representing the genetic distance of any two creatures. If it exceeds an arbitrary constant, creatures are no longer able to mate.

This system is an interesting one: it leads to a couple of interesting side-effects (for example, the genetic distance value is logarithmic. Immediate descendants can easily have a genetic distance as far as 10.0 units away simply by random mutation, but randomly generated creatures with no relation to one another have only 60.0-100.0 units distance). It’s also unmappable: afterall, how do you represent co-ordinates in 80-100 dimensional space? Because that’s what the genetic values usually amount to. Of course, just because something is unmappable doesn’t mean I’m not going to try…

Everyone loves graphs!

The graph is a bit misleading: the X position of a line represents the genetic-difference away from a “baseline-creature”. So if you imagine a circle, with the baseline-creature in the centre, the horisontal position of the line is the distance away from this creature. Two creatures can be on opposite sides of the circle, but appear at the same place on the graph and a species could be moving “around” the centre (instead of towards/away, as the yellow/orange-coloured species is clearly doing) and you’d never know. And since genetic difference includes a whole load of parameters, it’s less of a “circle” and more of a “50-dimensional sphere”.

Yeah, at that point it loses me too.

… [pause for thought]…

…actually, I just worked out a way to map it while I was typing that, by using the compatible connections rather than the co-ordinates and an elastic vector-web (ever played ‘world of goo’? If you have, you can probably sort-of imagine what I’m suggesting). Not only would that work, it would be absolutely fascinating to watch. Darn it, yet another thing to add to the feature creep list…

Moving on, the second problem then is “How and when do we work out if speciation has occured?”

The genetic comparison function isn’t too bad, but it does take time to run unless I can find a way to convert a Timecube into pure software (no luck so far). Back when I was only using it to help a creature determine if they could mate with another creature it’s effects were negligable, but calling it for every creature in a species, against every other creature in a species, every frame… well, you can see where that leads.

Thankfully, speciation can only happen under very specific conditions. It never happens unless the size of the species is changing, and never in response to a birth: adding a node to the web can’t create a new species (well okay, if the new creature is completely sterile it could create a species of 1, but that’s an exception to the rule).

Speciation is triggered by death: a population will speciate when the creature(s) linking it to the main population die off. So I only need to run the speciation checking routine in response to a death.

But we still need to work out how it works. I know I said working out the design for this system was the hardest thing about building it, but because I’m not an expert in searching algorithms, programming this algorithm was a close second.

The function starts by comparing the Species Average to all other creatures in the List, dumping any that are compatible into the “main population” bin. From there it compares every creature in the ‘main population’ bin to the remainder of the population, putting each compatible match into the bin before recursing to check the match against everything remaining.

By the time this function is finished, we have two bins of creatures: the main population and the remainder. 99% of the time there will be no remainder, which shows that the search function managed to find a way into every segment of the population. But if there is a remainder then it concludes that speciation has occured and splits it off into an entirely new species.

Huh… typing these posts forces my brain to rethink the processes I’m describing, and I think I’ve just stumbled on a few cases where this routine can be optimised. That’s good news: it means the game will be smoother and more efficient in the long run. Glad to see these blog posts serving a purpose beyond my own egotism!

Which isn’t to say egotism isn’t my primary incentive for writing this blog. That, the ability to tell rediculous lies in public. Oh, and also as cover for my time travel shenanigans. Nobody will ever suspect that I am really my evil time clone! Hahhahahahahah!

Now if you’ll excuse me, predestination demands I attack my past self with a toaster in a few minutes.

*Vwhooom vwhoooom vwhooommm…*
“Guys! I’m here from the future to warn you about- !”
“That’s quite enough of that.”

“Actually, predestination is a load of bull. I just told him he had to because it was hilarious the first time.”

, , , , , , ,