{"id":199,"date":"2014-07-18T16:04:06","date_gmt":"2014-07-18T15:04:06","guid":{"rendered":"http:\/\/www.hydro-games.com\/dk\/?p=199"},"modified":"2014-09-01T15:24:34","modified_gmt":"2014-09-01T14:24:34","slug":"creatures-navigation-dungeon-kings","status":"publish","type":"post","link":"https:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/","title":{"rendered":"Creatures Navigation in Dungeon Kingdom"},"content":{"rendered":"<p>AI Navigation into games is complex problem if you want it to be done right and realistic. Like for the AI system mentionned in he previous post, despite i tend to &#8220;revinvent the wheel&#8221;, i tried to make an effort by using public tools. Unfortunately, i had to write my own, and this it the story i&#8217;ll tell you now :<\/p>\n<p>In an old school Dungeon Crawler,\u00a0 you can avoid writting a complexe AI navigation system : the square based architecture make everything easy to handle, and most games of this style process that way. But that&#8217;s the other games. For The Dungeon Kingdom, the AI\u00a0has to be smart, and the navigation system efficient ! Ah..and i forgot to mention, everything need to be dynamic !\u00a0I did check\u00a0the available\u00a0tools\u00a0&amp; plugins\u00a0for Unity, but most are simple A* system using a static graph or build by hand into the tool, wich is the opposite of what i needed for The Dungeon Kingdom&#8230;! So instead of spending ages seeking for the pearl, i wrote one !<\/p>\n<p>So i\u00a0created a bunch of scripts to automatically generating the navigation graph at runtime. In The Dungeon Kingdom, the game is building the navigation graph when playing.<\/p>\n<p>One\u00a0feature i added is a crowd factor to the waypoints, so the creatures, depending their size, can push the pathfinder to temporaly\u00a0disable the waypoint from the graph for the others navigating agents.<\/p>\n<p>Another feature: the graph has informations about locomotion type and state of the links\u00a0: for example some\u00a0of waypoint can require a monster to be a\u00a0fly type of creature\u00a0to reach it. About states, some access can be dynamically disabled, or like when you open a door (wich is automatially detected by the dynamic navigation graph building)\u00a0 an access to a waypoint can be restored \/ added. Same for pit. Actually, there&#8217;s no difference between a door or a pit for the pathfinder, it uses the same flexible system.<\/p>\n<p>Note that despite the &#8220;Case by Case&#8221; system, and square based arthictecture &#8220;ala Dungeon Master&#8221;, in The Dungeon Kingdom the navigation system is totally universal and would work for any kind of environment. There&#8217;s no &#8220;Square&#8221; design limitation : the waypoints can be linked to any amounts neighbors, and those waypoints can follow any typology. And to finish, the waypoints links states\u00a0are bi-directionals. Let&#8217;s see on the screen shot why it&#8217;s important :<\/p>\n<div id=\"attachment_201\" style=\"width: 490px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1.png\"><img aria-describedby=\"caption-attachment-201\" loading=\"lazy\" class=\"size-full wp-image-201\" src=\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1.png\" alt=\"Brain_Navigation_Graph\" width=\"480\" height=\"537\" srcset=\"https:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1.png 480w, https:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1-268x300.png 268w, https:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1-400x448.png 400w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><p id=\"caption-attachment-201\" class=\"wp-caption-text\">Brain_Navigation_Graph<\/p><\/div>\n<div id=\"attachment_202\" style=\"width: 490px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav_2.jpg\"><img aria-describedby=\"caption-attachment-202\" loading=\"lazy\" class=\"size-full wp-image-202\" src=\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav_2.jpg\" alt=\"Brain Navigation\" width=\"480\" height=\"537\" srcset=\"https:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav_2.jpg 480w, https:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav_2-268x300.jpg 268w, https:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav_2-400x448.jpg 400w\" sizes=\"(max-width: 480px) 100vw, 480px\" \/><\/a><p id=\"caption-attachment-202\" class=\"wp-caption-text\">Brain Navigation<\/p><\/div>\n<p>The wire lines are\u00a0drawn by\u00a0the debug mode inside the tool, it shows the generated navigation graph. The\u00a0blues lines\u00a0are\u00a0waypoints, green are opened links to any locomotion type. Yellow lines are links opened to flyers only (here because the pit is closed). Red is closed link.<\/p>\n<p>Next time we&#8217;ll talk a bit about render <span class=\"hps\">optimization<\/span>s and graphics options, or we may post a new in game video&#8230; So keep an eye on the website.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI Navigation into games is complex problem if you want it to be done right and realistic. Like for the AI system mentionned in he previous post, despite i tend to &#8220;revinvent the wheel&#8221;, i tried to make an effort by using public tools. Unfortunately, i had to write my own, and this it the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"The creature&#039;s navigation system created for Dungeon Kingdom is totally universal and would work for any kind of environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AI navigation system created for Dungeon Kingdom\" \/>\n<meta property=\"og:description\" content=\"The creature&#039;s navigation system created for Dungeon Kingdom is totally universal and would work for any kind of environment.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/\" \/>\n<meta property=\"og:site_name\" content=\"Dungeon Kingdom\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-18T15:04:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-09-01T14:24:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1.png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hydro-games.com\/dk\/#website\",\"url\":\"https:\/\/www.hydro-games.com\/dk\/\",\"name\":\"Dungeon Kingdom\",\"description\":\"Dungeon Crawler RPG VideoGame\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.hydro-games.com\/dk\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1.png\",\"contentUrl\":\"http:\/\/www.hydro-games.com\/dk\/wp-content\/uploads\/2014\/07\/Brain_Nav1.png\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/#webpage\",\"url\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/\",\"name\":\"The AI navigation system created for Dungeon Kingdom\",\"isPartOf\":{\"@id\":\"https:\/\/www.hydro-games.com\/dk\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/#primaryimage\"},\"datePublished\":\"2014-07-18T15:04:06+00:00\",\"dateModified\":\"2014-09-01T14:24:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.hydro-games.com\/dk\/#\/schema\/person\/e69557cedec3ea1da254c58eea7e5ad6\"},\"description\":\"The creature's navigation system created for Dungeon Kingdom is totally universal and would work for any kind of environment.\",\"breadcrumb\":{\"@id\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/\",\"url\":\"http:\/\/www.hydro-games.com\/dk\/creatures-navigation-dungeon-kings\/\",\"name\":\"Creatures Navigation in Dungeon Kingdom\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hydro-games.com\/dk\/#\/schema\/person\/e69557cedec3ea1da254c58eea7e5ad6\",\"name\":\"Admin@kanda\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.hydro-games.com\/dk\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0fb4fcdc10e3e20dab044eb481e0a03d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0fb4fcdc10e3e20dab044eb481e0a03d?s=96&d=mm&r=g\",\"caption\":\"Admin@kanda\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/posts\/199"}],"collection":[{"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":15,"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/posts\/199\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hydro-games.com\/dk\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}