Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Fantasy AI 2.0 [RELEASED]

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

  1. Pirogun

    Pirogun

    Joined:
    Dec 1, 2012
    Posts:
    31
    Also how is the combat system for the Dynamic Navigation asset?
     
  2. Wordsmith

    Wordsmith

    Joined:
    Dec 22, 2012
    Posts:
    8
    Would you mind if I made a game based almost entirely on the protect the crystal minigame? I mean I plan to edit it a lot, different maps, characters etc but keep with the minigame idea. Incredible work by the way. :)
     
  3. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Any character system should be compatible with Fantasy AI. All thats really needed for the AI to interact team and health script, as well as the correct collision layers.

    Yes that is what its there for!
     
  4. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    Hi, I purchased Fantasy AI, I have a few questions:

    How does this work when game is paused using Time.timescale = 0; Will Fantasy Ai pause as well. If not how do I pause it?

    Will there by any erros when I destroy the Fantasy AI gameObject using unity's Destroy after it's been killed?

    Will navigational mesh work with stairs, will enemies will be able to pathfind through stairs to higher location?
     
  5. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Hey. Yes, everything in the AI script is based on time, they will freeze. And yes pathfinding will work on stairs. The included navigation you will have to manually place the waypoints though. If you want a huge upgrade in pathfinding you should take a look at Dynamic Navigation, its directly compatible with Fantasy AI. http://forum.unity3d.com/threads/154639-Dynamic-AI-Project-Navigation-Released
     
  6. Venged

    Venged

    Joined:
    Oct 24, 2010
    Posts:
    500
    I bought the Dynamic Navigation and can't wait to integrate it with my other assets this weekend. You have been on a roll putting out some the most useful assets on the Asset Store.

    Thanks!
     
  7. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Well thank you. :)
     
  8. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    Sorry because you've probably answered this a million times but are there any instructions anywhere about how to set-up your own player? I've been trying for several hours with little luck. Many thanks :)
     
  9. Oksana-Iashchuk

    Oksana-Iashchuk

    Joined:
    Sep 10, 2012
    Posts:
    126
  10. Venged

    Venged

    Joined:
    Oct 24, 2010
    Posts:
    500
    I upgraded to Unity 4 Free a recently. I downlaoded FAI 2.


    1. Why are the skeleton sword so huge and skeletons not rendering? Is this just a change to the Dark Crystal mini-game or am I missing something?

    2. Do the collision layers 8 and 9, Waypointcollisonlayer and aicollisionlayer, that you have setup have to have those names. I have another asset my current project that are using those layers as ground and obj (what ever that means to that asset). Do those layers have to have the names you choose for them?

    Thanks

    Robert
    AKA Venged
     
  11. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    More specifically the character which I have made into the player is moving but his animations are not working because the animations are on another gameobject within the player hierarchy. How can I fix this?
     
  12. andrydeen

    andrydeen

    Joined:
    Aug 11, 2012
    Posts:
    37
    Hi brilliant, i cant find a way how to use character with mecanim animation , it use a animator controller and Fantasy AI use animation clip.
    Thank you
     
  13. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I apologize for my absence on this thread as of late. I have many projects on the go. The things that are required when setting up your own player are the following.

    1. Your player must have the Team and Health scripts attached.

    2. Your player must be set to the 'Character' collision layer.

    3. Its often best to actually attach an AI script to the player and disable. The reason for this is so that you can assign an 'AI eye'. The 'AI eye' is an empty game object placed at head level where the AI will point its raycasting vision. The reason why this can be necessary is because if there is no AI eye, the other AI's will direct their raycasts at the default axis of the character model. Sometimes the default axis on a character model are located at his feet. This means small obstructions like rocks can block their vision.



    Yeah there are a few bugs with the mini game on Unity 4, but the AI scripts themselves are fine. Collision layers are not required to be named anything specific, however tags are.


    Fantasy AI was designed before mecanim was made. However there could be a potential future update for that. ;) You could make a script that simply asks what animations are attempting to play, then play your mecanim animations accordingly.
     
  14. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    Looks like everything is working well now, the way in which I was going about setting up the player was slightly wrong. Was such a simple mistake I was making. :p Thanks.
     
  15. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    Actually I have another problem, the player seems to be working with animation but it seems he cannot deal damage and the enemies do not deal damage to him/acknowledge that he is there other than avoiding him if he gets in the way. The player is tagged as "character" and shows up on the enemies list of enemies once the game has started. :/
     
    Last edited: Feb 19, 2013
  16. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    Fixed it. :p
     
  17. technotdc

    technotdc

    Joined:
    Oct 21, 2011
    Posts:
    60
    :D
     
    Last edited: Mar 7, 2013
  18. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    @technotdc Saw your message yesterday but wasn't able to get on the computer so I couldn't answer your question properly at the time. Have you got everything working now? :)
     
  19. technotdc

    technotdc

    Joined:
    Oct 21, 2011
    Posts:
    60
    working ¡¡¡¡¡¡:D


    thanks
     
  20. Mattmakesgames

    Mattmakesgames

    Joined:
    Apr 26, 2012
    Posts:
    108
    Cools :)
     
  21. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    I'm having a problem with enemy pathfinding and Dynamic Navigation (I'm using it instead of fantasy ai's nav mesh).

    1. Enemies frequently try to go through walls when in attack mode - when they go on a patrol they find path easily, but when they attack my player (me) they often have trouble pathfinding in tight corridors - it's dungeon crawler type of game.

    2. When they go on a patrol, when they reach a specified patrol target, they start going around it in a circle, instead proceeding to the next point - they just go around in a circle around a cube with grid position script on it.

    3. They also have trouble finding Navigation Portals - there's a portal to let them go through doors, but instead they try to go through walls.

    Here's a sample of my grid and level:

    $1.jpg $2.jpg
     
    Last edited: Mar 8, 2013
  22. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    hey there brilliantgames, check your PM! :D
     
  23. NikoBusiness

    NikoBusiness

    Joined:
    May 6, 2013
    Posts:
    289
    how can you update it to v2 if you have the lower version?
     
  24. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings BG.

    Unfortunately, out of the box neither of these systems will work for us, as we need true dynamic path finding (we cant create a navmesh beforehand on the terrain because it is procedural). That being said, I remember seeing a page with tutorials from the tornado twins on how to set Fantasy AI up. I thought there was a video in there for implementing a different path finding solution. I cannot find this repository of videos though. Is there truly such a thing? :) I want to figure out if I can implement A Star Pathfinding pro with this package as it has a dynamic waypoint system. Our issue is we cannot have any kind of waypoint system that has to be set up and paths associated before hand. Need a system that will allow for waypoints to be distributed at run time and the ai be able to read those waypoints and get to patrolling them once they are spawned in. It seems like A* Pathfinding Pro will do this - now just need the right AI to go with it. If your interested, I would be willing to pay for some hours of development to add this to your system as well, rather than combine it with another. Anywho, just throwing ideas out there, if you have any suggestions I am all ears. :) Thanks again for your support!
     
    Last edited: May 17, 2013
  25. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Hello,

    I have a problem when using this AI in my game. Because I'm building a strategy game, I need to remove objects from my scene (dead units for example) as it's getting to crowded during game play. The problem is that the AI freezes in the moment dead units are removed from the game.

    Can you please help me solve this problem, as otherwise I can't use this system.
     
  26. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Did you check out the help page? Theres a download link for the 'destroy ai' script. That properly handles AI being destroyed.
     
  27. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Thanks a lot, but I 'm a real newb as I still didn't understand how to call a component from another script.
    How I do it here ?

    I tried :

    AIDestroy other;
    other = gameObject.GetComponent("AIDestroy") as AIDestroy;
    other.destroyai();
     
  28. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    You need to access the script component.. Its a bool. other.Destroyai=true;
     
  29. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    I think now it works, at least no more compiler errors. But during game play it says that a Transform was destroyed but a script still tries to access it.
    The script is the AIDestory with the line :

    AI aif=(AI)ai.friendly[f].GetComponent("AI");
     
  30. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    There actually may be a few problems with this script. I will update it tonight!
     
  31. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    I bought this and can't get the navigation to work. I followed the tutorial but when it comes to building the navigation mesh, the log says it's built but there is no visible segments like on the video. I copy it, stop the game, delete the old one paste the copied one, check the bake waypoints box and hit play. Nothing happens.

    I bought your Dynamic Navigation, followed the instructions for setting up the grid the characters, hit play the characters dont move or interact, even though they did before I started all the navigation stuff.

    Can you help please? I'm running the latest version of Unity Pro.
     
  32. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Is the script updated now ? Thank you.
     
  33. wmgcata

    wmgcata

    Joined:
    Jul 20, 2012
    Posts:
    169
    I'm wondering, can the player also attack with ranged instead of meleeing? Could anyone tell me, thanks.

    Tim
     
  34. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    It sounds like you have a some sort of large collider hidden in your scene. Could be a triggered collider. Best way to test this is copy and paste all your models into a new scene and see if it works then.

    Yes of course. You can use the projectile script that comes with Fantasy AI. Attach the script to whatever projectile your player shoots. As well its very easy to implement something yourself. Get the health component of the object your projectile is colliding with and put something like collidingai.currenthealth=collidingai.currenthealth-Damageyouwanttodo;
     
  35. Mohamed-Adly

    Mohamed-Adly

    Joined:
    Jun 15, 2013
    Posts:
    1
    What is the performance cost when using Fantasy on iOS or Android?
    Did anyone try it on mobile ?

    need your help.
     
    Last edited: Jun 20, 2013
  36. cyangamer

    cyangamer

    Joined:
    Feb 17, 2010
    Posts:
    234
    Hi I have a question about the projectiles used: is there a way to change where the projectile hits the target? Because right now the arrows always go towards my player's feet (which is where the pivot point is, so it makes sense). It'd be nice to put some headshots in there instead. :p

    Second point: It appears that bots can see clearly through terrain and other colliders... is that supposed to be the case?

    EDIT: Nevermind on both counts. I created an invisible cube to act as my player's "AI eye" attached a defunct AI component to it, and now the system works great.
     
    Last edited: Jul 9, 2013
  37. CaptainChristian

    CaptainChristian

    Joined:
    Apr 3, 2013
    Posts:
    100
    I cannot get the default ranged prefab to work. The error I get is object reference not set to an instance of an object in rangedaddon on line 33. It's this one: if(ai.attack){}. which means it cannot find AI, which is actually attached to the same gameobject. Please advice.
     
  38. unior

    unior

    Joined:
    Jul 17, 2013
    Posts:
    3
    Please make video tutorial about (Player Controller) setup!!!
     
  39. cyangamer

    cyangamer

    Joined:
    Feb 17, 2010
    Posts:
    234
    I'm having another issue - this time with the NavMesh generator.

    No matter where I put it, whether terrain or ground-tagged floor, my navmesh will build but my waypoints won't bake. All of them are always singled out.

    Has anyone gotten navmesh generation to work in Unity 4?
     
  40. RayWolf

    RayWolf

    Joined:
    Mar 24, 2012
    Posts:
    87
    Hi!

    This Asset is a real good one but there are some minor issues with it:

    1. Right now Im using a weird setrup for my character controller and camera, it works but its yeah..weird lol. I am using the RPG-Controller available in the Asetstore for the camera and movement stuff and the fantasy AI for the attack-anims. I ran into collission detectionm problems because fantasy AI works with capsule collider and rpg-controller-asset dont like this.^^ So hell yes, It would be great to get more instructions about the playxer setup like unior mentioned!

    2. I watched 4 videos (youtube) which explained the NavMesh Usage in Fantasy AI and what shall I say..Im stuck at the waypoint-baking section of it. Wont work right. One single time I get it to work but cannot repeat this small success here...:/ I also have viewport problems here, the I call it helper-objects (green) wont disappear ..no matter what Im clicking in the Inspector (no Im not in play-mode^^). So alright, give us more instructions about the whole NavMesh Usage please.

    my best regards,
    Ray
     
  41. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    @brilliantgames

    In all the videos I've watched and demos played, I noticed none of the AI have pain animations. Is the functionality there to assign a pain animation when an AI is hit?
     
  42. RayWolf

    RayWolf

    Joined:
    Mar 24, 2012
    Posts:
    87
    coz Im no programmer and the fact that there is no easy way in fantasy AI asset to do this:

    I simply made a copy of my HeroCharacter and this copy has one anim on it..the getting hit/hurt/pain anim. So Im switching the standart mesh of for this moment when he got hit (lifevalue is chaning..regenerate=off) the copy-mesh with the single anim is shown. This is working fine for me this way. Im using playmaker alot to switch between the States.

    regards,
    Ray
     
  43. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    Thank you for trying to help, RayWolf! But I've PM'd brilliantgames about this; baffled that in 45 pages no one asked for a 'got hit' animation! :)

     
  44. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
    it is very esay to implement...
    there is a script that alredy is being executed when you or an ai get hit... just add the code there...
     
  45. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    I would... if programming was my field :)

     
  46. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
  47. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
  48. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I apologize for my lack of presence on this thread. I have been all over the country and have had some family emergencies. I believe most of the questions have been answered through PM. If there are any unanswered questions. Please PM me here and I will try my best.

    Regards. Rob. Brilliant Game Studios.
     
  49. Noah-Essa24

    Noah-Essa24

    Joined:
    Apr 17, 2013
    Posts:
    9
    Please make this a plugin for UniRPG, that would be wonderful!
     
  50. agent_Macgyver

    agent_Macgyver

    Joined:
    Sep 1, 2012
    Posts:
    36
    any chance you can help primus88 and myself with this AIDestroy problem? I still recieve an error on line 22 that a transform cannot be accessed...