Entity Query Language

Posted by admin on May 23, 2015

We've now merged the work Yaroslav Taben did last summer on a new entity filtering system. For a lack of better name we're calling it the Entity Query Language.

Why is this needed?

A lot of the AI code in Cyphesis deals with selecting and acting on entities. Consider a "Flee" goal for example. This should be used by weak creatures to flee from dangerous creatures. As soon as a dangerous creature comes within range the creature to which the goal belongs to should turn tail and elope.

But how do we determine what constitutes a "dangerous creature"?

This is where the EQL comes in. As most other query languages it allows you to select a subset of a set of entities, given a number of criteria. The syntax is a bit similar to other query languages such as SQL. For our case we might want to avoid bears. The EQL then becomes

entity.type = types.bear

This would return a positive match for all bears. However, perhaps we only want to avoid those bears that have a mass of at least 50Kg? We'll add another restriction

entity.type = types.bear && entity.mass >= 50

There are of course other dangerous animals. We also want to avoid wolves. These are more aggressive, so we don't want to check their mass

(entity.type = types.bear && entity.mass >= 50) || (entity.type = types.wolf)

In this way we can create more and more complex rules for how the AI will interact with the surrounding. The query code is now pushed to Cyphesis master and most existing goals are being converted to start using it.

10 Comments Read full post »

Google Summer of Code 2014 results

Posted by admin on August 24, 2014

During the summer three students have worked on Worldforge as part of Google Summer of Code. With this year's program now coming to a close we would like to highlight these three students and the work they've done.

Céline Noël, Smartbody integration in Ember

Céline has been working on integrating the Smartbody system into Ember. Smartbody is a comprehensive system for simulating human behaviour, with all of the subtle body movements that natural motion entails.

Since Smartbody is such a large system, and deals with so many different facets of human motion, a large part of the work done by Céline involved integration with Ember on the code level. Once this was done further work was done with modifying the Ember structure so that human entities use Smartbody for their underlying animations and movement.

The work can be seen on Github. It's not merged into Ember master proper yet as there are some outstanding issues, but will be during the coming months.

Péter Szücs, Android support for Ember

Péter has been working on adding support for Android to Ember. This work has mainly involved getting the whole Worldforge stack to build for Android, and then adding support for multi touch to Ember.

The main difficulty initially was getting the Worldforge stack to build for Android, using the existing Autoconf build system. Péter has done changes to most of the Worldforge libraries, as well as to the Hammer build tool. The Hammer build tool now has built in support for cross platform builds, and will setup an Android toolchain by itself.

We're not yet where we can provide Android builds of Ember, but expect this to happen during the nearest months. Keep an eye on this space for more announcements ragarding Android support. The coming weeks we'll start moving Péter's work into the main repositories.

Yaroslav Taben, Cyphesis Entity filters

Yaroslav has been working on adding entity filtering to Cyphesis. This project is a little harder to explain for someone who haven't worked with Cyphesis, but it can basically be described as "functional filtering of entities using a query language". This is very useful for things like the AI code, since world authors then can more easily write rules for entity behaviour using a query like language.

The areas where Yaroslav mainly worked were both with defining the rules for the query language, and implementing this in an efficient way in the code. We used a iterative process for the language definition, where we during the summer tried out various syntaxes until we found one that fit our specific use case better.

The code can be seen on Github and we plan to start integrating it into Cyphesis within the coming weeks.


All of the students worked hard during the summer, and produced excellent results. As before we're very happy with the program, and would like to thank Google for providing us with this opportunity.

0 Comments Read full post »

New web site!

Posted by admin on August 17, 2014

The new Worldforge site is now finally online!

As you probably can see, since you're reading this post, we now have a shiny new web site. The old one was creaking at the seams, and had been for a couple of years. The new one runs on Concrete5, a very competent CMS system. We'll try to keep the amount of pages down, as not to incur a maintenance debt. We'll probably also be updating the site the nearest couple of days.

0 Comments Read full post »

Pathfinding in Ember

Posted by admin on June 15, 2014

I've recently done some work on adding proper pathfinding to Worldforge. For this I've chosen the Recast/Detour library. While this approach, using voxel rendering to create navmeshes from arbitrary geometry, is both complex and resource expensive, I'm convinced it's absolutely required to allow us to properly support the dynamic and changing worlds in Worldforge.

I've done the initial implementation in Ember, mainly because it's easier to visually debug. But the main benefit will come from integrating this work into Cyphesis, so that it can control AI movement.
This is an area sorely in need of improvement. See, currently there's no path finding or obstacle avoidance at all for the AI characters. The result of this is that NPC characters always move in a straight line towards their target, causing them to inevitable become stuck on other entities. No good. No good.


With proper path finding and obstacle avoidance we can instead implement more advanced AI behaviour.

0 Comments Read full post »

Navigation preview

Posted by admin on April 9, 2014

Here's a short preview of the work I've been doing the last couple of days. I'm using Recast/Detour to implement proper navigation in Worldforge, first in Ember and then in Cyphesis.




0 Comments Read full post »