PDA

Click to See Complete Forum and Search --> : Artificial Intelligence


UBC_Wiskatos
May 13th, 2001, 12:24 PM
Hi guys,

I was wondering, would anyone know of good tutorials for pathfinding or just straight AI (with source code).

What I need is like an AI that has to find the best way through something, and say unlock some things on its own and things. So a kind of pathfinding AI, except the game isn't graphics-based, I don't think anyone has done a game like this.

HarryW
May 13th, 2001, 12:32 PM
Search for "A* pathfinding" or some similar phrase in a search engine. A* is a very well-known pathfinding algorithm, although I only know the name, nothing about how it works.

Zaei
May 13th, 2001, 05:56 PM
A* is one of the most commonly used algorithms, although it is slow, compared to some algoritms, especially if you are searching a large area.

Z.

VBD
May 13th, 2001, 07:31 PM
X

Sastraxi
May 13th, 2001, 08:01 PM
Okay VBD that is just a cheap way to get your postcount up.

Not to sound mean, but I would quit it.

PsychoMark
May 14th, 2001, 01:19 AM
http://64.23.12.52/tutorials/GM_Dijkstra.htm

HarryW
May 14th, 2001, 02:35 AM
Hey, I'm revising Dijkstra's algorithm along with a load of other stuff for my Algorithms & Data Structures exam on Tuesday morning :) Never really thought of actually using it... ;)

Jotaf98
May 14th, 2001, 06:14 PM
The path finding algorythm won't help if there isn't an AI controlling it ;)

I've heard that Fuzzy Logic is the best one (it's based on probabilities, like if it's attacked, you should increase its chance of running away). But also that there's something else that is more "inteligent" and learns with our moves, Neural Nets. Does anyone have more info on this? I need it for my game ;)

HarryW
May 14th, 2001, 06:40 PM
If you want to ask questions about neural nets go ask in the AI forum at www.gamedev.net .

You don't need AI that learns for a game. You can probably get away with very simplistic AI if the game isn't too complex. Remember Command & Conquer? The AI in that basically attacked your northernmost unit that was within range, or moved towards the northernmost unit it could see if it was out of range of anything. Well I think there was a little more to it obviously, but AI doesn't have to be so complicated.

Jotaf98
May 16th, 2001, 02:52 AM
Yes, you're right, I'll use Fuzzy Logic (tried it in a game's scripting language and it works just fine).

Hey, I have an idea: what about a small 2-d array, which would be just like the map - but instead of tile information, it would have the number of times it saw the player in that area! That could be used to avoid areas where the player usually is when running away or to chase the player!

/\/\isanThr0p
May 17th, 2001, 09:43 AM
Hey I would be very interested in seeing your AI (the fuzzy logic). (just to see how good it works)
I tried to use an A* some time ago but I could not get it to work properly. So I never got to the AI because the pathfinding was the basis for everything.
I really need to learn how to get a descent AI working.

Arbiter
May 17th, 2001, 09:55 AM
Well, when I upload the next version of Sentience (blatant plug - those who haven't downloaded it, do so now!!!!! :) ) you'll notice that the units have pathfinding and can be set on autopilot to destinations.

I am having serious problems with it however. Initially it had an almost pathological fear of straight lines. Now that's cleared up it seems to be excessively scared of diagonal lines.

I think it may be down to the costs we've specified for each chassis type to traverse different terrain types. Still, it finds it's way there by a route which may not be the best (but is certainly in the top 10%) and at a reasonable speed as well.

The code for it is frightening though and more than a little clumsy...

Jotaf98
May 18th, 2001, 11:42 AM
Go to http://www.planet-source-code.com and look for "Fuzzy Logic". It should be there ;)

As to the path finding, there are lots of algorythms there! Surf the net for an hour or so and you'll find dozens, just pick one :)