Sep 082015
 
twittergoogle_plusredditlinkedintumblrmail

A few weeks ago while testing the game, I had to face the fact the AI (the artificial intelligence driving the enemies) was simply not good enough. It had become extremely bloated in terms of code complexity and yet was not quite delivering the quality I wanted.

So I decided to redo the entire game’s AI system from scratch, this time using a different behavior-tree technique.

It was a scary decision as during a few days the game wasn’t even playable; first I had to unplug all the actors’ “brains” and then I started again, slowly building up their new behaviors, piece by piece. I knew exactly what I wanted so I was able to get to the point rather quickly. But this time while I worked I hid away all the models, the animation, etc… and only used capsules.

Capsules are simple shapes that roughly represent the volume and orientation of the actors. Here’s an example with Tilo as you’ve probably never seen him before: he’s turned into a mix of a minion, a fire hydrant and a cucumber! 😀

 

(On the video you can see the capsule changing color depending on whether or not it’s in contact with the ground)

The result of this huge endeavor is in the span of 2 weeks I was able to redo and greatly improve the AI that had taken me more than a year to get into a flimsy “mostly-working” state. Except this time it is much more robust and I know exactly WHY it works the way it does.

So although the decision to redo the AI was a frightening one it ended up paying off BIG time:

  • The AI asset I use is quite visual (it’s called “Node Canvas”), so I can see exactly what’s happening in real-time
  • I was able to get rid of hundreds (if not more) of lines of codes, making the maintenance and expansion on the system much more manageable
  • The capsule approach allowed me to focus on the behavior itself without animation clouding the potential issues
  • The AI is now far richer than it’s ever been before and allows for really neat tricks

Here’s a bird’s eye view of what a behavior tree looks like. All the branches light up and change colors according to their state (as you can see in the inset picture).

ScreenShot 2015_08_20 11;43;59001s1

I have also finally come around to implementing IKs for the actors. What this means is the character’s feet are now actually hugging the ground instead of remaining up in mid-air on a virtual flat-plane.

It wasn’t too difficult to implement thanks to a great asset I found called “Final IK”. Integrating the system into the game’s pipeline was painless and it yields very satisfying results! Here’s a quick test video:

 

(Don’t mind the red cube, it’s just a debug visual for the AI’s target position)

You’ll notice the Rat is really pushing on his legs as he climbs up the slope, contrasting a lot with Tilo who is a much lighter and nimbler character. Your speed (and the ability to sneak) is your main asset in the game; believe me, you don’t want to let these guys get their hands on you, especially without wearing any protections!!

Anyway, that concludes this update. I hope you liked it! Please don’t hesitate leaving your thoughts and questions below… :)

Apr 142014
 
twittergoogle_plusredditlinkedintumblrmail

Welcome everyone! As promised this update is going to focus on the game’s lore, an aspect which has mostly been kept under wraps until now. As you all know Ghost of a Tale takes place in a medieval world inhabited by animals, each species ruling over its own kingdom. And among those kingdoms the Rats are considered one of the most powerful species. Although creatures far more fearsome exist, it is a well-known fact that, through sheer force of numbers, the Rat Army is capable of defeating almost any foe.

Today some say the Rats’ influence is so wide and far-reaching that it is more empire than kingdom. The origin of the Rat’s powerful influence can be traced all the way back to the War of the Green Flame, many centuries ago, when the world was teetering on the edge of the Bright Abyss.

Fresco

No one remembers where the Green Flame appeared first. A force without conscience or thought, it killed and consumed all those standing in its path. The fallen would then grow the ranks of its army, becoming soulless puppets of the necromantic power. The great battle has passed into myth and legend now – but some facts are indisputable: the mighty Badgers of Baladhon fought and lost and even the Hawks of Halenvir fell from the sky. None of them could turn back the foul invasion.

When the news of the advancing army of the Green Flame reached the capital of each kingdom there was much debate. Some believed the Green Flame could be subjugated, used as a source of power. For others it was capable of nothing but death and decay. These quarrels took far too much time to resolve and when the Council of Asper finally stood together at last to face the Green Flame it was all but too late.

The Mice, fearing the end of their kind, attempted to send an emissary to negotiate surrender in exchange for revealing weaknesses in fortresses they had helped to design. Their actions were rightly perceived as a betrayal by the other creatures and the Green Flame laid waste to the mouse kingdom all the same.

It was then that the Rats took matters into their own hands. King Rodgar-the-First, seconded by his general Jahrlan (whom some say was the war’s true hero), led his soldiers into battle against the Green Flame’s army. There the Rats made their stand, single-handedly defeating the greatest threat the world had ever faced. Jahrlan did not survive the battle, but had he done so he would have had a chance of becoming king himself.

After the war most of the mouse lands were annexed, and Mice were never again allowed to bear arms. Nor did they ever formally regain the right to sit on the Council of Asper. There are some who say enough time has passed and that Mice should not today have to bear responsibility for their ancestor’s actions. But Rats are not known for their forgiveness.

It is interesting to note that the only trace of what might truly have happened in those long-forgotten days can be found in the oral tradition of the Myghlar Magpies, the Truth Sayers, who now inhabit the ancient tower of Periclave. To this day they scour the kingdoms, bartering in the only currency they respect: stories – facts, mostly, but also legends and songs. Yet even in their account of the War of the Green Flame one can find only glimmers of truth – the mere ghost of a tale.

One could also wonder where Tilo, the humble minstrel mouse, fits in History’s grand tapestry. After all he is merely a tiny stitch made with a single thread. But it only takes a snag in a single thread for the whole tapestry to unravel. And Tilo’s own story will be the subject of an upcoming update… :)