Time for an update! We are currently working hard on the new video for Dungeon Kingdom. We have plenty of assets created by 3D artists, but it takes some time to make them “ready” for the game’s fully dynamic environments. We have made some great progress and we are confident that you will enjoy the results. We are very excited about what you will discover in the trailer!
If you don’t want to wait, we have released a small picture which shows off 2 of the new environments you will experience in the game:

Tease_Env

Lastly, we want to mention that thanks to you, we have so far reached 27% of our initial goal. We have also reached 95% of the way to the top 100 on Steam Grenlight. We very much appreciate all of your help, support and contributions! Don’t forget, you can still help us to fund the game with our Indiegogo campaign, so we can improve it and release it sooner!

https://www.indiegogo.com/projects/dungeon-kingdom-sign-of-the-moon

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 “revinvent the wheel”, i tried to make an effort by using public tools. Unfortunately, i had to write my own, and this it the story i’ll tell you now :

In an old school Dungeon Crawler,  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’s the other games. For The Dungeon Kingdom, the AI has to be smart, and the navigation system efficient ! Ah..and i forgot to mention, everything need to be dynamic ! I did check the available tools & plugins for 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…! So instead of spending ages seeking for the pearl, i wrote one !

So i created 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.

One feature i added is a crowd factor to the waypoints, so the creatures, depending their size, can push the pathfinder to temporaly disable the waypoint from the graph for the others navigating agents.

Another feature: the graph has informations about locomotion type and state of the links : for example some of waypoint can require a monster to be a fly type of creature to 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)  an access to a waypoint can be restored / added. Same for pit. Actually, there’s no difference between a door or a pit for the pathfinder, it uses the same flexible system.

Note that despite the “Case by Case” system, and square based arthictecture “ala Dungeon Master”, in The Dungeon Kingdom the navigation system is totally universal and would work for any kind of environment. There’s no “Square” 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 are bi-directionals. Let’s see on the screen shot why it’s important :

Brain_Navigation_Graph

Brain_Navigation_Graph

Brain Navigation

Brain Navigation

The wire lines are drawn by the debug mode inside the tool, it shows the generated navigation graph. The blues lines are waypoints, 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.

Next time we’ll talk a bit about render optimizations and graphics options, or we may post a new in game video… So keep an eye on the website.

When it’s time to give life to creatures and create AI, there are several options : you can code it by writting scripts, or use tools such as Finites State Machine or Behaviors Tree.

Creating the whole Artificial Intelligence by scripts is great for a developer wich is also the one integrating the AI, wich is my case. However it’s not the ideal  solution for complex behaviors , especially if you need flexibility and can also be tricky to maintain / debug.

Second option, use common tools to write AI, like FSM and BT. Nice tools, and both BT and FSM can be mixed. I have the bad habit to reinvent the wheel (wich in my opinion is not that bad if you really want to understand the coding way 🙂 ) , but this time i decided to gave  try to some public tools instead of coding my system. Unfortunately, after some tries, i end-up with that conclusion: it can works great (BT can be wonderfull !), but not suitable for my needs. I need the creatures of The Dungeon Kingdom to be smart, very smart. Not just simple “if see player, reach and attack” style behaviors. I also need the creatures’s Artificial Intelligence to be smart, tweakable, and easy add variety to a base one. With those requirements in mind, it can be tricky to handle such an AI with common tools.  I then decided to revisit an 8 years ago AI design i have written in c++ for a AAA class game. Of course, i have rewritten all from scratch in c#, and improving it greatly !

So what’s this AI system like ? Basically, it’s a “virtual” brain, and like any real creatures, it is made of elements/features such as sensors (vision, hear noise…probe environment…), memory (in my design, i call them cells. Add to this macro behaviors and controllers and you get the AI system. I won’t enter too much in details here, but the system has been created with flexibility in mind, and fast complexe behaviors creation. Sensors automatically create Cells, wich have automatic values history tracking and others cool features, behaviors and controllers ( a controller is permanent / parallel behavior in this system)  has weight, randomness, priority, cooldown and all you can dream to help the brain decide wich behavior to execute. Let’s see how does it look into the editor (here in play mode) :

Brain Tool showing behaviors

Brain Tool showing behaviors

Cells, Sensors, Controllers...

Cells, Sensors, Controllers…

You can also notice in the 3D viewport some lines and differents shapes wich are sensors debug informations, like creature’s field of view etc. etc.

This brain setup is basic, but already good enough to create unpredictable behaviour  (by the player) .

That’s all for this post, next time i’ll talk a bit about the creature navigation !

I am glad to introduce you 3 talented guys who join the effort of bringing The Dungeon Kings to life:

– Marc ‘Weren’, is the original writter of the world in wich The Dungeon Kings world takes place. Worth to mention it to newcomers, The Dungeon Kings will get few sequels, and has a strong story and a deep history context. Weren is working hard to make richer the story of the first chapter, and improve the current story telling.

– Ralf, a talented artist who has made the Dungeon Master art pack for Dungeon Master & Chaos Strikes Back mod for Grimrock.

– Jason ‘Seriously Unserious’  will care about the community on our own forum but also on other websites and help for translation.

They are great guys and passionate, and our best wish is to let you feel it while playing The Dungeon Kings !