   Hello, need some help and ideas of AI
  Hello guys,I am Working on rpg game style GTA 2 and right now I am working on engine. One of my problems right now is the AI. I want to make people and cars going from place to place randomly but I dont have any idea how to start and where I am going from here ... I hope you have some ideas, any mterials on subject, any thing. Thanks.   
  I'm not sure what a role-playing GTA 2-style game is so I'm assuming it's something like a GTA2 clone.For a start I would construct some kind of graph of your road network which the AI can use to do pathfinding on (a directed graph should do unless you game world is massive or your road topology is considerably more complex than GTA2's was). If you just want them to move randomly you could simply have them all randomly chose a location on your road network (you may want to assign certain areas with higher probability as the probability of driving to downtown should be higher than driving to the quarry outside the city, you may even take time of day into account). Then you simply do something like A*-pathfinding to find a road to follow. Remember to add some kind of cost for turning or you may end up with a disproportionate number of turning vehicles. Driving itself should be fairly simple. Drive until you get close to an obstacle (car, red light, pedestrian) and slow down as you get closer. In a chaotic situation you can go into a panic mode (use a finite state machine to track states) where the vehicle first checks if it can find a way out driving normally (this may need some experimentation to get working properly and as far as I remember it could even be problematic in GTA2, but it didn't matter because you often just blew the whole thing up or moved on and the whole mess was simple cleared when you got a couple of blocks away), and otherwise perform some other action like wait and honk until you can get out; in a non-persistent world it doesn't really matter if you just wait and honk forever, but it will look stupid if it's obviously easy for the driver to move on.This is pretty much just a pathfinding and obstacle avoidance problem for a simple agent whose state can be tracked by a FSM. Pretty much any Game AI book or site will have more suggestions for just this situation (look up A star, pathfinding and finite state machines for AI and you should get a good starting point and many of these articles will have "further reading" sections if you want something a bit more sophisticated).   ;  ohhh ... pathfinding ... great idea, I think I will try it. Thank you!   ;Quote:Original post by Answer3ohhh ... pathfinding ... great idea, I think I will try it. Thank you!While wearing my moderator hat, I'm trying to decide the following:A) is this sarcasm?B) if so, was your original post actually a legitimate question?   ;Quote:While wearing my moderator hat, I'm trying to decide the following:A) is this sarcasm?B) if so, was your original post actually a legitimate question?No, it was: "how stupid am i that i did not think about that before ..."And the idea is realy great. I already begun to work and read about algorithms in wiki. I have many problems but I think I can handle them. I think about define a matrix, NxN and that matrix is my map. I mean where is the buildin there will be number 1 and where is a car there will be number 2, and the agents will find the routs where is the zero. Moreover, probably I will have backtracking here. for example:0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0  0 0 0 0 0 1 1 1 1 0 0 00 1 1 1 1 1 1 1 1 1 1 00 0 0 0 0 0 0 0 0 0 0 0 Ahh, and thanks for the links, I begun to read some blocks ... very intersting the subject of AI. 