# C# AI libraryes for games?

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

## 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 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.

Marcus

##### Share on other sites

Thanks, but is really not what I need.

Anyhow, IrrlichtLime already includes pathfinding, and I'm using it.

Bye, Ivano.

1. 1
2. 2
Rutin
25
3. 3
4. 4
JoeJ
18
5. 5
gaxio
11

• 14
• 22
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631766
• Total Posts
3002215
×