W.U. 8: Behaviour Trees

That screenshot right there means the fundamentals of my behaviour tree library is working.

As a side effect of me using unit tests, I made the code output a debug text of the whole tree when traversing.

This is all only the framework though. The next things to do are add more meaningful actions and conditions (like Retreat, Charge, Snipe, AmISurrounded, AmIDying, et al), and then make a visual editor for this.

Again, I’m storing the data in JSON format. Here’s an example:

{
    "__type": "BehaviourTree.Root, Assembly-CSharp",
    "Label": "Root",
    "Remarks": null,
    "InheritsFrom": null,
    "Children": [
        {
            "__type": "BehaviourTree.Selector, Assembly-CSharp",
            "Label": "Sel1",
            "Remarks": null,
            "Children": [
                {
                    "__type": "BehaviourTree.Sequence, Assembly-CSharp",
                    "Label": "Seq1",
                    "Remarks": null,
                    "Children": [
                        {
                            "__type": "TrueCondition, Assembly-CSharp",
                            "Label": "Scond1",
                            "Remarks": null,
                            "Children": null
                        },
                        {
                            "__type": "TrueAction, Assembly-CSharp",
                            "Label": "Sact1",
                            "Remarks": null,
                            "Children": null
                        }
                    ]
                },
                {
                    "__type": "BehaviourTree.Sequence, Assembly-CSharp",
                    "Label": "Seq2",
                    "Remarks": null,
                    "Children": [
                        {
                            "__type": "TrueCondition, Assembly-CSharp",
                            "Label": "Scond2",
                            "Remarks": null,
                            "Children": null
                        },
                        {
                            "__type": "TrueCondition, Assembly-CSharp",
                            "Label": "Scond3",
                            "Remarks": null,
                            "Children": null
                        },
                        {
                            "__type": "TrueAction, Assembly-CSharp",
                            "Label": "Sact2",
                            "Remarks": null,
                            "Children": null
                        }
                    ]
                }
            ]
        }
    ]
}

W.U. 6: Melee Damaging

Check the video. The attacks now damage units. You’ll see the dummy red box has its health reduced when taking hits.

Its not quite visible in the video but I’ve also added swoosh trails on the weapon when attacking. Continue reading

W.U. 2: Editing Game Data

This is weekly update number 2. That previous weekly update was just a bonus.

So I had been working on the data representation of melee attacks. I thought it was a good time to make a nice editor front-end for editing them:

This is the nice thing with Unity, you can extend the editor GUI yourself since it’s quite modular in showing data (i.e. components). That MeleeLimits is a ScriptableObject type of class.

What is that for? Its an idea I had in my old version of Tactics Ensemble. Continue reading