Latest LQ Deal: Linux Power User Bundle
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org A.I. Programming, following by my previous thread aobut turning an airplane
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 03-29-2004, 02:24 PM #1 feetyouwell Member   Registered: Dec 2003 Location: NC, US Distribution: Novell Linux Eval (2.6.5) Posts: 240 Rep: A.I. Programming, following by my previous thread aobut turning an airplane ok, i got my little airplane turning and and shooting bullets and all that. Works great. Now it's time to program the a.i. plane. What's the generic algorithm to programing the a.i. plane which includes: 1. when it turn its direction to user 2. when it shoots its bullets 3. when it speed up / slow down i know it somehow has to relate back to the user plane with a certain amount of randomness in it. Can anyone with previous a.i. experience to tell a little more about what's to consider in programming a.i. object?
 03-29-2004, 04:26 PM #2 kev82 Senior Member   Registered: Apr 2003 Location: Lancaster, England Distribution: Debian Etch, OS X 10.4 Posts: 1,263 Rep: my ai experience is pretty limited but i would consider using a finite state machine. its a bit difficult to explain but ive looked for a simple article on the subject and cant find one so here goes: lets take the example of a guy looking for gold in a maze, there are a few things he can do, he can a) wonder randomly b) go to a location he's already been to c) wonder systematically(turn right continuously, etc) d) etc... these are the different states the ai can be in a finite state machine is nothing more than a finite set of states (3 in this example) and some rules that dictate switching between them so here are a simplistic set of rules 1 if see gold - get and goto exit 2 explore randomly slightly better rules 1 if see gold - get and goto exit 2 if in new location - explore randomly 3 goto unexplored location so basically you need to come up with some simple things your ai can do - chase ship patrol run away then come up with some rules to choose going from one state to another if patrol and see ship then chase ship if chase ship and ship bigger than you then run away ... ... you could try looking at some of the ai articles on www.gamedev.net

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post JZL240I-U LQ Suggestions & Feedback 5 11-09-2005 08:40 AM Megasms Programming 2 11-05-2005 01:09 AM rajsun Programming 0 10-08-2005 12:18 AM msriram_linux Programming 4 11-21-2004 04:14 PM Nguyen Hai Nam Programming 0 11-13-2001 03:41 AM

LinuxQuestions.org

All times are GMT -5. The time now is 05:39 PM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -