Search Unity

Fantasy AI 2.0 [RELEASED]

Discussion in 'Assets and Asset Store' started by brilliantgames, Mar 1, 2012.

  1. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    That is very possible i was speaking of just calculations and things the AI system is actually doing :). Why dont you use things like colliders as triggers? that way you wouldnt really have to ray cast to find a target unless your only raycasting for ranged combat. Also i had one question, i noticed your using arrows what type of system are you using to fire the arrows? Are you going skyrim style where the ai shoots arrows that are affected by physics(rigidbodies) or are you just having the arrow find its way to the target?
     
  2. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    The raycast is used for vision. Its really one of the only ways to know if the view is obstructed. There is only one raycast, and only on his current target. So things really arent slowed down much. As for the arrows, they have rigid bodys as well, but I created my own gravity for them, so that the user can control how much gravity there is(if any at all). The arrow uses the "Projectile" script I made. I designed this script so that it could really work with anything. Bullets, arrows, magic, whatever..
     
  3. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    Sweet thats actually what im working on right now with my AI engine ive been building for Rise of Guardian's. My issue is the arrow is always getting instantiated pointing straight up no matter what i do so it looks a little odd i mean it corrects itself and flys right after that but i cant fix it and its driving me nuts lol. and ive tried manually setting its rotation after instantiation and everything nothing works lmao. c# or javascript?
     
    Last edited: Apr 18, 2012
  4. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    As soon as my arrow is created it is pointing at the target. It stops pointing at the target when it is fired. So it doesn't act like a heat seeking missile.
     
  5. Legacy

    Legacy

    Joined:
    Oct 11, 2011
    Posts:
    651
    hmm was your model imported into unity pointing straight up? i didnt buy an arrow model i just made a small arrow with a shaft and arrowhead in 3ds maya rotated it to align with the x axis horizontally but no matter what in unity its pointing straight up on import. I tried instantiating the arrow with the same rotation as the cube i had firing it(for testing purpose haha) and no matter what the rotation i could rotate x y and z the arrow started off pointing straight up haha.

    I was going to buy your pack just for the arrow because i got so mad at it sunday when i was trying to get it to rotate right haha its like its rotating on different axis than the rest of the objects... Figures im no pro modeler haha
     
    Last edited: Apr 19, 2012
  6. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hah, oh I c. I think I had a similar problem. I ended up making the arrow the child of a cube object.
     
  7. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Is there a way to 'reset' an AI back into hunt mode easily (i.e. a SetBehaviour( Behaviour.Hunting ); would be nice).
     
  8. poboczny

    poboczny

    Joined:
    Sep 25, 2010
    Posts:
    553
  9. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Well you would get the component of the ai script. Lets say we call the component "aiscript". The activate hunt mode you would simply say, aiscript.hunt=true; There may be many cases where this wont work though. Cause his behavioural tree is controlling him. If he doesn't respond with the command, simply go aiscript.disablebehavioraltree=true; Then aiscript.hunt=true; You will want to reactivate the tree afterwards, cause he is just a robot in this mode.
     
  10. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I would love to see the AI being used on these characters! :)
     
  11. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    IMPORTANT ANNOUNCEMENT! NEW UPDATE WITH POWERFUL FEATURES. I've been working hard on the next update. One of the main new features being built and coming along very well is the brand new, NAVIGATIONAL MESH BUILDER. It is very powerful, not only does it create a grid around obstacles, but it efficiently and intelligently scales them to save memory and performance. It detects how much extra space there is and places one large waypoint in large open areas, rather than pointlessly placing a massive grid of tiny waypoints. Because of the power of this new feature, as well as the other features, THERE WILL BE A PRICE CHANGE. So I suggest grabbing a copy as soon as you can! For those of you who already have, thank you for your purchase and get stoked for the new update!
     
  12. blurededge

    blurededge

    Joined:
    Mar 14, 2012
    Posts:
    255
    Well this just keeps getting better. I'll have some time to mess with this finally tomorrow, and I'm looking forward to it.
     
  13. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Good stuff. I would love to see what people have done with this package so far. Post screen shots and videos on this thread if you feel like. :)
     
  14. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Just bought it.
    If the environment or terrain change, would the nav mesh change dynamically?
     
  15. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hey, Thank you for the purchase. Unfortunately the pathfinding is not dynamic. The next update will have much more advanced pathfinding. Hopefully some dynamic pathfinding features. :)
     
  16. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
  17. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Thats a really neat showcase of the Left For dead AI. I was always a fan of the AI. They must have had efficiency in mind seeing how many zombies are on one screen at one time. Unlike counterstrike source, where to this day, 40-50 bots will noticeably slow framerate on a modern machine.
     
  18. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Waypoints in the new update are no longer limited to 4 linking waypoints, its now infinite. This opens doors for much more complex layouts of waypoints, giving the user the freedom to place waypoints basically however he likes. As well, for those of you who don't know, there will be a navigational mesh generator in the next update. This will save you countless hours of manually laying out waypoints. But don't wait for this update! There will be a price change on the release date of the new update, so grab your copy now!
     
  19. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    Hello,
    Nice system you have. Please, just some question before buy this:
    - I'm making a game for Web and Mobile, I'm making my own pathfinding at the moment, but I don't have more time, I need to focus on the main game features.
    - I want to know if I can place buildings (like in RTS games) and then the characters pathfinding already recons this and do not use as a valid path. In my game, I will use some characters to battle like in the demo you did, but I need to place buildings and then the characters needs to avoid this path place.
    - Is it tested for mobile devices already?

    Thank you in advance.
     
  20. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I have not been able to test this for mobile yet(but I don't see why these scripts wouldn't work). As for dynamic obstacle avoidance? This is in the works for the next update. The pathfinding is going to be leaps and bounds better in the next version of this package, which will raise the price. Right now, they DO have simple obstacle avoidance that works for small more simple objects that they run into. Other than that, they are currently limited to baked waypoints. As well, in the next update, there will be a navigational mesh builder. Hope this helps, I would greatly appreciate if anyone could test this for mobile. My iPhone is too messed up right now.
     
  21. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    I can test it for you if I buy :p
    I'm in a middle of 4 projects (advergames) and probably I can buy this at night... but I really want to know all features included:
    - Does this have some kind of formation in AI?
    - Do you have any performance test? So I can have a clue to test later in mobile devices.
    - I saw your tutorials a little bit... can I add more animations in your list? Or am I limited to that ones?

    Thanks again
     
    Last edited: Apr 23, 2012
  22. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    There really isn't formation code built in. I have not built any cause that would be a separate script that would control groups of AI, and thats not what the product is. But I'm sure you can easily make formation code using the behaviours that exist. The companion feature makes the AI follow a specified leader or object and support him. But there are over 500 hours worth of powerful coding and features built into this AI, I'm sure this would be your best bet on the asset store for what you are looking for. As for animations, as of now the AI are limited to those. But adding more animations would not be hard. For the next update, there will be more animations, and the animations with be lists, so you can add multiple in the same category and they will be randomly selected. This AI is built to to have good basic behaviours and functions, but also able to be controlled easily. For example, if you have played the mini game, you may have noticed the ability to order the AI's to do different tasks. These orders are pretty complex, but the amount of coding if took to carry out those commands using the behavoours built in was very minimal. Heres a small example of making the ai follow/support the player.

    if(followme){
    ai.companion=true;
    ai.companionleader=player;

    //dialogrespond is his dialogue response to an order. example "yes sir!"

    if(dialogresponnd) ai.Dialogrespond=true;
    dialogresponnd=false;
    }
     
  23. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Today I just finished the new "Smoothpath" feature. The AI will take shortcuts through waypoints to the farthest waypoint visible using raycasting. This avoids any unnecessary turns and appears more smooth and less graphical. This feature can be enabled or disabled in real time.

     
  24. xandeck

    xandeck

    Joined:
    Apr 2, 2009
    Posts:
    563
    Thanks for the info... and what about the performance tests?
     
  25. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    These AI were designed with efficiency in mind. I don't have any exact numbers to give you but, I have tested hundreds upon hundreds of AI's all performing different tasks while pathfinding, and really the only thing that is significantly slowing things down at that point are the rigidbodys and the meshes of the characters themselves.
     
  26. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Advanced Fantasy AI is now the main feature on the Asset Store. :)
     
  27. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
    hi
    The description looks amazing but where i can find a complete list and description of the AI scripts and all the features?
    you only mention 2 o 3... if this was asked before i am sorry, but i cant read 14 pages to look for that.

    for example i want a AI script for the agent scape from the user... and other to be there and when it is close run away.

    if i can get a feature list probably i will buy, already read a lot of good comments.

    Thanks
     
    Last edited: Apr 24, 2012
  28. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Congratulation!
     
  29. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hey, thank you for showing interest. It doesn't really make sense to list every single feature, cause in a way its almost infinite. The main goal of this AI is to have all the main behaviours required for a typical AI in a fantasy based game. All these ground work behaviours can branch off into infinite amounts of other behaviours controlled by the user. There are some built in "cool" behaviours like "Find help on retreat", which speaks for itself. Maybe when I get the time I'll make the giant list of everything the AI can do and is capable of. I'm trying to understand the example you stated. Are you talking about the AI retreating from another AI? Either way, controlling where the AI goes and his reaction to the proximity of other units is very easy to control. If you could give me more detail of what you are looking for I can fill you in.
     
  30. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
    hi, thanks for the fast answer.

    in my actual game, i will want to add that an AI criature run away from the user.
    other criature only run away if the user has more than 500 life points...
    and i saw the video, will be great to have two greatures figthing each other until they see the user and run away if he has more than 500 life points or keep figthing each other.

    in a future game i will need diferents attack strategys based on differents attacks,meele rangered etc...
    this work with rangered weapons?
    there is a turret system package out there,with this my i control a turret like agent?
    may i be able to set differents leaders (always AI) and make other AI follow him and attack to the enemys around the leader?

    A*... in one game my world is a 3D world, there are some forniture around but except for that the agent can walk every where... i want the user click on a position and the agent go there in a intelligent way, with out touch the forniture or other agents, is this posible?

    i think this is more than enougth for now :)
    thanks!!!!
     
  31. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937

    Basically, everything you just asked for is 100 % possible. For retreating, you can control at what point the AI will retreat. It works in "odds". For example, if you had the AI's "odds" for retreat at 2, he would retreat when the odds are twice against him. The AI calculates these odds by adding up all the health points and damage of his opponents. There are both melee and ranged abilities. You could make the ranged unit more likely to retreat, which gives him a more ranged style behaviour. And yes, this AI could be used as a turret. You would just make his move speed 0 and make him ranged. The "Companion" feature makes the AI follow a leader and support him, just simply check off "Companion" then assign the "Companion leader". And yes, the built in pathfinding is very powerful, if waypoints are properly placed, he will avoid all obstacles, and navigate to his ordered location intelligently. Hope this all helps, and thank you for your interest.

    Robert Weaver,

    Brilliant Game Studios.
     
  32. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Have you ever wondered what the world looks like through the AI's eyes? Well this is the closest representation you will see.
    Today I accomplished multiple level Navigational mesh building. The Mesh builder now builds on multiple levels up and down.


    How you see it(Mesh Renderers)



    How the AI Sees it(Multi-dimensional Navigational Mesh)

     
  33. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    Have been away from computer for a few days, and first thing I looked at was this thread - can't wait to see the new update! Animation list will be awesome! Random "wander" paths: awesome! Navigation generation: awesome! Can't WAIT for the new update!!! :) Good list of new stuff, Robert!!! Love it! :)
     
  34. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Thanks! Some exciting stuff is coming for sure. ;)
     
  35. KarelA

    KarelA

    Joined:
    Dec 30, 2008
    Posts:
    422
    I cannot understand how i managed to miss this amazing product. I bought it right away and it took me 90 minutes to read trough 15 pages.

    Do you have any plans on to make fighting look more natural? A system when one AI attacks then other one tries to dodge the attack and vice versa. Right now i have my own system that i coded a while back. http://www.youtube.com/watch?v=FOWCdQBi_Zs

    It works like a puppet master system. When two characters get together then computer randomly chooses one to be a master and other as a puppet. The master will randomly play list of fighting animations. (does not matter if this is an attack or defense). The puppet will listen the master and samples its animations. Then the function will check and if the attacking animation is playing then defense animation is triggered on the puppet and vice versa.

    Of course this system comes with its own set of problems. The biggest one is that you cannot make 2 vs 1 fightings look natural. I think that Total War series may use similar kind of system because if you look very closely at their battles then you will never see a scenario where 2 or more AI are attacking one enemy at the same time. Even if there are bigger groups vs smaller groups then unoccupied AI will stand in place until their animation is triggered. http://www.youtube.com/watch?v=QOXX2me6950&feature=related
    and http://www.youtube.com/watch?v=iTHu1ECocOs&feature=fvwp

    This kind of fighting in battle may be not natural but in Total War series where there are so much stuff going around anyone hardly notices it.

    Keep up the good work. :)
     
    Last edited: Apr 25, 2012
  36. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hey. Thanks so much for your input. Thats a really neat fighting system you came up with. Although, here are my thoughts on total war fighting. I really believe the fighting system is a bunch of fancy motion capture animations to make them look smart. I think they have many different pre programmed and animated events in their fighting. This needs to be like this so that the AI can run on a really massive scale without the complex decisions of combat with collision based damage and what not. The AI I have designed is an attempt to have an AI script that just 'Works' in most typical senerios that its thrown into. Its not perfect, but it gets better everyday. :) PS, in the next update, all animations will come in lists, and they will all be able to be randomized.
     
  37. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    I actually think that Total war used very simplistic melee fighting AI, take a look at their mocap videos you will notice that melee fighting are about animations not about complex code. When units are close enough two units are "engaged" in combat and then just mocap animations play.

    I would personaly vote for collision fighting system like seen in Mount and blade. Basically the system that brilliantgames developed is at the momment good enough for this kind of fighting, but with making collision fighting it would expand this package on other game genres too (RPG).
     
  38. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    This is something that I would like to dive into. The only reason I'm a bit hesitant, is that it will take the user much longer to set up. I would probably have to make it on a separate script or even a separate package. I don't want this package to be too overwhelming. My goal is cover as much important ground work for this style of AI as possible. Which is why I have been working very hard to perfect the pathfinding for the next update. I do really want collision combat, but it may have to be a separate expansion package. Hope this helps. PS, your game is look great Janpec, keep up the amazing work.
     
  39. burnpsy

    burnpsy

    Joined:
    Apr 14, 2012
    Posts:
    107
    This looks amazing, will definitely pick it up as soon as I can, but I have one question.

    My current project has a rather major emphasis on flight, and not only would some enemies need to be able to fly, but I have to make it so allies follow the player character into the air when the player takes flight. How much would I need to mess with this AI to tell certain enemies and allies to fly/jump when appropriate?
     
  40. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    So your characters fly? Like hover? Or like super man? If you wanted them to point at the player and go up if the player is above them, you just have to take out the line of code that disables them from pointing up or down.
     
  41. burnpsy

    burnpsy

    Joined:
    Apr 14, 2012
    Posts:
    107
    Well, that certainly sounds easily - I'd just have to look for that line when I pick this up and set it up so they go up/down toward the player if their Y positions are too far apart...

    There are some that are like Superman, and some that are just outright birds. The flight ability will mainly be used to reach high places or cross large chasms, since my game will have platformer elements, to an extent, so yeah.

    ...Though the thing with the chasms means I should probably add something in so that they too fly across the gap if there's no way to walk across and the player just flew across it.

    Thanks for the quick answer.
     
    Last edited: Apr 26, 2012
  42. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Well, unfortunately, when I designed this AI, I never had flying in mind haha. But I'm sure this package will give you a great start. Once you dive into it, give me specifics in detail and problems you are having and I will do my best to give you solutions.
     
  43. burnpsy

    burnpsy

    Joined:
    Apr 14, 2012
    Posts:
    107
    Will do. Thanks!
     
  44. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    I agree withh brilliantgamestudio. I prefer a basic pack plus additional packs for specific purposes. Trying to add lot of features in a single pack could be hard for some of us to customize it in our own game. I think this could also be the right approach for brilliantgamestudio to earn money from his everyday's efforts. Just my 2 cents!:D
     
  45. poboczny

    poboczny

    Joined:
    Sep 25, 2010
    Posts:
    553
    How about when flying - aouto dismount, fall on the ground and ground approach by an enemy as well ?

    So just a triger to dismount for start ?

    And a pack with a lot of content to costumize might fill everyones need.

    Like the Ubrin begins I hope. - I hope that everyone will find something for himself ?

    cheers :)
     
  46. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Thanks for the feedback guys!
     
  47. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Been working hard on pathfinding. Impossible to say when the next version will be released. But I hope soon!

     
  48. Scanmaster_K

    Scanmaster_K

    Joined:
    Nov 27, 2009
    Posts:
    43
    Hi, I have a few questions?

    How tightly integrated is the pathfinding into the ai part?
    Can the pathfinding system dynamicly generate navmeshes?
    Do you have a demo of the development kit to test?


    Thanks
     
  49. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Are you wanting to use the pathfinding separately? This would be easy to do, all you would have to do is give the navigation script a target, then for your AI make his target the 'nextway' from the navigation script. Unfortunately the path finding is not very dynamic with this current version. It is baked waypoints. The next version coming out will have far more advanced pathfinding, which will include, a navigational mesh builder, smooth pathing, and dynamic obstacle avoidance. As well, the next version will have many other more powerful features and fixes, because of all this there will be a price change though. And right now the only way to test this without purchasing is to play the mini game. You can find the link for it on the first page of this thread. Hope this helps.
     
  50. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Hi there,

    Recently purchased the AI package and been doing what is suggested in the tutorial scripts but a few questions remain. Hopefully these are easy as they are pretty basic.

    First of all my game has multiple players which are spawn dynamically and also i spanw the enemy (AI) dynamically - put both player and enemies inside a prefab

    Right now i am trying to have some basic AI working. I followed your steps from the tutorial thread and some stuff is working but some is not.

    1) I added the team script to my player character and set it to team 1. my enemy character has a team of 0. I was expecting that the enemy would chase/attack the player?! I have set the navmesh as per instructions (set navmeshtarget on my player character and change the setting on the enemy script but the enemy is just doing some waypoint cycles.

    2) how does health work? Current my player can fire bullets and these hit the enemy but don't think they damage the enemy (to be clear the enemy is the AI ).

    Any help on these would help me get moving.