Archived

This topic is now archived and is closed to further replies.

Brackus

Some A.I. questions asked...

Recommended Posts

Hello, once again, with free time on my hands, I will look to this forum for some help. As my time at school passes, I realize I might not make it as a gameprogrammer, or even a programmer. However, I would still like to see a graphical representation of little artificial "beings" running around using my code, as a means of determining their actions. So, my question is, once again, how could I draw a maze, draw 2 or more "beings" and have them obey the "walls" or other objects in my "maze" or even "world". The closest I got to this was make a little "circle" that chased down a user controlled "circle" always choosing the fastest route. However, it only went up if it had to, same for down, left and right, but that was fine for me. I can imply other things later like going where the user is heading, or making the "circle" seem more realistic. So, my main concern right now, is getting a worldly or maze like setting, or even a fake football field, 2d or 3d, with basic code to make the "beings" obey the laws of the setting, and an option to code them to react and move about as I please. I dont care, I would even try and code like a one screen mario world with a little bug chasing mario, and a turtle too... but, if it would be just as easy to code a quake 3 bot (unlikely, but maybe) or anything in between, I would love it. So, my question is to you out there, is there anything available to me that would allow me to do my testing as I wish??? Or, is all code "top secret" and not available. One thing I tried, was coding robots in all the robot war things on the net, but, with no tutorials, or books, and no people to talk to for help, I made basically zero progress. Maybe, I am not smart enough, but... maybe I am just looking at the wrong things, the wrong places. So please, if you know of where I can get my hands on a virtual setting as I have mentioned, please tell me, or send it to me, or if neither of these works, give me ideas on how to code it. My last thing was coded in turing, just because I could make circles, and make them move around most easily, last semester, I took java, and this semester, were working in ''C'' Anway, I have likely talked too much, Thanks, Dustin

Share this post


Link to post
Share on other sites
Well, the first step is path finding, i.e. navigating a maze. There is an article on the A* algorithm on this site under Resouces->Articles & Resources->Programming->Artificial Intelligence->Pathfinding and Searching, i.e. look at the top of this page. Moving is the most basic thing your AI needs to be able to do. Once you have an ability to navigate to a specific point then you can start worrying about where you should move to and what you should do when you get there.

Share this post


Link to post
Share on other sites
first off, you need to determine how your units interact with space.

do they exist in cells via coordinates?
do they exist within boundries, using just coordinates?
??
once you figure out how they exist, you can figure out how to detect collision.
once you can detect collision, you can get into path finding.

pathfinding is an algorithm that determines a best path based on variables. basically, your algorithm will run tests to determine a good path. look up "A* algorithm". (i think thats the name).


you dont necessarily need to define a maze structure. just make a bunch of sprites around the screen. when you click on a sprite, you get to click somewhere else, and it trys to move there, navigating around the other sprites.
you can try to add movement behaviors too. for instance, in TotalAnnihilation, a jet doesnt just go to a location like in StarCraft, it gets close to it, and then circles.

this is called fuzzy logic - - where the ai asks "am i close enough?" or "is this satisfactory, or can i do better?". fuzzy logic can really simplify your AI, because your algorithm wont need to work hard to get stuff super accurate - it can settle for approximation.

Share this post


Link to post
Share on other sites