Jump to content
  • Advertisement
Sign in to follow this  

C# AI libraryes for games?

This topic is 772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone.

I wonder if is there any good AI for games library, just some path-finding, behavior trees and neural nets.

It has to be compatible with C# without writing a wrapper.


Thanks in advance for any help.


Bye, Ivano.


Share this post

Link to post
Share on other sites

I did a little bit of prowling around, and AForge is what kept popping up. http://www.aforgenet.com/framework/

If this doesn't meet your query, I'm sure there are other libraries out there you can use.


Incidentally, the article published by Patrick Lester I think gives a very well written, high level overview of the A* algorithm.

Should you choose to implement it without the aid of third party libraries http://www.policyalmanac.org/games/aStarTutorial.htm


The article goes over at a high level the pseudo-code of the algorithm:

1) Add the starting square (or node) to the open list.

2) Repeat the following:

a) Look for the lowest F cost square on the open list. We refer to this as the current square.

b) Switch it to the closed list.

c) For each of the 8 squares adjacent to this current square …

    If it is not walkable or if it is on the closed list, ignore it. Otherwise do the following.           

    If it isn’t on the open list, add it to the open list. Make the current square the parent of this square. Record the F, G, and H costs of the square. 

    If it is on the open list already, check to see if this path to that square is better, using G cost as the measure. A lower G cost means that this is a better path. If so, change the parent of the square to the current square, and recalculate the G and F scores of the square. If you are keeping your open list sorted by F score, you may need to resort the list to account for the change.

d) Stop when you:

    Add the target square to the closed list, in which case the path has been found (see note below), or
    Fail to find the target square, and the open list is empty. In this case, there is no path.   

And if I'm not mistaken he includes source code for reference as well in the end of the article. 


I've never worked with Behavior Tree's before, so I'm afraid I can't give much insight their. Normally I tabulate some tiered values of an entity, (i.e. The entity stats, health, hunger, ect. ) that dictate the entity emotions, which both in turn eventually as a scalar of sorts to a "cost" value of an end-result action, the action with the least cost gets chosen.



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!