I’ve started my work with Genome and integrating it with Wild animals. Most of this work is contained in the new module WildAnimalsGenome. This is what it looks like finally -

A new genetic algorithm

In the interest of gameplay and to incentivize breeding, a new breeding algorithm was though of. I called it Favourable weighted breeding algorithm for lack of a better name. The offspring has a higher chance (weighted) of inheriting the better trait (favourable) from its parents.

There were a few hiccups in keeping the entire implementation within the Genome module, since the favourable trait is decided depending on the context and the Genome module would not have any information about this. To solve this, the content module must encode the properties into the gene in a specific way which allows Genome to deduce the favourable trait.

Baby deer

The first step was to add a baby deer to the WildAnimals repository. A baby deer is essentially just a regular deer scaled to 0.5 times. This is done by modifying the scale variable in the SkeletalMeshComponent -

"skeletalmesh": {
    "mesh": "deer",
    "heightOffset": -1.6,
    "material": "deerSkin",
    "animation": "deerIdle",
    "loop": true,
    "scale": [
      0.5,
      0.5,
      0.5
     ]
   }

The heightOffset parameter also needs to be appropriately modified so that the deer doesn’t float in the air.

Mating interaction screen

I made an interaction screen which only contains a “Activate Mating” button for now.

Clicking the button activates searching for potential mates nearby within a specified search radius.

Proposal request and response system

I modelled the mating system somewhat like real life :wink:. When an animal finds a potential mate, it sends a ProposalRequest event. The potential mate receives this event and sends a ProposalResponse event either agreeing or refusing. If both the animals accept, their mating behavior is triggered and a new animal is born.

This was done to handle multiple potential mates close-by and avoid race conditions.

Mating behavior

Terasology uses Behavior Trees for defining behaviors that can be applied to entities.

Behavior Trees
A behavior tree is used to define behavior for an entity. It consists of various nodes that are executed in a specific order and return SUCCESS or FAILURE after completion depending on their outcome. Here are some of the nodes in the Pathfinding module. This forum post and youtube video would really give you a feel for behavior trees.

Wild animals already had some basic behaviors defined such as “stray” and “flee”. This blog post does a good job of covering those.

I added a “mate” behavior which basically triggers the two animals to select a random spot nearby and go there, after which a baby is born. This is the behavior tree I made -

It is pretty intuitive as most of it’s sequential; the left subtree checks and sets a mating target block and the GoTo node makes the animal go to the target selected.

In other news, my college has reopened and I’m not getting much time for GSoC or anything else either, for that matter. However, according to plan I was able to complete most of my work already. The rest of the work can be stretched out over the remaining month.