0.12.0.2 Experimental

Still too buggy for stable release, but we’re getting closer! (Which isn’t to say that it’s less buggy than 0.11.2.5, I’ve actually fixed a lot. It’s differently buggy)

Changelog:

* Adjusted balance calculations to be significantly more realistic
* Adjusted childhood to ‘pull’ a consistent amount of energy each frame, and childhood length to depend on total energy spent (rather than pulling a variable amount depending on childhood length).
– This will fix the problem with food energy flickering up and down.

* Increased ‘base’ stamina amount (to make adulthood easier).
* Increased childhood cost of primitive organisms (will make childhood longer)

* Fixed a bug registering live creatures as “inedible” and preventing hunting
* Fixed a bug making scavenging meat significantly rarer
* Fixed an issue with empathy cost being applied to creatures outside the predators species (which stacked with the first issue to prevent hunting).
* Fixed bug preventing brain report (eg. “Hunger >> Graze”) from appearing in UI.
* Fixed crash when reviving creatures
* Fixed crash when using any god tool with both creatures and corpses selected
* Fixed potential crash when mating/gene splicing.
* Fixed a bug causing the skybox to render at half resolution and show distant mountains on the ‘ocean’ maps, which was never intended.

* Zoomed the camera in to show creatures at a better scale in the clade diagram/satellite map/gene editor
* Displayed balance forces in the gene editor when “Draw Bones” is selected.
* Activated the nursery UI when the first creature is dropped in, to better help players understand how it’s supposed to work.
* Adjusted camera movement to be slightly less floaty

Advertisements

Leave a comment

0.12.0.1 Experimental Build

Now available on the Steam experimental branch.

Changes:

* Gene Editor now includes a “Draw Bones” option, allowing you to visualize the skeletal physics that govern creatures body plans.
* Made dragging torso bones along the ground cost more in walk speed
* Increased cost of balance problems
* Reduced cost of compressive stress problems
* Caused Pregnancy Length to double after each litter
* Adjusted growth cost gradient to be more costly for simple creatures and less costly for complex ones

* Fixed bug preventing gene splice from working
* Fixed bug preventing corpses from being revived
* Fixed bug preventing corpses from showing up on the Sat Map
* Fixed visual bug showing the creature total as “CAPPED” indefinitely, despite the population dropping off

Leave a comment

Species 0.12.0 Experimental Release

Early adopters rejoice! I’ve just put Species 0.12.0, the Multithreading Update, up on the Experimental Beta Branch on Steam!

0.12.0 adds multithreading to the underlying game engine, significantly increasing the performance (and Creature Count) of the game on computers with Dual-Core, Quad-Core, Octo-Core or Septendec-Core CPU’s.

Please note that this is an Experimental Build. It is likely to be less stable and less performant (though still more performant than 0.11!) than the version that will be soon released to all Steam users.

You can access the Beta branch by right-clicking on “Species: Artificial Life, Real Evolution”, selecting “Properties”, then opening the “Betas” branch and selecting “experimental – Unstable Experimental Builds” from the drop down.

OptIn

At the moment, 0.12.0 adds no features or tweaks: it’s the same game, but faster. In addition to the obvious stability work, I will be polishing it in the coming weeks to make the survival strategies and body plans more varied and interesting, as well as see if I can make carnivory more viable.

Leave a comment

Multithreading Report

In the currently released version of species, I can handle about 1100 creatures with an average FPS of 12.

BeforeMultithreading

In the current 0.12.0 Multithreading prototype, I’m getting more than twice that. 2600 creatures with the same average FPS.

AfterMultithreading

I think we can call this a success. 😀

 

There’s still a few bugs specific to the multithreading implementation, but they’re limited in scope and I’m pretty sure I can see the path ahead, so I’m happy to say that, barring any ‘incidents’ between now and then…

0.12.0 (Experimental) will be released to a Steam Beta Branch within the week.

Once that happens I will begin a stability pass to fix all of the crashings forever prior to 0.12.0’s official release. (Okay fine, most of the crashings forever. Gotta be realistic here).

 

Cheers,

Qu

1 Comment

3 Months on Steam! Past, Present and Future

The Ghosts of Species Christmas appeared to me to demand I reflect upon my misdeeds. Unfortunately, I was otherwise occupied, so I’ve been procrastinating on that ever since. But I’m getting a bit sick of the chain noises and the spooky jerk popping up through the floor when I’m not expecting it (I swear he’s doing it on purpose), so let’s take a look!

 

Ghost of Species Updates

Species has been on Steam for more than 3 months now, and I’m still not crushing the world in an iron fist. Slightly disappointing, but I’m willing to call it progress! The game’s gotten a lot of feedback and I’ve made a lot of changes since October…

  • Performance Improvements – It’s hard to quantify exactly, but I’ve made some significant optimizations to the game since launch. I may have also murdered empathy in the process, but it’s safe to say Species now can handle far more abominations of nature than it could at launch.
  • Stability – Oh my goodness yes. So many bugfixes. I’ve learned my lesson: in the future, major updates will be released on a beta branch for play-testers and early adopters.
  • Mac and Linux Support – the game actually runs on Mac and Linux now! This is a big deal for me: I always knew I wanted Mac and Linux support, but actually trying to implement it intimidated the heck out of me. So glad I did!
  • Underwater Ecosystems – Aquatic life is now nicely balanced with land-borne life, and both are viable niches for creatures to occupy.
  • Graphics – Underwater worlds in particular look a lot prettier than they did with improved fog, lighting and most importantly bubbles. If I may take a moment to brag, the new sedimentary layers in the cliffs also look pretty awesome.
  • Animation – Creatures body parts are now screwed on properly and spend a lot less time waving in the air like they just don’t care.
  • Anti-cannibalism Measures – I may have screwed over the poor carnivores with this one, but they were cannibals. They deserved it.
  • Over-hunting Suppression – But then they took revenge on the prey species! I had to do it! I had to kill them all! I’M A MONSTER OF CIRCUMSTANCE!
  • “Niches” Automatic Population Control – designed to encourage creatures to continually adapt to new food sources rather than adopting a single strategy and relying on it forever.
  • And so many tiny improvements to the simulation it’d be difficult to list them all here. Let’s just say, I’m satisfied that Species is a better game now than it’s ever been.

 

Okay? Okay! We’re done here. Take your chains, and…

… wait, two more ghosts? Seriously? Urgh. Fine. Let’s get this over with…

 

Ghost of Species Multithreading…

What? I’m working on it. It’s multithreading, it’s not exactly a photogenic topic, y’know? What, am I supposed to write a thousand word essay on race conditions? Nobody wants to read… oh, huh. Yeah I suppose I could share the prototype. That’s… actually a good idea.

 

One of the things that helps a lot when implementing big terrifying systems that you’ve never built before is to prototype them on a small scale. It allows you to learn where the bottomless pitfalls with spikes at the bottom are by face-planting into them in a safe environment (We put these little nerf balls on top of the spikes).

Multithreading falls into the category of “big terrifying systems that I’ve never built before”, so I made a little particle physics simulator to feel out the path ahead:

singlethreadedbenchmark

Singlethreaded. CPU Utilization: 22%. Frames Per Second: 11.

And then, long story short, I implemented the system I intend to use for multithreading. The results are… promising.

multithreadedbenchmark

Multithreaded. CPU Utilization: 100%. Frames Per Second: 125.

Yyyyup.

Of course, this is just a particle physics system, not a full game. Current results are not indicative of future performance, and all that. But nonetheless, “yyyyyuuuup”. I’m very much looking forward to getting multithreading working in 0.12.0.

If you want to try the multithreading prototype out, you can download it here:

http://www.speciesgame.com/Downloads/Multithreading Prototype.rar

(Generic disclaimer: The multithreading prototype executable is provided as-is, and is run at the users own risk)

BTW, stay tuned to this blog for the thousand-word essay about race conditions I’ve got planned.

 

Ghost of Species Roadmap…

So you’re the last ghost. So what’s your deal? Do you just stand there in a hood, looking ominous?

 

Last time I posted this, I did so without comment.

SpeciesRoadmap

Let’s rectify that!

The indigo oval in the middle encompasses 0.11.0 and 0.12.0’s features: past and present respectively. Everything else is future.

Generally speaking, features closer to the center of the image will be implemented sooner than those out by the edge. If you can draw a direct line between 0.12.0 and the feature, it’s probably not too far off. The exception to this is the violet “modding” bubble in the top right, which is standalone and could happen at any time.

Lines represent relationships between features, usually of a “prerequisite” nature. For instance, flight is useless without perches, which can’t be added until the tree’s are overhauled. You can follow the lines to get a literal road-map from a possible 0.13.0 feature to one in the distant, post-apocalyptic future. (I realise I’m just assuming the apocalypse’ll happen here, but it seems a fair bet at this point)

The ovals around the features are colour-coded:

  • Cyan – Gameplay. These features are centered around establishing an interesting game-play loop and a science-inspired progression system, wherein you unlock features in the game by observing and experimenting with the simulation.
    • The closest feature here is ‘Sampling’, where you utilize the rovers to “sample” creatures and build a library of body parts for… later use. Oh lordy what did I just type.
  • Green – World. Improvements to the world, mostly from a ‘simulation’ standpoint.
    • The features I’m looking at here are seasonal cycles and a map editor. Admittedly, mostly for my own edification, but I know at least a few people are interested in the latter.
  • Yellow – Creatures.  Mechanical, graphical and animation improvements to the creatures themselves.
    • These are incredibly important, but as you can see on the map most of them are gated behind other features. Most notably, I want to get working on the Phenotype Editor, a “spore-like” graphical creature editor (distinct from the numbers-based gene editor). This will come in handy for previewing and iterating on creature improvements.
  • Red – Creature Interactions. Social and combat behaviors and balance improvements. By far the most important of these is making carnivory and hunting viable in the long term, but that’s also going to be an incremental process over the course of several updates. Calls and social behaviours, such as herd defense and pack hunting, are also high on my priority list.
  • Indigo – Mod support. This is planned. I tend to think simulation games live or die on the strength of their modding community, so this is definitely planned.
  • Violet – Multiplayer. Extremely long term goals. I’ll probably try networking in another context before I attempt to introduce it to Species: I have experience with the subject, but not as much as I’d like.

 

Mmm hmm. It’s a grave. With my name on it. And… the dirt’s shifting? Sweet, you mean that immortality ritual actually worked? And here I thought it was a scam. Best $20 I ever spent.

Alright, thanks for… whatever this was. I guess?

I’m going to bed and if the ghosts aren’t gone by tomorrow morning I’m going to start to researching how to build real-life proton packs. Bye!

 

Cheers!
Quasar

Leave a comment

Refactoring BodyPlan

I’m don’t have too much to say about my multithreading work just yet (aside from “it’s coming along, and early results are promising”), so instead let’s talk about a long-overdue task I undertook at the start of work for 0.12.0. It’s not directly related to multithreading, but it’s related to things that are related to multithreading, so it’ll provide a foundation for future blog posts.

Creature in Species are built out of a series of sub-objects, the biggest of which are the following five:

Creature
{
    Genome //Contains Genetic Stats
    BodyPlan //Contains Skeletal Physics and Drawable Body Parts
    Phenotype //Contains Derived-At-Birth Stats (things like speed, attack damage, etc)
    Specimen //Contains always-up-to-date State Information (Health/Food/Etc)
    Brain //Contains the creatures AI State
}

One of these things is not like the others, one of these things just doesn’t belong…

… and that thing is BodyPlan. I mean, obviously. It’s right there in the title of the blog post. I’m not exactly being coy about it here.

BodyPlan handles two responsibilities: generating and applying the skeletal physics, and drawing the creature’s body parts to the screen. The reason it was originally built this way is because these things are superficially related: I take the skeleton shape from the drawable art assets, and the art assets are rotated by droop and balance effects when I draw the creature.

But let’s embarrass ourselves trying to justify it. This is bad. This is really bad. To be gratuitously technical for a moment: under the SOLID principles of Object Oriented Programming, this is a severe violation of the first rule: the Single Responsibility Principle.

The Single Responsibility Principle dictates… well, exactly what you’d expect it to dictate based on that name. A class should have one responsibility. BodyPlan has two. Ergo propter hoc, Quasar is a dumbass.

This is important because those rules exist for reason: by violating the SRP, I’ve coupled drawing and animating limbs, heads and other body parts to the skeletal physics. Let’s say I wanted to draw heads or tails separate from a creature, as part of a creature editor or mutation map viewer: I can’t do that. At least, not without also creating some sort of temporary skeletal data for them.

The same also applies in reverse: I need to provide drawable assets like the body cover texture and colour to make the skeleton. This is less of an issue because there’s not too many places where I’m going to want a disembodied skeleton walking around (they fall apart too easily to use as soldiers and they’re too dumb to be servants), but still. It’s the principle of the thing. I might not want disembodied skeletons, but I’d object if someone tried to take away my right to have disembodied skeletons.

So this needed fixing and since I was already waist deep in refactoring everything else for multithreading, I figured I might as well address it. I’ve been splitting “BodyPlan” into “DrawableBodyPlan” and “SkeletalBodyPlan” (which I’ll probably rename simply to “Body” and “Skeleton” for the sake of being concise).

This is the only change I’ve made for 0.12.0 not directly related to multithreading: everything else from here on out will be in service of smearing the game across multiple cores like some sort of weird inedible Vegemite.

Cheers,
Quasar



My plan was to make a joke about Vegemite, but I’m like 70% sure that would be grounds for having my Australian citizenship revoked.

4 Comments

Where to Next – Multithreading 0.12.0

Updates will be slowing down for a while as I work on multithreading for 0.12.0. This is a big and promising feature, but also a dangerous one. It’s kind of like summoning an eldritch god: you might get immortality, or your life force might be consumed to power a terrible murder portal through which demons can invade the earth.

(it’s important to make your analogies relatable)

The number one complaint on Steam is performance. And I get it. Species gets more interesting with more creatures. If you’ve got a supercomputer with a trillion cores that cost you as much as the first three Apollo missions, you’re probably going to resent it if it can’t run Species better than a machine somebody got in a garage sale for 5 bucks and may actually be a microwave. Unfortunately, there’s a good possibility it won’t because CPU core speed hasn’t significantly increased in the last decade.

Performance is not the reason I’m looking at multithreading, however.

This is how the game is currently built, using a bit of sample data taken from a quick P. specium simulation:

iBOlH1i

As you can see, each frame time is given primarily to creature AI, specifically to the method called “UpdateBehaviourals” (that big red chunk of CPU time in the middle of each frame).

Logically, then, that’s the method I should extract and put into another thread, so it can run in parallel to the other operations.

mOcjZmQ

This would be the “simple” (not actually simple) way of implementing multithreading.

And to be fair, a potential 30% performance improvement (assuming ideal conditions) isn’t to be sneezed at. But to be frank, it’s not enough to justify how much development time and risk multithreading the update call introduces.

But most modern CPU’s have more than two cores, and there’s still a big chunk of time on the main thread going unused (that blue block in the picture labelled “await”), which means we’re not done. What if we could *split* the “UpdateBehaviourals” method across multiple cores, by updating some of the creatures on one, some on another, and so on?

NXJ2ELH

That’s a lot better: a whopping 70% improvement! (assuming ideal conditions and that this sample data is representative).

But even more importantly, from my perspective at least, the blue ‘await’ blocks are now on the other threads.We have spare CPU cycles, not on the main thread, but on the threads doing the AI.

This is the real reason I want multithreading in 0.12.0. I still have features I want to add, specifically to Creature AI.Creatures need to be able to rationally decide what movement method to use to reach a target, which requires increased situational awareness.Predators need to be able to find food from further afield, so they can travel to more habitable areas from across the map rather than just dying off once all the prey in their area are gone.Social creatures need to communicate with one another and factor those communications into their decision-making process. And each of those features will have an associated CPU cost, which I simply can’t afford at the moment.

But if I can properly parallelize the creatures “UpdateBehaviourals” routine…that is, not just offload it to another core, but offload portions of it onto all the other cores… then I’ll get a significant amount of spare CPU cycles to work with, and I’ll be able to implement those features without worrying about them impacting performance at all!

Of course, this is even harder to implement than the aforementioned “simple” option, which itself is nothing of the sort. But I’ll have plenty of time and incentive to whinge about those problems soon enough.

For now, let’s leave it on a optimistic note: if this works performance will scale with the number of cores you have.* More cores = higher creature cap!

Cheers,
Quasar

 

* (assuming ideal conditions and that the sample data is representative and that the earth hasn’t been invaded by demons pouring from a terrible murder portal)

1 Comment