DEVLOG #10 THE EFFECT CHAIN

Hi all, Patrick on the engineering team here with a slightly more technical post!

When making games, a lot of effort goes into making tools for the developers, both so that gameplay can be implemented as quickly and easily as possible, and so that non-programmers can more easily make changes to the gameplay.

One big system we’ve been working on in Begone Beast is the effect chain system, which is our version of something similar to a behavior tree. We use this for our enemy behaviors, player abilities, and a number of other places.

Here’s an example of an effect chain for the behavior of some horde monsters:

Look at all those fancy boxes!

I’ve collapsed most of the steps for simplicity, but you can see the general behavior flow from the comments. Find a target, run away if we’re afraid, attack the target if we can, otherwise move toward them.

Though something like this could be done entirely in code, systems like this where functionality is implemented via a bunch of smaller building blocks are nice because it can be easier to understand what it’s doing at a glance for all of the developers, and bugs are often more self-contained. If there’s a bug in one of the building blocks, fixing it fixes the issue everywhere that building block is used! If we decide one of the building blocks should function differently, you can change it everywhere at once!

This loops for the entire time the horde monster exists, but other effect chains just happen once. For example, the actual attack in the above effect chain triggers another effect chain, which causes the monster to leap at the player and deal damage to them:

We can see what’s happening in the effect chain in real-time too, which is useful for debugging!

We’ve also been replacing some of our older abilities with effect chains. Abilities were originally separated out into many different files (for example, each passive trait had a separate file for both adding and removing it), which was sometimes useful for reusability, but was quite complex and made it difficult to tell what an ability was actually doing. Effect chains are much easier to browse through all at once!

On the left, an old ability. On the right, that same ability is recreated with an effect chain. Shiny!

Making useful tools is one of my favorite things to do, so I’ve been having a blast fleshing out this system. One of the big things that’s made it nicer to use is the headers. For example, take a look at this Move step:

That’s a lot of options! These steps didn’t use to have headers, so you’d need to look through this all to figure out what the step is doing. And when it’s just one step in a set of dozens, it can be difficult to figure out what’s going on.

Now, take a look at this Move step header!

One single line that tells you most of what you need to know about the step without expanding it! Much nicer.

Of course, it can still be hard to parse all this info at a glance, which is why you’ve seen comments underneath the header in many cases. Sometimes it’s easier to just write yourself a note for later.


I hope this has provided some insight into our development process! And as always:

Next
Next

DEVLOG #9 THE LEWTON BUS SYSTEM!