W.U. 14: Behaviour Tree Editor Update

Sorry for the voice and volume, this was done in a hurry. I’m really busy.

Here I demonstrate how my Behaviour Tree Editor works so far.

If you don’t know what that is, basically, it’s what powers the A.I. system. Here I have a tool to make these A.I. systems and tweak them while playing the game.

I got some updates on it, and I may release it as open-source if anyone wants.

So far, the editor can now be used to edit the properties of actions and conditions (even while the game is running), drag nodes around, and load/save Behaviour Tree files. Files are saved in JSON format.

I was surprised and annoyed there was no ready made free code to draw a color picker dialog box in runtime for Unity, so I made one. But it was surprisingly easy, thanks to the HSBColor code in the Unity wiki site. I can also release it in open-source if anyone wants.

Also quite nice is the file dialog box code in ImprovedFileBrowser. If anyone is looking into making a runtime file dialog box, that’s a good place to start.

W.U. XIII: The Missing Weekly Updates

I am currently loaded with work so I wasn’t able to update the past week or so.

Instead I stole some time those weeks to do some art to de-stress.

Still not sure if I did her properly. Any younger and that would have been questionable. Nevertheless, she turned out close to what we’ve planned for her.

This is my current favourite. It was supposed to be “Witch Knight” but Kingdoms of Amalur beat me to it. Since they’re witches, I wonder if they should be female? Hmmm.

I tried making a “Dragurian Heavy” soldier. I don’t like how it turned out though.

Obviously needs work with the symmetry. Kudos to Stan Prokopenko for the tutorials!

I was not confident that I could draw Serin properly, and I certainly still think this is not good enough. Its like trying to draw a fleeting beauty.

As an aside, I’ve put up an Indie DB page in the hopes of getting more feedback. Hopefully some developers and gamers would chime in and say what they think.

As for programming, I’ve been slowly picking back up on it. Right now I’m making an editor for the behaviour trees. Its turning out to be really difficult because of the way GUI is made in Unity.

W.U. 12: Victory/Defeat Conditions

I was tackling on implementing the checking of victory/defeat conditions to check if the player won already or not, and I realized, “Why not use behaviour trees for this?” Is this really going to help, or is it a case of “when you have a shiny new hammer, everything looks like a nail”?

What I have are these so far:

Types of Victory Conditions:

  1. All enemies defeated
  2. Kill certain units
  3. Survive for N turns
  4. Default: Only player left who is not defeated

Types of Defeat Conditions:

  1. All my units defeated
  2. Certain units of mine are dead
  3. N number of turns passed
  4. A (non-ally) player is victorious

(There’s a lot of redundancy there, like “all enemies defeated” would also trigger “all my units defeated” for the opposing player, but for cases where there are more than two players, defeat of one player won’t automatically mean victory because there would be at least two players left.)

Usually there’d be a list of victory conditions and another list for defeat conditions, for each player.

The question is, does triggering at least only one condition in the list constitute an automatic victory (for that player), or do you need all conditions in the list to trigger true to mean victory? Basically, are the conditions in the list strung together in an AND operation or an OR operation?

And the answer is, it depends on each mission the designer creates. So why not allow the designer the flexibility to specify how he wants it? And with my goal of allowing mods, this does need to be flexible.

So I was thinking, why not structure it as a behaviour tree? One behaviour tree for checking victory, and another for checking defeat. And each player will have one of those pairs (there shouldn’t be only one meant for all players since the AI can have different victory conditions than the human player, for example).

So there it is. Right now it’s just a simple message saying “YOU WON” or “YOU LOST”.