T-minus 4 days…

FROGGLOR WILL EAT YOUR SOUL

, , ,

Leave a Comment

T-minus 6 days and counting…

Species: Artificial Life, Real Evolution: Alpha 0.4.0 (Proof of Concept Demo) Release is this Sunday!

Still working on getting administrative stuff done, but the game itself is ready and apparently stable on at least 3 machines. I’m only performing a few small optimisations and bug fixes at this stage (don’t want to break it!), as well as cleaning up the dead-ends and exceptions in the mod maker.

As mentioned on the comments recently, here are some system requirements. They’re not minimum requirements, strictly speaking (they’re actually taken from my development laptop, which struggles a bit but does run it), and if you’re okay with lag feel free to try it out on something slower.

CPU: Intel Core 2 Duo, T8100 @ 2.10Ghz
RAM: 2 GB
Graphics: NVIDIA GForce 8600M GT

BTW, any readers here who own a Mac and would be interested in getting their hands on the game a week early? If so, email me: I’d like to try to find a way to get it working on Mac. I’m trying to cancel out the negative karma points I incurred by using a Microsoft product to build the game.

PS: that surprise I mentioned a few weeks back? Turns out I’ve actually got two of them. Should have one in time for the release, and another within a week or two after that.

(Edit) Oh yeah, I managed to keep the entire game smaller than 25MB once it’s zipped up.

“518402… 518401… 518400… 518399…”

, , , , , , ,

Leave a Comment

Ready?

Urgh, copyright law. Bleargh.

You see, there’s another work called Species out there: an alien/sex/horror movie from the 90′s which I won’t criticise for fear of getting sued. Why they went and called something like that Species is anybody’s guess, but they did and they have it registered under intellectual property law.

So what, right? That’s a movie, I’m making a game. Completely different genre. Surely the Australian government can’t be so backward as to lump those two into the same categ- OH GODDAMMIT.

Yep. Class 9 of Australian Intellectual Property Law includes computer software. It also includes recorded video. It also includes fire-extinguishing apparatus, which I’m… not even going to comment on. So, the movie has stolen my planned name 17 something years in advance. I call shennanigans. Clearly an actual time lord somewhere didn’t like me for inexplicable reasons and went back to 1994 to tell the Myer Delaware Whatever studio what they should name their movie. It’s the only explanation.

So whatever the cause, I can’t call Species “Species” anymore.

Well fudge.

There’s no way I’d be able to rename the project entirely: I’ve been calling it “Species” for 7 years now, I don’t think I’m capable of thinking about it any other way. Which means: taglines!

So from now on the game is officially called Species: Banana Robot Monkey Jesus. Pretty sure that’s not copyrighted.

Okay I’m kidding. I’m saving that tagline for a future project. For this, I’m planning on using the tagline I’ve already got in the blog and on the first Development Video, which means that the games official title from now on Species: Artificial Life, Real Evolution. A bit long, but it certainly gives the readers a better idea of what the game is than simply “Species”, which apparently means sexy alien horror.

This isn’t the only legalish problem I’ve run into, by the way. Among other things, apparently font licensing was deliberately designed as a mechanism to increase the rate of intellectual property lawsuits against video game developers.

You get a whole swath of fonts with Windows, right? Surely there can’t be any problem with using the fonts that come with Windows… oh.

Okay, well, that’s okay, you can download fonts from the internet. I’m sure it’ll be fine to use them commercially… oh dear.

Well that’s okay too, I’m sure I can afford to shell out $25 each for a commercial font licence. It’s not like their licence documents would be written with specific exceptions for people who want to embed them in their document, rather than using them in a strictly visual manner… would they? [glare]

It seems like as a general rule of thumb for developers, if you paid less than $1000 for each font you want to use, you’re probably doin’ something illegal.

Thankfully, Microsoft isn’t entirely without a metaphorical fleshy blood pump. For XNA developers they provide this small list of redistributable fonts, which can be freely embedded and distributed in XNA games. None of them look as good as my original font set, but they’re certainly better than nothing. I’ve settled on News Gothic for the moment: it shrinks well and it looks okay as a header when you halve the font width, increase the letter spacing, and use all-caps.

On other non-game fronts, I’ve been looking further into the possibilities of modding and mod-making. I’m dedicating the next week or so to making modding as easy as possible, starting with a Mutation Map editor for the mod-maker. Manually managing manuscript files to make mutation maps modernise when members of the modding mob modify them makes minimal… m… mmm… sense? Dammit.

The Mod Maker: still as ugly as ever

The map editor itself is nearly done, and should be fairly simple to use, although the physics took a while to get right (all modding tools should have built-in physics, why would anyone even think otherwise?). The big trick will be making the mutation map data portable, so that installing a mod also adds any non-default mutation map links. I have a few idea’s, but I’d prefer to make them work independently to the default system rather than replacing it, so that it’s as easy to delete mods as it is to install them.

Speaking of how easy it is to install mods, my plan is to make a push for the Holy Grail of ease of use with self-extracting zip files. Copy a mod’s zip file into the Species\Mods folder, and the game installs it the next time you run it. Delete it, the game uninstalls it. Simple as that. It’s a bit of a logistical nightmare on my end, but I guess I’m trying to make up for forcing potential modders to install XNA.

I’m fairly well on track to get this stuff into the Alpha release in… 12 days? Really? Huh, thought I had at least two weeks… but since the modding stuff is a sideline project if I don’t quite make it in time I can patch it in when it is done, so I’m not too stressed about it.

The game itself is effectively done and ready to go. It’s not perfect, and it doesn’t quite check all the boxes, but it’s definitely at the stage I was hoping to achieve for the alpha release. I’ve successfully achieved my time-management badge, and can now set things on fire with my mind. Oh wait that’s Psychonauts, never mind.

Of course, I’m not going to let a little thing like being ready stop me from freaking the hell out over the next two weeks.
Qu

“Don’t worry; the physics in the mod-maker is actually a prototype for a planned feature in a later version. Unlike that thing with the supersonic toaster, this time he wasn’t completely wasting his time.”

“And yes, he is deliberately taking screenshots of the mod maker in Windows XP to make it look even uglier.”

Leave a Comment

Evolving Reproduction

Sorry this post is a day late. Administrative stuff has been occupying a lot of my spare time. Hopefully I’ll have a few surprises for you guys in time for the release… [ominous smile]

It’s been a while since I did an evolution/misinformation post. Better get onto that…

This claim probably qualifies as picking the low hanging fruit, but I’ve heard it enough times recently to finally lose my cool and deal with it. Those who use it prominently, evangelists like Ray Comfort and Eric Hovind, are surprisingly popular despite being some of the least intimidating intellectuals amongst the anti-evolutionist movement, so I feel the need express my awareness that this is kind of like picking on the special needs kid at school. I’ll will make an attempt to increase the local level of intellectualism somewhat by dealing with the fundamental disbelief that motivates this claim, but quite frankly, it seems likely I’ll descend into the incoherent noises of someone suffering first degree WTF.

The claim, to quote the aforementioned Mr Comfort, goes something like this:

“For example, evolution has no explanation as to why and how around 1.4 million species of animals evolved as male and female. No one even goes near explaining how and why each species managed to reproduce (during the millions of years the female was supposedly evolving to maturity) without the right reproductive machinery.” – Ray Comfort

The ignorance required to even make this claim is breathtaking. I get phantom keyboard pains in my forehead just thinking about it. Where to even start?

I suppose the first point to make here is fairly blatantly obvious to anyone who didn’t fall onto their head from the top of a ten story building: the theory predicts that sexual selection evolved once in the common ancestor of those “1.4 million species of animals”. I don’t know how Ray Comfort got to the end of the sentence without realising that this is obviously what the theory must predict, but he has somehow managed that weirdly impressive feat many times since: for several years he frequently made this bizarre argument, hundreds of times over. As far as I know Comfort himself finally seems to have stopped using the argument, but his followers most certainly have not.

The claim, despite being the equivalent of a lobotomised guppy in a swimming pool full of sharks, does have a more interesting basis: general disbelief in the evolution of sexual reproduction. Explaining the origins of dedicated sexual reproduction is a tricky one with few concrete answers, so seeing creationists asking gotcha questions about it online is not uncommon.

The first point is that, as is often the case, we can see a continuum of creatures in the ecosystem already. Plenty of asexual and hermaphroditic organisms exist, and there are a variety of creatures that fall somewhere in between. Even amongst our own species gender is hardly a binary male/female trait, and the animal kingdom makes the even the most varied among us look positively mundane. It’s not that hard to draw a line from the asexual to the sexual organisms once you gather up enough dots.

For sexual reproduction to evolve, it needs two things: a viable evolutionary pathway via multiple, progressive mutations (similar to the metaphorical line I wrote about above), and a benefit to following this pathway.

The benefit to sexual reproduction isn’t immediately apparent. Sexual creatures as individuals don’t survive any better than their asexual cousins: indeed, the necessity of finding a mate is quite a harsh impact on an individual’s ability to reproduce. But evolution isn’t about individuals: it’s about populations, and genes. A lot of people think of evolution in simple ‘faster leopard catches more food, faster leopard survives’ terms, when it often doesn’t work like that.

The benefit to sexual reproduction (well, okay, one of several) isn’t that the creature that mates survives, it’s that the population of creatures that mate can take advantage of beneficial mutations more efficiently than the populations that don’t. Amongst asexual creatures, every creature is in direct competition. In order for it’s genes to survive in the long term, it isn’t enough for creature A to survive and reproduce: creature A’s descendants have to survive and reproduce and continue to survive and reproduce, out-competing and avoiding being out-competed by the descendants of creatures B and C.

Assuming creature A’s lineage out-competes lineage B and C, any beneficial mutations amongst B and C will be lost.

Sexual reproduction introduces an entirely new dynamic: co-operation, rather than competition. Creature A’s lineage doesn’t have to out-compete B and C’s: instead they interbreed, merging their three lineages into one. This means that the beneficial mutations of all three creatures can make it into the descendant population. This co-operation is a surprisingly powerful benefit: so powerful that it prompted the development of a requirement to breed prior to reproducing.

The evolutionary pressure in favour of sexual selection, then, is that it increases the efficiency of evolution itself. Populations that evolve faster and more efficiently will, over time, be able to out-compete slower populations.

This is a large advantage to macroscopic creatures, for which the cost of reproduction is high. Microscopic creatures like bacteria and viruses see less benefit from this: they can easily compensate for the lack of efficiency by cranking out ridiculous numbers of offspring at a rapid pace.

All of this is fairly theoretical and abstract, but one of the things I’ve been very happy to see is that it is replicated in at least some form in Species. Individual species usually do become more amorous over time, without me ever having had to implement any direct advantage to mating.

My hope is that tools in future versions of the game will help us dig down even further, to establish exactly why this is the case, by (for example) comparing the most successful half of the population to the less successful half, and highlighting the largest changes.

Another hope for future versions of the game is to improve the evolution of sex. Currently, all creatures can reproduce sexually, and their ‘amorousness’ behavioural modifier increases the chance they’ll mate upon encountering another of their kind. When they mate, both creatures take a copy of the others genetic code. Whenever they subsequently reproduce, they blend their own genetic code randomly with that of their mate to produce the offspring.

So they can and do evolve from asexual (never mates) to sexual (mates whenever given the chance), but it’s a very simple spectrum, and even the most sexual creatures are still capable of reproducing without mating. Adding additional complexity in this system, like possible birthing restrictions and maybe even gender differentiation, would be worthwhile.

As a friend said recently, the feature creep potential for this game is practically infinite. Good thing I’m not trying to implement everything before release!

Cheers!
Qu

Hmm… I had actually meant to do a thought experiment fr this post: try to work out the most likely evolutionary pathway from basic splitting to gender differentiation. Oh well, some other time I guess.

Here’s something we found while Googling around for the relevant Ray Comfort quote”: “Darwin theorized that mankind (both male and female) evolved alongside each other over millions of years, both reproducing after their own kind before the ability to physically have sex evolved. They did this through “asexuality” (“without sexual desire or activity or lacking any apparent sex or sex organs”). Each of them split in half (“Asexual organisms reproduce by fission (splitting in half).” – Ray Comfort.

The Banana Man, ladies and gentlemen. Accept no subtitute.

, , , , , ,

Leave a Comment

Future Development

This’ll be fun post to write: I’ll outline the things that are ready for the alpha release (ie. bragging), and then I’ll start talking about what needs to be fixed, and then go on to where we’re heading after that. And then… well, we’re now officially in testing-and-bug-fixing mode for the alpha, so I guess it’s time to announce the release date. Ahem.

Where we’re at.

Species 0.4.0 is a functional and apparently stable evolution-from-first-principles simulator. It’s possible to spot natural selection in action with the Species Average statistics, and I’ve seen things like convergent evolution (creatures consistently become more amorous, for example) and punctuated equilibrium (evolution starts off quite rapidly, but slows down after a number of generations). There’s plenty of neutral, beneficial, and harmful mutations, and a variable mutation rate (you can set it when you start a new map).

We’ve also implemented genetic recombination (mating) and the possibility of predator/prey relationships (attacking and eating dead creatures).

We also have a small variety of observational functions. It’s possible to analyse most of the creatures statistics, watch the progress of their energy and health bars over the course of their lifetime, and read their genetic code (which, admittedly, is somewhat indecipherable).

We’ve got a built-in speciation detector, that works out which populations can and cannot interbreed, and allows for the retrieval of stats and averages. We also have a real-time population history, which doubles as a tree of life.

Oh, and we’ve got a variable map generator, that you can use to customise the map before you enter the game, as well as entry-level save/load functionality.

And moddable body parts, too. :)

What we’re missing

Playing the game at the moment reveals a few… not so much ‘bugs’ as ‘things that aren’t much fun’. They’re things I’m aware of, but haven’t had time to fix and/or expect to fix with a planned, later feature.

Constant environment. The environment at the moment is a fairly constant variable: tree’s always regrow in the same area’s and the temperature never changes. This means that creatures have a tendency to adapt to their environment and stagnate.

Highly variable survival rate. A less-than-fertile map has a good chance of killing off the starting creatures, while a fertile one will cause a ridiculous population explosion once they adapt to be more efficient.

Lack of carnivorous incentive. Creatures rarely become predators because vegetation is plentiful and easy to find in comparison to meat.

Unmapped Mutations. I still need to add a mutation map for feature, limb-tip and body covering mutations. At the moment they find an ‘ideal’ far too rapidly.

Not enough Homogenizing. Species currently don’t visually distinguish themselves very well: you end up with a large crowd of highly variable creatures. Reducing the mutation rate helps, but I’d like to amplify homogenising forces like mating to make individual species more visually distinct from each other, as well as implement some sort of herding behaviour to make them congregate into discreet area’s.

Stupid creatures. They’re really pretty dumb sometimes. I expect their AI to improve slowly, a little bit with each release.

Incomplete Statistic Mapping. The UI allows you to track which statistics affect which other statistics, but the mapping is incomplete and doesn’t take into account all the effects (it’s a big list, and I’m tweaking it all the time. Nevertheless, I’ve managed to include all the major effects).

Performance. Is absolutely terrible on less-than-modern machines. My development laptop struggles to keep it going at better than 10fps once the simulation reaches more than 500 creatures.

Where we’re heading

Here’s the fun one! (Note that everything I say from here on out is tentative. I can’t make any promises, this is just what I’m planning)

The Big Feature for Species 0.5.0 will be a complete and massive overhaul of the vegetation system. It will use dynamic biomes based on a temperature/humidity map (which will change over time based on the actions of the creatures), instanced models, and a rewritten terrain shader.

It will also separate vegetative energy into two sources: fruit tree’s (point energy-sources, similar to the tree’s in the current system but rarer and more valuable), and grazing (idle, herbivorous creatures will graze, very slowly and inefficiently gaining energy but reducing the local fertility).

This system will solve the first two problems I have with the alpha release (mentioned above), and will have an as yet unknown effect on the third. But it’ll probably make the performance issues worse, so I may have to shrink the default world-size and creature-cap to compensate.

0.5.0 will probably also feature a top-down map view, with coloured icons for creatures and food sources, and another real-time phylogenetic tree of life. Unlike the current population history graph, though, this tree will encompass the entire history of the simulation, and will record morphological data about extinct species. It will form the basis for an extensive ‘fossil record’ in later versions.

One apparently minor inclusion to the vegetation system will be a ‘height’ value for fruit tree’s: creatures will need to hold their head (or hands) at a particular height to eat from particular tree types. While this might not seem like much, it sets the stage for a creatures vertical position to influence their actions and survival. And that sets the stage for another Big Feature: flight and swimming.

And of course, I’ve already mentioned a third Big Feature in a previous post: multithreading to improve performance. Not to mention my extensive plans for player interaction in the Beta… I may or may not be too ambitious for my own good.

But pulling right back from my deranged ramblings about the future, the figure you suffered through that entire post for is here. Without further ado:

Species 0.4.0 (alpha) will be publically released on the 27th May, 2012

(one way or another)

Cheers,
Qu.

“… assuming the Old Ones don’t return before then and consume us all. You know, the usual disclaimer.”

, , ,

3 Comments

Optimisation, Performance, and *shudder* Multithreading…

Yeah, it’s time for another technical post. Sorry guys, I just can’t help myself. If you understand what I’m talking about, you’re probably doing better than I.

CPU Performance in Species is probably the single most restrictive factor of programming the game. It limits the number of creatures, it limits the methods I can use to change their variety, it limits the complexity of their behaviour, it limits everything sooner or later. But with very, very careful programming and optimisation, that ‘later’ can be pushed pretty far back.

Firstly, a little background: Species is ‘CPU Bound’ as opposed to ‘GPU Bound’. A CPU (Central Processing Unit) limited program spends more time computing what it has to draw than it does actually drawing it, meaning the GPU (Graphics Processing Unit) sits idle until the CPU is finished. I could dump a whole load of extra information onto the GPU and it simply wouldn’t care, because it’s hardly working as it is. The GPU is awesome like that.

Shawn Hargreaves can probably explain all this better than I, if you’re looking to read up on it:

An Elf In A Box
How to tell if you are CPU Bound or GPU Bound

I’m loathe to admit it, but I secretly suspect the Terrain LOD system I spent so long programming may be slowing the game down, because it takes work away from the GPU at the cost of a little bit of work on the CPU’s part, and I’m so heavily CPU bound there’s a chance just brute-force-rendering the terrain would be better at this point (I could be wrong, though, and taking it out at this point would be rather silly since there’s so much more yet to implement, on the GPU and CPU)

That’s why some of my systems, like the Billboard Vegetation, are reliant on offloading information from the CPU to the GPU. The GPU can handle it. The GPU can handle anything. (Advertised product may not in fact be able to handle anything)

So that’s fairly simple, right? Drawing takes no time at all, so all our time must be spent updating the simulation.

Nup.

In reality, I’m only spending maybe a quarter of my CPU time in the update call. The reason for this is the bottleneck between the CPU and the GPU. Before the GPU can draw anything, the CPU need to tell it what to draw, in excruciating detail.

So even though I can’t save time by saving the GPU work, I can save time, lots of it, by stopping the CPU from telling the GPU it has work to do. There are a variety of ways I’m doing this…

I’m sure I’ve mentioned before that creatures are made up of a whole bunch of separate ‘part’ meshes. A high detail creature would have a torso, tail, 6 limbs, 6 limb tips, a neck, a head, and a currently unlimited number of Features attached to the head (open to later revision). Multiply this by whatever our creature cap is and we’re calling the draw routine far too many times for good performance.

But it doesn’t have to be called for every creature. Creatures off-screen don’t need to be drawn at all, and we can get away with drawing less detail on distant creatures.

We can also speed this up with State Batching. (Note for technical readers: Model Instancing would have been my preferred approach, but the parameters for each creature are unique. It’s not easy to instance meshes under those conditions). See, in order to tell the GPU what to draw, the CPU has to feed it with the model, texture, and parameters things like animated bone positions, sizes, colours, etc). The easiest method would be just to feed in these three things for every model, every time, and this is exactly what repeatedly calling Draw() in XNA does.

But you don’t actually have to. The GPU remembers: if you just change the parameters, but leave the model and texture as is, you can draw a second copy of it without resending the model. So by carefully rearranging the order of drawing to (for example) draw all creature torso’s one after the other, you only need to set the torso model on the GPU once. You can do the same thing with textures and parameters too, if you’re changing models all over the place but repeatedly using the same texture.

Obviously there are other, more subtle and game-specific ways to improve general CPU performance as well. Moving calculations out of loops wherever possible is a generic one: more than once I’ve caught myself doing a calculation multiple times when it could be done only once. A more specific example was carefully controlling matrix operators: streamlining the modifications I’d made to the skinning animation system cost me some programming time, but resulted in a noticeable performance increase.

But even with all these ongoing optimisations, I’m still not happy with the games performance. I’ve been treating my 4 year old, dual-core laptop as a baseline minimum (not least because that laptop is my development machine), but it struggles keeping the game running at a decent frame rate once the simulation gets going properly. There’s still room to optimise (there’s always room to optimise), but I don’t think I can get it to
the performance levels I’m hoping for with after-the-fact methods and reprogramming individual methods. This leaves one other option…

… multithreading. *dramatic thunder*

(Note: this rest of this post will likely be one long whine. I hate multithreading even more than I hate render targets. I still plan to tame it one day, because it really is a powerful way to improve CPU performance, but not for the alpha release)

Most machines have more than one CPU these days, and many people assume as a result that that means the computer must be faster. 4 cores? FAST. 8 cores? ULTRAFAST. 128 cores? OMG WHY YOU STEAL NASA SUPERCOMPUTER. In reality though, most programs are not designed to take advantage of this. The vast majority of programs do all their actions on a single core, because Multithreading Is Hard.

Multithreading is the process of taking part of what you have to calculate and giving it to a separate process (thread), which can run in parallel on a separate core: in short, it’s telling the computer to do multiple things at once. So for a game, you might tell the main core to render the screen while the second core works on updating the simulation for the next frame.

Of course, describing the process so clinically doesn’t quite summarize the emotional response I have to multithreading. So for that side of things, here’s an alternative explanation: multithreading is the process of juggling 3 plates, 2 watermelons, a chainsaw and a rabid wolverine while walking a tightrope over a pit of giant acid-spitting ants while cyborg trapeze artists take pot-shots at you with AK-47′s and grenade launchers.

I’ve actually attempted multithreading in the past. The results were unpleasant, unpredictable, and impossible to debug, mainly because I didn’t know what I was doing but also partly because that’s just the way multithreading is.

To give you an idea, suppose the first thread retrieves something from the second before the second thread is finished with it. The program might fail (which is what we want, so we can work out why the first thread is retrieving stuff from the second), but it will usually try to keep going. The simulation will start acting strangely, using false values, but not actually telling you it’s doing so. If it fails, it will fail somewhere else in the code that has nothing to do with the multithreading, and you will then spend hours investigating in the wrong place.

The usual approach to multithreading is to implement a lock, so that one thread waits for the other to finish before using any of the same resources. But the draw call needs to use a lot of the same resources that the update call uses, so it would likely spend much of it’s time waiting, and wouldn’t be much of an improvement over single threading.

(There are, obviously, ways around this, and when I do implement multithreading properly I will have to study them in detail)

In addition, for some reason, Multithreading plays havoc with Visual Studio’s debug mode: a multithreaded game seems to run much slower than an equivalent single threaded game in debug mode: so slow that, during my ill-fated attempt, I had run the game outside of debug mode on in order to test it. Less than ideal, and it makes tracing bugs and errors much, much harder.

For the alpha release, and probably for the second alpha release too, we will have to settle for less-than-optimal performance. When I do implement Multithreading I will have to set aside a lot of time to rework a large amount of the code, and to deal with the inevitable problems. With luck, though, I will be able to significantly improve frame rates, which will allow for bigger worlds and more creatures.

Qu

“You know, there’s probably potential for a misogynistic nerd-joke about multithreading in there somewhere.”

, , , , ,

Leave a Comment

Modding and Mutation Maps

As it turns out, modding is pretty hard to do in XNA. So, the first part of this post will serve as a bit of a ‘how to’ for XNA developers building for PC (it might help for XBox, maybe, but I make no promises). After that I’ll skip to the more species-specific discussion: feel free to skip ahead.

The reason XNA has trouble with modding is its content pipeline, which serves to pre-serialize the game content into an easily readable binary format (*.xnb). This is actually a very smart system: rather than spending loads of time compiling models and textures every time you open the game, it compiles them once on the developers end, saves the result as a part of the game data, and can quickly load it again on the players end without having to do anything complex with it.

But it’s a nightmare for modding, because it means modded parts either need to be pre-compiled to be brought into the game, or the game needs to be shown how to compile the modded parts itself.

Of course, the XNA team are awesome, so they provided the WinFormsContentLoading sample. This sample shows us how to make a program that compiles and renders a model, and can easily be extended to work with Textures and other files, too (well, ‘easily assuming you don’t find one of the pitfalls‘). Perfect! Add that to the game and it can compile modded parts, right?

Not right. You see, for a variety of reasons that I’m certain make sense to someone somewhere, Microsoft have decided in their infinite wisdom that the content pipeline assemblies shall not be included in the XNA redistributable, and XNA developers are forbidden from distributing it themselves. This means that, were I to include mod compilation capabilities in the game, it would not run for anyone who had not installed the full version of XNA. The full version of XNA is free, but installing an entire development environment just to run the game is a bit much to ask.

Interestingly though, restricting compilation does not restrict use. Once compiled, modded parts can be distributed all we like. So, with or without XNA, everyone will be able to use modded parts. They’ll only need to install XNA if they want to make modded parts.

This leads to the strategy I have in place for Species, which could be easily applied to any game. Mod users won’t have to do anything more than download modded parts and copy them into the appropriate subfolder. The Load Content routine, rather than loading a hardcoded number of items, reads the number of *.xnb files in the subfolders and loads them in one by one (it’s not necessary to have them in the Content Project, so long as it can read their filename).

Mod making, on the other hand will be a bit more involved. It won’t actually require the mod developer to use XNA: I’ve created a utilitarian (read: ugly) ‘mod maker’ application out of the WinFormsContentLoading sample, that compiles and copies the *.xnb files. But even so, the mod developer will have to install XNA and Visual C# to use the mod maker in the first place.

We prefer the term "Aesthetically Challenged"

I hope that this will be acceptable for people making modded parts, as it’s the easiest I can make the process at this stage. Thank goodness Visual C# and XNA are free, or it probably wouldn’t even be worth implementing, which would be a great loss in a game like this. Community modding has huge potential to expand this game beyond what any development team could make it, and I’m incredibly excited to release it into the wild and see what people come up with.

…………………………………………………………………………

If you’re skipping ahead, start reading here.

So, what will be moddable in Species specifically?

In the Alpha release, just body parts. It will be possible to model your own head types, eyes, ears, horns, feet, etc, or to draw your own new body coverings like scales or fur. Add the required stats, copy the files in, and new body parts will appear in the game. Also, technically, you can replace any texture or model in the game using just the mod maker, but that’s just a side effect.

This is only the start though. It takes time to open up a section of the game to modding (without just handing out the source code, which I’m reluctant to do) which is why I didn’t bother opening the vegetation system up. The billboard vegetation will be replaced in the second alpha release with a much more complex and dynamic vegetation-and-environment system, and that will be open to modding. In the long term, I’d even like to open the statistic map to modding: allow the players to add their own selection pressures and stats. That’s an ambitious one, though. At the moment, just making it visible through the UI has been quite a time consuming job.

Subtly pulling the conversation back to body parts (the ultimate conversational topic!), there’s one aspect of that I’ve not yet discussed. It’s one of the last things I implemented, which is ironic because this subject is one of the very first things I started to sketch out when I began designing this game. I’ve even got proof, one of the very first digital sketches I made, a long long time ago:

I'm pretty sure I drew this before I even started using XNA.

Mutation mapping is something I have to be careful with, because I know some people are going to look at these diagrams and say “he’s guiding the evolution”. That is not and never will be the purpose of this system: every mutation goes in both directions, and no mutations are more or less likely to occur than any others.

What the Mutation Map system is doing is not guiding the simulation, it is restricting it. Without this system, if we were to just use a random number generator, it would be entirely possible for a fin to spontaneously become a wing, a duck bill to become a crocodile mouth, a reproductive organ to become a politician, etc. Since such a thing doesn’t happen in real life and is impossible (or at least, extremely unlikely) according to the theory of evolution, this restriction is an important element of the simulation.

It also allows for progressive development amongst otherwise discreet variables. It’s easy to imagine a Species slowly getting larger and larger in the game, because floating point variables work perfectly for evolution, but with discreet variables such as eyes, features will suddenly appear on a mutant creature and then spread through the population. This isn’t gradual at all.

A mutation map doesn’t actually stop this, but it allows it to be a lot less sudden, by including (for example) a light-sensing patch of skin, followed by a better, shaped patch, followed by a very basic lens, followed by a complex eye. It’s also possible to include offshoots at every stage (and recommended: I’m going to try to include as much content as possible in the vanilla game, before we even get to modding). Of course, the light sensing patch will still appear just as suddenly as the eye did earlier (in real life, it’s likely a patch of skin would grow more and more capable of sensing light rather than just appearing), but that’s still a lot more gradual than a fully formed eye appearing out of nowhere.

An interesting point about the mutation mapping in general is a fact I realised some time between realising it was going to be necessary and implementing it: I shouldn’t actually be designing it as a ‘web’. The above diagram shows the problem with the way I was originally designing it: I was using features idea’s I knew existed in real life, and connecting them based on similarities. I was doing it completely backwards: what I should have been doing instead was starting from a simple design and branching out, letting the part design reflect it’s statistics rather than working out the statistics based on the part design.

Here’s a more recent sketch. As you can see, rather than the convoluted web we had in the body covering sketch, designing this way forms a sensible nested heirachy:

Apparently, in my spare time, I sketch pictures of feet. You now know more about me than you ever wanted to.

It’s also scarily exponential. Four generations with three statistics and I already have 40 different feet types. Not to mention the fact that designing stuff like this is surprisingly easy: it wouldn’t be hard to extend the design to a fifth generation. Modelling and importing 121 feet types, on the other hand… not so easy. As a friend mentioned to me recently, the feature creep potential for Species is rediculous!

Which is part of why modding holds so much appeal for me. Even with the help of a proper graphic artist, there’s no way an indie studio like us can do that much content on our own. Community modding frees us to work on new engine functionality, things like flight and swimming and an improved vegetation system, while a lot of the actual potential for biodiversity can be unlocked and appended by the community themselves.

Don’t worry, though: I’m not going to rely entirely on the modding community The vanilla game will have as much content as I can build and pack into it. Nevertheless, I’m superexcited to see what people do with it once the game hits the public, in a month and a half or so… :)
Qu

“He’s only excited because he feeds off the wordpress blog stats the way demons feed off of the souls of D&D players.”

, , , ,

2 Comments

Apologies for Lack of Content

It’s been kind of frantic around here recently, so I completely forgot to spend time writing up a proper post. I’ll try to get something halfway worth reading onto the interblag tonight or tomorrow. In the mean time random screenshots:

Turtle Thing

Skinny birdy thing?

Thing thing

PS: Progress report. I’ve finished the vast majority of the major features (like, 90%) and am mainly just polishing and bug fixing at this stage. We’ll be going into the testing phase very shortly, which I’m leaving about a month for. Release date is still a bit rough: I’m 99% certain the game itself will be ready by the date I have in mind, but I don’t know whether a few other things will be. Suffice it to say, I hope to release before the end of May, and will have a concrete date for everyone before the end of April.

Leave a Comment

Lifespan

Not everything in Species has gone the way of the behavioural system, getting simpler and simpler over time. Some things, like lifespan, have actually been becoming more complex over time, slowly integrating themselves with more and more systems in the game. (Don’t worry, I’m like 80% certain none of them are about to become Skynet)

As already mentioned in previous posts, lifespan initially wasn’t included. Once reproduction was put in place, however, we needed to ensure there existed ways to die beyond “brutally murdered by the developer”, which up until then was the only cause of death.

This was something I hadn’t designed from the start: how lifespan should be handled simply hadn’t occurred to me. So to start with, I did the simplest thing and just killed the creatures the moment they hit a certain age. From memory it was 2 minutes simulation time.

This was a pretty blatant instance of placeholder abuse. The lifespan was artificial and arbitrary, but I told myself it was just a placeholder so it didn’t matter and moved on with other things.

As it turned out this self-serving assumption was both true and false. True, it didn’t matter at the time I implemented it: at that point energy leaks and AI bugs made balancing the game a futile endeavour. But it did come to matter later, because as it turns out, 2 minutes isn’t enough time to find food and reproduce. Who’d a thought?

The next iteration (after upping the lifespan variable to compensate several times) was to turn lifespan into an inheritable value.

This turned out to be an interesting solution. Creatures with a longer lifespan would spend longer in childhood, unable to breed. This meant that creatures would have to find the right balance.

Unfortunately, it was impossible to guess a creature’s lifespan from visual cues. It was the same problem I was having with the behavioural system: you couldn’t see lifespan evolution happening, at least not directly. I needed to tie lifespan to something physical.

The third step was to tie lifespan to size. Larger creatures live longer than smaller creatures, right?

This was a lot better, and it made it possible to see the effects lifespan was having on natural selection. It still felt a bit arbitrary (it was possible to put a countdown-to-death timer on top of every creature based purely on their size), but it wasn’t a bad system.

But at this point I realised something else that was bothering me about all these systems: they were instantaneous. Age and lifespan had absolutely no effect on a creature until suddenly and without warning they exploded into mounds of delicious meat. This doesn’t normally happen in real life (well, except that one time I mixed up the nitroglycerine and the cat food, but that was totally* an accident).

The energy system at the time also meant that creatures dying of old age had far more meat on their bones than creatures killed by attacks or starvation, because their energy and health bars were often still full when they died, so they got converted to meat. This side-effect was unexpected, and unless you understood the system behind it, didn’t make much sense.

The fourth implementation (or possibly the 3.5th) was an adaptation of the previous version, where rather than just getting insta-gibbed, creatures past their use-by date would gain a new energy cost, similar to the cost of growing out of childhood. This “dying” cost would deplete their energy and health bars, resulting in a much more natural-seeming death.

But I still wasn’t happy with it. It was theoretically possible for a creature to eat enough to offset the dying cost and live forever, and increasing the age cost enough to counter that possibility simply made it look like I was insta-killing them again. It wasn’t that big of a problem, but I still wasn’t happy with the system. It just didn’t feel right.

And so I finally got around to giving the problem the attention it deserved in the first place. How does lifespan work in real life? (Morbid discussions on the nature of mortality! That’s what this blog needs more of!)

In real life, the damage from age is gradual and increases over time. We don’t suddenly hit a certain age and keel over, we just slowly take more and more damage until our body can no longer keep running. We can offset this with a healthy diet, exercise, and homeopathic remedies… pfff no I’m kidding. Stick with the healthy diet and exercise, at least they do stuff. Anyway, we can offset the damage significantly, but we can’t offset it forever, because it accelerates as we age. It was relatively easy for humanity to get our average lifespan up to 80, but now we’re struggling for every extra year, even with the incredible advances in medical technology we’re seeing in recent times.

So how does this translate to Species? Fifth implementation: aging doesn’t suddenly kick in at the end of the creatures lifespan, instead starting slowly and accelerating over time. Young creatures just out of childhood spend very little energy on keeping their body running, while older creatures spend ever-increasing amounts. This ensures that no matter how quickly a creature can gather energy, it’ll never be able to stave off death indefinitely.

Of course, I still want longer and shorter lived creatures correlated with size, without just handing an indisputable advantage to the largest creatures on the map. A bit of further thought/research on the subject revealed something interesting: smaller, shorter lived creatures in real life tend not to show signs of aging until the very end, while larger creatures die more slowly. This gave me an idea: a variable energy loss curve.

As you can see, small creatures (x3) have the advantage early in their life: more energy to spend on moving, eating and reproduction, but then their energy loss accelerates sharply towards the end of their life. Large creatures (c*x) lose the early advantage in favour of a much higher staying power. In-between creatures lerp (linearly interpolate) between these two graphs.

An interesting point about all this extra complexity in lifespan determination: it doesn’t obscure the in-game evolution the way the complexity in the behavioural system did. The ‘mutable lifespan’ I had way back in step 2 was a lot simpler than this, but also a lot harder to spot in action. I assume that’s because this system matches what we intuitively know about the world: larger creatures live longer, smaller creatures are more energetic (ask any dog owner). The complexity here just gives the system more nuance, making it feel more natural.

So I guess the take-home message is: complexity is not the enemy of intuition. A familiar but complex system is preferable to a simple but alien system.

I’m totally deep!
Qu.

*footnote: For the record, whenever I use the word “totally” in this context, I am, like, totally being ironic. I don’t generally speak like a high schooler from the 90′s. Dude.

“The neighbour’s cat was probably lucky it was only nitroglycerine. He stores mutagenic nanobacteria on the next shelf down.”

, , , , , , ,

Leave a Comment

Behind the scenes: Yesterdays Post

Umm... no comment.

Ref: Yesterdays post.

, , , ,

Leave a Comment

Follow

Get every new post delivered to your Inbox.