I’ve finished all the new features and am now stolidly bugfixing, so it’s time for the usual ceremony. Species 0.7.0 will be released on…
3 October, 2014
… assuming I don’t come into possession of an easily-activated doomsday device before that date. And a proper one, too. I’m talking something with a button, none of this “47 hooded monks chanting for two weeks around an occult pentagram drawn in basilisk blood” rubbish. It never works. Sooner or later one of the monks has to go to the toilet and then you need to start over.
And I’m pretty sure Yog Sothoth would take offence if you issued them with jars.
Neck rotations have been implemented in the development version for a while: they give creatures a genetic “head rotation”, allowing them to hold their necks to angles other than horisontal by default. But we’ve upgraded it a bit further in the last month or so…
Mobile necks. Creature’s with necks will attempt to rotate them to bring their head to the same height as whatever they’re targeting.
In addition, I re-exported the neck model to fix the neck-through-head bug. Fare-thee-well hideous head-impaling neck-tongues. You will not be missed.
PS: I stumbled on this fellow whilst experimenting with the random generation. Looked too neat not to share.
This was fun to implement (click to enlarge).
It’s amazing how many different synonyms for “moderate” you can come up with if you try, and picking the terms for exaggerated stats was a good chance to give the game (and by extension, the creatures) a bit more character.
I even managed to slip in a Douglas Adams reference! No rewards for guessing which stat it applies to.
Done for now. It’s not perfect and there are some definately situations where it won’t perfectly reflect reality (and I’ll be strangely disappointed if the creatures don’t exploit these ruthlessly), but it’s a far smoother and more elegant solution than the old “Droop if rotation < 45" system.
It may just be the placebo effect, but navigating through a randomly generated map, the properly drooped creatures feel a lot more 'organic' and varied than what I remember of their counterparts from 0.6.1.
Still need to do one more of these for compressive forces, which will take into account cross-sectional area and thus prevent sticklegs, but we’re just about done here. These energy losses should prompt natural selection to avoid unbalanced, droopy creatures.
I’ve also measured the size of creatures from their skeleton in the default units, and we now have an official length for Primum Specium: 32cm for a child, with an adult being 64cm.
I had intended to add a modifier to that, to bring Primum Specium up to a round metre long, but now I’m honestly not sure if I should. I’ve always been a bit iffy on the scale, and 64cm for an adult (the rovers are about the same length, too) isn’t anywhere near as bad as I was expecting. At this scale, the high trees are around 3.8 metres, and a standard size-1 world is a square 153 metres wide, or 5.8 acres.
What do you folks reckon? Leave it at 64cm, or apply a modifier and bring it up to 1 meter?
Added a button for building fences, a panel for making climate control devices, and a rough placeholder model for them.
I ended up going for a ‘chemical emitter’ design: since that’s the most plausible way to manipulate temperature in this manner. Think of it like the urban heat-island effect, only a lot more concentrated.
I’m not really sold on the model design, but it serves it’s purpose for now.
Still to do!
We’re finally past the hard stuff: with the internal body physics working, we can focus on finalising the last few features for an 0.7.0 release. Once those are done, I’ll start the bugfixing phase and anounce a release date!
So what are those final features?
- Fences need to be selectable and removable. Creatures also need to ignore things when they’re behind a fence. And I’m thinking rovers should probably do the same: as cool as it would be, having rovers navigate around fences rather than just accepting them as a barrier would make it impossible to perform localised artificial selection.
- Climate devices need to be selectable and removable, and you need to be able to program their target temperature/fertility. The UI panel includes both of these, so I just need to make it assign them to the new device.
- The Creature Details UI needs adjustment, to report values in our new metric units.
- Graze, Feed and Attack Animations need implementing. As previously stressed, these won’t be complex: just basic movements to communicate what the creature’s up to.
I’ve been working on applying torques to the creatures in a meaningful and well thought out manner (read: banging my head against the keyboard whilst trying to fix all the horrible signage errors). The original intention was to simply pass the torques on to the energy system and let natural selection weed out the unbalanced and physically impossible specimens. But I realised I have the perfect opportunity to overhaul a system that has bothered me since its inception: the quadruped system.
Logically, if a creature has slightly smaller front limbs than back limbs, it should lean forward in order to walk on them (unless it’s a pangolin, but they’re too awesome to be swayed by our petty logic).
Without something to enforce this, every creature in Species ALRE would be a biped, because every creature has at least a *slightly* different leg size.
The quadruped system governs how this is implemented. A hideously simplified description would be “if the torso rotation is less than 45 degrees, and it has fore or back legs, the creature will fall forward onto its front legs or chest. If it’s higher than 45 degrees, or it has mid-legs, it will remain bipedal.”
That “45 degrees” is completely arbitrary. It’s just a value I picked.
This system is why ‘head-down butt-up’ creatures, whose bodies hang forward from their back legs are so common: Any creature with large back legs and a small torso rotation will end up with this body plan.
That’s the old system. The new one is much more sophisticated.
It starts by completely eliminating the quadruped system: creatures will initially be created *exactly* as their genes would have them (ie. with only one pair of their legs reaching the ground). It then calculates the skeleton and torques as normal.
Once that’s done, it passes control to the droop system. This applies “droops” to every body part attached to the torso: limbs, neck and tail. Legs are bent upwards by the reaction force on their legs, neck and tail are bent downwards, and the torso droops based on the creature’s balance, all in direct proportion to the torque applied on the joints.
If a body part droops into the ground, it stops drooping and adds a ground contact point, which will take some of the creatures weight in the next step.
Then pass 2 starts, the body-plan is completely reinitialised: bones are regenerated, torques and forces are recalculated. The results of pass 2 are what the creature will ultimately use for most of it’s energy calculations, so as to take advantage of the creature new quadrupedal body plan. (physical droops will affect energy, but proportionally to how much they rotate rather than as a function of torque. Small drops onto legs will be a negligible cost)
This also has a noticeable effect on creature appearances. I haven’t adjusted the rotation genes at all in the following screenshot: these variations are entirely the result of torso, neck and tail thickness changes causing different torques in the creature’s body plan.
One particularly noticeable change is that the creatures tail now has an effect: increasing its mass is the only way to counter the torque produced by the head and neck in the second body plan. For bipeds with centrally situated legs (raptor-like creatures), a sizable tail will be the only way to maintain balance (other than having an upright torso rotation gene and incurring a large energy cost in droop).
I’m hoping this system will be realistic enough to promote life-like body plans in place of a real-time physics system, which would be far too CPU intensive to implement across thousands of creatures. More likely, it will be exploited ruthlessly in ways I can’t yet imagine. But hey, that’s what makes it fun!
“Anime references. There goes the neigbourhood”
I played with the Rover UI while I working out exactly how I was going to apply the (now completed and working) torques to the creatures in a realistic fashion. This led to the following thought processes, presented in conversational format for readability and not because I pay heed to the voices in my head. Because I don’t. I am sane.
“I promised to do thing X with the rover AI for 0.7.0, but with the upgrades to the code it should be possible to make it do interesting things Y and Z as well. But there are a variety of sensible, practical reasons to leave those for a later version so I can get 0.7.0 out earlier. I would have to be completely insane to distract myself with additional feature creep at this point in time.”
“I make a very sensible point. Does the opposition wish to provide a counter argument?”
“Yes! Now! THIS IS A PERFECTLY RATIONAL AND SANE DECISION!”
So, umm… this (click for full size if you can’t read it):
In addition to the promised “creatures with genetic distance to” option, we’ve now got “trees with high/low stat”, (this should be helpful for encouraging reforestation), “Species” will be good for cladogram pruning (I’d also like to add a “plus descendants” option, since it’s hardly a proper genocide if the Rovers ignore branches of the species), and most importantly, “Population when total creature count is higher/lower than” will be great for controlling population explosions and preventing mass extinctions.
It’s already mostly implemented, so this hasn’t set me back too far.
You’ll also notice that the Rovers now have randomly-chosen names. This was another small, unplanned feature. It has absolutely no effect on gameplay, and some of the names are a bit silly, but overall I’m quite happy with the addition. It gives the game as a whole a tiny bit more personality than before.
- – – – -
“It gets harder to not talk to yourself when there’s so many of you.”
Hello my totally-not-expedible minions!
Finally feel like I’m getting somewhere with these torques, so I thought I’d share a bit of the
pain and frustration fun times!
I gave in and repurposed the debug text routine to draw the actual values of torques to the screen so I could debug them. I wasn’t sure whether the actual calculated values were wrong, or just the display arrows.
Turns out, both were: the calculated values were wrong, and the display arrows were not even reflecting them accurately. So I’ve stopped looking for a quick fix and am stepping through the code as best I can, fixing things as I go.
I think I’ve found the first major problem: it’s a bit hard to explain, so I’ll diagram it:
The short version is that in order to calculate torque I need to calculate both distance and magnitude perpendicular to the bone. If they were parallel, then there would be no torque and the bone would face compressive forces instead.
The problem is that by crossing the Force’s Normalised Magnitude Vector with the Bone Rotation, we introduce it’s *direction* into the equation. Then later on we calculate the Dot Product of that and the Forces full magnitude vector, multiplying it’s direction a second time and resulting in a torque going the wrong way.
If you’re by some miracle still following, then a) you have a better attention span than me and b) I’ll probably fix this by removing the final Dot product: just multiply cross2 by the force length and call it a day.
And then I can finally get to work on why the display arrows are crap.
* * * * *
PS: The Orbital EMP Cannon is down again. We sent an investigation party, and they reported that the living quarters are for some reason highly radioactive and not fit for human habitation. They also said something about millions of spiders before descending into incoherent and extremely uninformative screaming.
I’m sure they’re fine.
We’re now taking volunteers for the cleanup party. Biohazard suits and flamethrowers will be provided.