Spellcasting AI with behaviour trees

This was my first Ludum Dare and I had lots of fun! My part was developing the gameplay systems and AI for our rune spell casting game Glyphs of Madness. It was a great experience, even if we did not have time to implement and polish all features.

GameScreen.png

For the AI, @sebwod came up with themes and rules for each enemy’s spellcasting. For example “Everseer” (the first enemy), is using fire-based spells. At first, he only casts two attack spells. But once his health gets lower, he will start using buffs and a more powerful attack. EnemyDesign.PNG

We chose behaviour trees to transform these designs into code. This allowed us to break complex rules and cast sequences into smaller, reusable conditions and tasks. Due to time constraints, we only managed to implement proper AI for the first two enemies. The other enemies ended up with a backup behaviour tree consisting of only two actions: “wait for cooldown” and “cast random available spell”. Shoutout to Ashblue for his fluid behaviour tree package for Unity! The visualisation was very helpful when enemies were casting the wrong spells or none at all :smile: BT.PNG

Feel free to check out the game and beat the AI :wink:

https://ldjam.com/events/ludum-dare/48/into-the-tome-of-glyphs

Web build is available here: https://glyphsofmadness.genemachine.studio/rom/ (Press F11 for fullscreen). Only development build for now because Unity didn't feel like building a working release build.