The ground cover/grazing system in Species 0.9.0 is a mess, but an interesting mess. It has a lot of strange little redundancies and quirks simply to remain functional. Much like myself, them. I feel a sense of kinship with it.
And so it must die. But let’s talk about it first.
In 0.9.0, when a creature decides to graze, they will always target a point either 200cm or 400cm away from themselves. This completely arbitrary distance makes up for a quirk of the cost-benefit analysis that creatures perform when deciding what to eat: a food source they are already standing on has no cost associated with walking to it. By making them move a distance before grazing, we increase the chances of browsing trees and scavenging corpses, as well as making grazing a slightly more interesting a behaviour.
The point they pick will be the highest ‘value’ point at that distance from them, which prevents them from grazing on desert grass if there’s green grass behind them.
They will then move to that location and begin the graze routine. While grazing, they gradually gain food while emitting a negative fertility aura around themselves. In theory, the negative aura should eventually exhaust the area and force them to seek out new food, preventing them from becoming a completely sessile organism.
This generally works, but the fertility-effect provided by fresh-water in 0.9.0 is extremely strong. In the right place on a ‘lake’ or ‘oasis’ map, a grazer can theoretically remain sessile their entire life.
This quirk, incidentally, is because of the way the underwater biomes work. The water in 0.9.0 is a transparent, blue plane, but the terrain below it isn’t actually tinted blue by water fog or lighting effects. The textures themselves are blue for underwater biomes in order to give the impression of depth. Unfortunately, those textures look really strange if they are uncovered, so a strong fertility-effect forces them to only appear underwater and to rapidly recede when the water does.
Obviously, 0.10.0’s water fog and lighting effects completely negate this need: I’ve changed the underwater biome textures to more generic rock/sand textures, so they won’t be unsightly when uncovered. That in turn free’s us to use a much less powerful fertility effect, which means groundcover re-growth rates on watery maps will be much more in line with what you see on landlocked ones.
Back to sessile grazers.
In order to prevent sessility and to keep creatures moving about, I implemented a time limit to grazing. After a certain number of seconds have passed, a grazer will automatically reconsider their options. If they’re still hungry, they’ll reactivate the grazing routine… and pick a location 200cm or 400cm away from their current one to graze from.
This utterly arbitrary system works… okay, I guess? Better than it has any right to. But frankly, it’s a hack job, a Frankenstein monster of code, and I’ve never been happy with it.
The energy from grazing is extremely inconsistent: a savanna area might provide X calories before being exhausted, or it might never be exhausted due to regrowth if it’s near water or being stabilised by trees. The scale of the aura further increases the inconsistency and general wishy-washyness of grazing. It’s all-but impossible to tell how much grazing ‘energy’ a creature will be able to extract from an area.
So for 0.10.0, this has been completely reworked. Both the arbitrary distance and arbitrary time limit have been removed, and instead of an aura, creatures treat the individual pixels of the ground cover map as food sources.
Each pixel is effectively an extremely low-yield tree.
When a creature eats a pixel, the ground cover instantly reverts to 0 fertility, converting it into the ‘wasteland’ biome. Grazers will need to stay on the move in order to get enough energy from grass, and will leave a trail of consumed ground cover behind them. Large numbers of grazers will still have the ability to turn an area into a wasteland, but it will be the result of lots of small, sharp bites out of the ground cover rather than the large, gentle ‘aura’ bites they were taking before.
For the moment, the ‘scanning’ behaviour prevents super-fast creatures from abusing this mechanic and scything their way across the landscape, absorbing every square of grass along the way. After eating a pixel, creatures re-analyse their needs and environment in order to decide what to do next, and I put them in idle for a second and make them look left and right when they do that. For the moment that’s okay, but I’m thinking of changing it from “scanning” to “chewing” and giving it a variable duration based on head type.
The end result of all is that the energy a creature gains from grazing a pixel is a measurable, quantifiable amount, based on the biome of that pixel, and open to the same optimality calculations as trees and corpses.
It’s also an acknowledgement of the simulations artificiality. You probably noticed the grid overlay in the above screenshots: we’ll be keeping that in 0.10.0. When your mouse is over a ground pixel, (as opposed to a creature or tree), you will be able to see it, as well as it’s energy content (either as a green mini-bar or as a number somewhere on the screen).
In real life, of course, grass isn’t broken up into tiles like this. The system we’ve got in 0.9.0 actually goes to great lengths to blur the grid and hide it’s existence from the user.
But Species isn’t real life, and I’ve come to the conclusion that acknowledging the artificiality of it’s world isn’t a bad thing, especially if it allows me to improve the mechanics upon which the simulation is based.
Besides which, it’s in the tagline. “Artificial Life, Real Evolution.”
Don’t worry though, I’m not about to go all abstract and matrixy on you. Within the context of the game, the game world is the real world, not a simulation. Ground pixels notwithstanding.