Search Unity

(Advanced-ish) Mecanim + AI [Free sources]

Discussion in 'Made With Unity' started by EBR, Apr 3, 2014.

  1. EBR

    EBR

    Joined:
    Jan 27, 2013
    Posts:
    117
    FSM Mecanim AI

    NOTE: Information about the builds at the bottom, please read.
    Webplayer | Mac | Windows(Untested)
    (Please tell me about performance, I haven't optimised anything yet; is it okay?)

    $Screen Shot 2014-04-03 at 6.32.04 pm.png

    I have been working on a sort of advanced AI system using a finite state machine (FSM) and unity's built in nav-mesh system. It is a major modification to this, so as it is not my work I will give it out for free. If you are interested then just say so and I will put up the download link. The AI system is mainly for first person games, but it will work with other games types (as far I know). The AI at the moment has 7 states. The completed in green and the ones being tweaked in yellow the states planned for the future in red

    Idle, Patrol, Following, Searching, Investigating,
    Cover, Attack, Dead. Flee


    $Screen Shot 2014-04-03 at 6.46.56 pm.png
    $Screen Shot 2014-04-03 at 6.44.18 pm.png
    $Screen Shot 2014-04-03 at 6.48.00 pm.png

    Information about builds
    Controls
    WASD - Movement
    Shift - Sprint
    Space - Jump
    Left Mouse click - whistle attracts guards attention, can be replaced with any sound (eg. Gun sounds in fps)
    Others
    - Different colours of the guards "vision" mean different things. Blue is idle, yellow is for when it is searching/investigating. Red is when it can see you and is attacking.
    - Try not to go places where the ai can't go it bugs out sometimes.


    Will constantly be working and updating this, still loads of bugs to fix and things to tweak, feel free to comment and write your opinions, criticisms and suggestions.
    :D
     
    Last edited: Apr 4, 2014
  2. joni-giuro

    joni-giuro

    Joined:
    Nov 21, 2013
    Posts:
    435
    Cool! I'm at 58fps stable on a macbook pro retina and chrome (webplayer). It would be cool if the dude would listen for sounds as well, like if you jump behind him he will turn around
     
  3. EBR

    EBR

    Joined:
    Jan 27, 2013
    Posts:
    117
    Hi joni, it does the guard can hear you based on your velocity, so you have to get quite close for him to hear you but if you sprint pass him he will turn around and investigate :)