logo

Pathing

A better A* algorithm

A few years ago I needed a path finding algorithm in a hurry for a procedural level generator I was trying to write. I managed to find a C# one that supported a number of options and was focused on performance. I reached out to the author if they minded if I changed it a bit and package it up as a nuget. The author agreed, and I used the library in a couple procedural level generators such as Promethean.

Promethean - A procedural dungeon generator in C#

I’ve gotten a first version of a procedural dungeon generator written in C#. I aim for this to be compatible with the Unity but at the moment it looks like Unity isn’t a fan of a List of Lists. You can see the code on Github and view some generated floor maps in the browser here(not longer hosted). The browser rendererjust renders a bunch of coloured tiles on a canvas.

A* algorithm in C#

An A* algorithm in C#. Original credit goes to Gustavo Franko and his post on code guru. With his permission I’ve pulled out the A* algorithm from the sample app, updated some of the code to use some newer c# features, added some tests to demonstrate usage and uploaded it to github. You can view the project at https://github.com/valantonini/AStar. The algorithm contains a variety options such as whether it uses diagonals.