Kuno

A tech demo demonstrating the use of AI decision making techniques and pathfinding algorithms on an isometrical 2D tiled map.

The original intention of this app was to be a isometric mission game similar to classics such as Commandoes or Desperadoes but set in feudal Japan instead (hence the name "Kuno").

This was one of the first large size projects that I had attempted. I quickly realised how daunting of a scope I set for myself.

For this project, I had to implement an AI decision making technique such as a decision tree and a certain pathfinding algorithm. I wanted to challenge myself so I went with behaviour trees, as from what I gathered had the potential to yield better and more complex AI behaviours, although it can be a bit more difficult to write and implement.

The behaviour that I wanted to implement on the enemy characters is fairly complex and I ran into some technical difficulties that unfortunately I couldn't resolve in time. So I ended up simplifying the behaviour so that one enemy would flee, one enemy would seek and another enemy would seek until the player is out of range. At which point it would wait a few seconds and then run back to it's guard post.

Mobirise
Blue: Player, Red: Guard
Yellow: Flee, Green: Seek
I'm all for making things more efficient when it comes to algorithms so for the pathfinding algorithm I went with A* as it's essentially Djikstra but with a few little tweaks that yields better and faster results.

I also had to develop the 2.5D isometric tiling system. This included writing an algorithm to convert between isometric and cartesian coordinates and a sprite depth sorter so that each sprite is drawn in the correct order and not behind or in front of any objects it's not supposed to be.

There was a tremendous amount that I learnt during development of this project, too much too list, but one of the biggest takeaways I got from doing this project was that it is crucial to set a realistic scope. I definitely realised quickly that I had bitten off way more than I could chew, and rightfully so as there was a mad rush towards the end.

And the end of the day, considering the scope I set for myself and the total duration of the project I believe I did a pretty good job and am pleased with the result.

You can view the source code or download the demo below:

Select between A* or Dijkstra pathfinding

Visualisation of node connections with traversal costs

HTML Editor