Hello, it’s Matkins again with my second blog post about creatures. The team have twisted my arm to get me to tell you a few tales of the unexpected.
The manta rays were introduced into the game recently. They are much faster than the beetles and actively hunt them for food. After killing their prey, manta rays continue to feed on the corpses until full. In the future, we are planning for manta rays to latch onto their prey to prevent escape, though this isn’t in the game yet.
After running the simulation for several hours I took a look at the world and became concerned at how few manta rays I could see on the islands. I didn’t know where so many of them had gone, so I restarted everything and just observed it for a while. Then I saw the problem. A dead beetle that two manta rays were feeding on rolled down a slope towards the edge of the island and then fell off. The manta rays continued to pursue the falling beetle body, all the way to the very depths of the abyss, never to catch up.
The fix was very simple; creatures now give up on their target prey eventually if they’re not getting any closer to it.
Sex in the Synchronicity
Because we don’t spawn creatures artificially in Worlds Adrift, a very important part of simulating an ecosystem is getting the creatures to reproduce correctly. The creatures are sexual so we’ve had the intricate challenge of pairing up opposite genders and co-ordinating them to “bump uglies.” This feature was far trickier to implement than I initially expected and a number of interesting things happened along the way. One early problem with the system was regarding synchronicity.
Libido is only one of many drives that the creatures have – there are other important things they need to do, such as feeding. But it’s very important that sex does happen eventually, without failure, to ensure the survival of the species. The trouble with making it infrequent is that the chance of two creatures of the opposite sex, within range of each other, wanting it at the same time gets incredibly slim. A developer might configure a species so they mate once every day, for example, only to find that in reality they never mate because no pair of eligible partners are wanting sex at the same time.
I struggled with this problem for a while before the eureka moment occurred; To ensure that creatures were very likely to mate, whilst also keeping mating infrequent, all I had to do was make the libido of one of the genders much faster than the other. So when the low libido sex eventually wants to mate, the high libido gender is highly likely to reciprocate. No prizes for guessing which gender was given the high libido.
I felt elated and overwhelmed with a sense of profundity. Not only had I solved an important problem with the simulation but my life also made a lot more sense.
When new features are implemented it’s good to spend a little time simply observing the creatures’ collective behaviour. It’s useful for spotting new bugs and it’s a relaxing break from coding. On the ground of an island, under a small swarm of beetles, I saw one dead beetle lay on its side. Suddenly I witnessed an extraordinary act of empathy. A living beetle flew down towards the dead one and started nudging it gently. The dead beetle just rolled over slightly. It looked like the living beetle was in the denial phase of grief, desperately trying to wake his motionless friend up from a deep sleep. It was sad, beautiful, and very confusing. I had not programmed this behaviour.
That is when the horror struck. I realised what was actually happening – the beetle was mating with a corpse! And further observations revealed that interspecies mating was occurring too. It was a bug with the filtering out of ineligible partners. It was easy to remove these behaviors, but a lot harder to forget what I had seen!
So, thank you for reading. Hopefully, I have given you a bit of an insight into the fascinating/horrifying job of bringing life to Worlds Adrift. I look forward to sharing more tales of the unexpected with you in 2016!
Matkins (Matt Atkins)