Search Unity

My first AI

Discussion in 'Works In Progress - Archive' started by Berenger, Feb 4, 2012.

  1. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    Hi guys !

    I'm working on a simple AI, and I'd like to have your feedback. I used the pathfinding from Aron Granberg. I tried the one from Angry Ant, but it wasn't conclusive.

    To test the web player : http://www.berengermantoue.fr/unitygames/ia.html
    To download the package : http://www.berengermantoue.fr/unitygames/AI_BerengerMantoue.unitypackage

    PS : About the package, sometimes the layers are lost during the import. If that happens, recreate them in that order :

    • 8 : Enemy
    • 9 : Obstacle
    • 10 : Player

    There is an explanation in the player, but it's in french (as well as most comments in the code) so here is the translation :
    ZQSD or arrows to move the blue capsule. Press the buttons on the right to choose the reaction of the AI when you enter it's field of view.

    You'll note the text over the target, corresponding to the FSM object oriented I made : The first line is the IBehaviour currently used to decide where to go, the second line is the ITechnique used to move. Ithink when you see it in action, it's pretty obvious.
     
  2. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    if anyone's interested, it's been updated. New states (search, cover, fetch, patrol, wait) new look, new control (enter to switch camera, click to shoot for the fetch, arrow to move, shift to go stealth mode, first set of button on the top right is "what the AI does when it sees me", the second set is "what the AI does when I'm away").

    Screenshot : Left is first version, right is current version.

     
    Last edited: Feb 8, 2012
  3. gamepanch

    gamepanch

    Joined:
    Jan 4, 2012
    Posts:
    12
    hi nice ai programing i am also learn unity3d new
    i try to same concept move object one node to another node but you moving object have a triangle shape view i dont know how to set view triangle shape please replay me if you dont mane send the code friend .... have a nice day
     
  4. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
    I'm not sure what you mean by triangle view. As for my code, the package contains all the project, including readable/editable code.

    To move along a path :

    dir = node - position
    if( [dir] < distToNextNode )
    node = nextNode
     
    Last edited: Feb 8, 2012