{"author_link":"\/users\/heremeus","author_name":"Heremeus","author_uid":"heremeus","comments":[],"epoch":1619554843,"event":"LD48","format":"md","ldjam_node_id":254079,"likes":4,"metadata":{"p_key":"156390","p_author":"Heremeus","p_authorkey":"1244482","p_urlkey":"376637","p_title":"Spellcasting AI with behaviour trees","p_cat":"LDJam ","p_event":"LD48","p_time":"1619554843","p_likes":"4","p_comments":"0","p_status":"WAYBACK","us_key":"1244482","us_name":"Heremeus","us_username":"heremeus","event_start":"1619222400","event_key":"109","event_name":"Ludum Dare 48"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD48","removed_author":false},"_superparent":233335,"_trust":1,"author":244482,"body":"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](https:\/\/ldjam.com\/events\/ludum-dare\/48\/into-the-tome-of-glyphs). It was a great experience, even if we did not have time to implement and polish all features.\n\n![GameScreen.png](\/\/\/raw\/20b\/b3\/z\/40e58.png)\n\nFor the AI, @sebwod came up with themes and rules for each enemy\u2019s spellcasting. For example \u201cEverseer\u201d (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.\n![EnemyDesign.PNG](\/\/\/raw\/20b\/b3\/z\/40e4b.png)\n\nWe 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: \u201cwait for cooldown\u201d and \u201ccast random available spell\u201d. Shoutout to Ashblue for his [fluid behaviour tree](https:\/\/github.com\/ashblue\/fluid-behavior-tree\/) package for Unity! The visualisation was very helpful when enemies were casting the wrong spells or none at all :smile: \n![BT.PNG](\/\/\/raw\/20b\/b3\/z\/40e4a.png)\n\nFeel free to check out the game and beat the AI :wink: \n\nhttps:\/\/ldjam.com\/events\/ludum-dare\/48\/into-the-tome-of-glyphs\n\nWeb build is available here: https:\/\/glyphsofmadness.genemachine.studio\/rom\/ (Press F11 for fullscreen).\nOnly development build for now because Unity didn't feel like building a working release build.","comments":1,"comments-timestamp":"2021-04-27T20:22:20Z","created":"2021-04-27T19:58:12Z","files":[],"files-timestamp":0,"id":254079,"love":4,"love-timestamp":"2021-04-28T08:25:23Z","meta":[],"modified":"2021-04-28T08:25:23Z","name":"Spellcasting AI with behaviour trees","node-timestamp":"2021-04-27T20:20:43Z","parent":244279,"parents":[1,5,9,233335,244279],"path":"\/events\/ludum-dare\/48\/into-the-tome-of-glyphs\/spellcasting-ai-with-behaviour-trees","published":"2021-04-27T20:20:43Z","scope":"public","slug":"spellcasting-ai-with-behaviour-trees","subsubtype":"","subtype":"","type":"post","version":777201},"node_metadata":{"n_key":"254079","n_urlkey":"376637","n_parent":"244279","n_path":"\/events\/ludum-dare\/48\/into-the-tome-of-glyphs\/spellcasting-ai-with-behaviour-trees","n_slug":"spellcasting-ai-with-behaviour-t","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"244482","n_created":"1619553492","n_modified":"1619598323","n_version":"777201","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/48\/into-the-tome-of-glyphs\/spellcasting-ai-with-behaviour-trees","text":"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](https:\/\/ldjam.com\/events\/ludum-dare\/48\/into-the-tome-of-glyphs). It was a great experience, even if we did not have time to implement and polish all features.\n\n![GameScreen.png](\/\/\/raw\/20b\/b3\/z\/40e58.png)\n\nFor the AI, @sebwod came up with themes and rules for each enemy\u2019s spellcasting. For example \u201cEverseer\u201d (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.\n![EnemyDesign.PNG](\/\/\/raw\/20b\/b3\/z\/40e4b.png)\n\nWe 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: \u201cwait for cooldown\u201d and \u201ccast random available spell\u201d. Shoutout to Ashblue for his [fluid behaviour tree](https:\/\/github.com\/ashblue\/fluid-behavior-tree\/) package for Unity! The visualisation was very helpful when enemies were casting the wrong spells or none at all :smile: \n![BT.PNG](\/\/\/raw\/20b\/b3\/z\/40e4a.png)\n\nFeel free to check out the game and beat the AI :wink: \n\nhttps:\/\/ldjam.com\/events\/ludum-dare\/48\/into-the-tome-of-glyphs\n\nWeb build is available here: https:\/\/glyphsofmadness.genemachine.studio\/rom\/ (Press F11 for fullscreen).\nOnly development build for now because Unity didn't feel like building a working release build.","title":"Spellcasting AI with behaviour trees","wayback_source":[]}