Search Unity

ICode (AI For Mecanim 2.0)

Discussion in 'Assets and Asset Store' started by DevionGames, Dec 18, 2013.

  1. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    There was a problem with some example links in the new update, so i just wrote a small hot fix package for this. Please follow the instructions here.
     
  2. MikeTon

    MikeTon

    Joined:
    Jan 10, 2013
    Posts:
    57
    Did an update and all the in Unity example scenes are gone. Any way I can still get acess to them?

    Thanks.

     
  3. Teejay5

    Teejay5

    Joined:
    Feb 26, 2010
    Posts:
    106
    Yoo, whenever I add the system to my project, I get this error:


    $airuntime.PNG
    "error CS0101: The namespace `global::' already contains a definition for 'AIRuntimeController'"

    This happened in two projects, and didn't happen before the update. Any ideas?
     
    Last edited: Mar 17, 2014
  4. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Hi, please delete the AI System folder before importing the new version.
     
  5. maurogarcia

    maurogarcia

    Joined:
    Nov 6, 2012
    Posts:
    12
    Hi, Zerano
    I updated to 1.3, now I have this error in all my previous controllers...
    . $error.png
     
  6. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
  7. maurogarcia

    maurogarcia

    Joined:
    Nov 6, 2012
    Posts:
    12
    ok, I installed the examples, but they have new controllers.
    I've been working in my own controllers starting from your 1.2 version
    it’s mean, if I want use the 1.3 version I lose all my previous work?
     
    Last edited: Mar 20, 2014
  8. Mmmpies

    Mmmpies

    Joined:
    Feb 19, 2014
    Posts:
    31
    Hi Zerrano,

    Started getting a new error this morning:

    The same field name is serialized multiple names in the class or it's parent class. This is not supported: Base(Follow) applyRootMotion

    Get the same error twice more but replace the "applRootMotion" for "animator" and "agent".

    Anyway I noticed there was an update and tried to download it to see if it fixed the error, it downloaded suspiciously fast. When it came to the import screen there was only 1 line (....\SetInteger,cs), I then tried the Update Manager within unity and it did slightly better with 3 lines (SetInteger.cs, GetProjectedVelocty.cs and UpdateManager.cs).

    Any idea what's causing this or is there another link I can try for the new update?

    Thanks
     
  9. Mmmpies

    Mmmpies

    Joined:
    Feb 19, 2014
    Posts:
    31
    If I search in files for this project in monodev and look for applyRootMotion I get a few things back. I've deleted all non essential files (like samples that include that var and got it down to 2 files.

    Movement.cs and Simple.cs

    They do both serialize applyRootMotion, animator and agent. Movement inherits from Simple and Simple inherits from State.They are both stored in Scripts/States/NavMeshAgents

    If doubling up on serialization is not allowed according to Unity then the best guess I have is that the, frankly bizarre, update issues I'm having have somehow left me with files from 2 different versions, but that's only a guess.
     
  10. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    There is only one Simple state now, best way is to just delete the AI System folder and import the new version.
     
  11. Mmmpies

    Mmmpies

    Joined:
    Feb 19, 2014
    Posts:
    31
    Hi Zerano,

    Something very strange happening, I deleted the package completely (I deleted C:\Users\Me\AppData\Roaming\Unity\Asset Store\Zerano and removed it from the project I'm currently using) then downloaded it directly from unity, I didn't use the downloaded button I just searched Unity Asset Store for AI and downloaded it directly. The only thing it installed was the scripts folder.

    The console is now just saying Assets/AI System/Editor/Update/CheckForUpdates.cs(37,65): error CS0103:The name 'Update Manager' does not exist in the current context.

    Currently completely unable to use AI or my project at the moment.

    Can't understand how this is happening.
     
  12. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Do you have any other scripts then the AI system in your project.(Another class called UpdateManager)?
    Can you try to import this package and let me know if the error still exitst:

    UpdateManager.unitypackage
     
    Last edited: Mar 23, 2014
  13. Mmmpies

    Mmmpies

    Joined:
    Feb 19, 2014
    Posts:
    31
    Thanks Zerano,

    Don't know what was causing it but I just created a new project and imported the AI System and Ratkin Army only and it looks like it's working, I think what made me panic is the original download had all the examples included so it took up a few hundred Mb, when I downloaded the latest it only has the scripts and only takes up a few hundred Kb. Sent me into panic mode as it then got the error as well.

    If I track down the asset that caused the conflict I'll update in case it helps anyone else.
     
  14. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Yes i removed the assets, so you do not need to download them if you only use the ai system without the examples and integrated a donwload manager for the examples.
     
  15. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Hey,

    I'm doing and enjoying quite well with AI System.

    It's good and works fine at the moment, even I extended and modified it for my personal purpose to support legacy animation system with some other various actions.

    I'm afraid that there may be duplicated or redundant work which will be at the future release of AI System.

    So, it would be good if you share the road-map of AI System, if you have any.

    And what's the next update will be?


    Best,

    -Kim
     
  16. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Hey i do not have a real roadmap, what i would like todo in the future is to create more examples and i am sure with new examples there will be new actions, states and conditions.(2D, 2,5D, rigidbody based examples...)
     
  17. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    I'm interesting in your TDS Prototype

    Are you going to Release it? Did you use a Mecanim AI?

    And I look forward to the demo RTS Battle
     
    Last edited: Mar 25, 2014
  18. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    The TDS Prototype was created earlier and the ai is hardcoded, but you can create the same ai(or even better) with the AI For Mecanim asset. I can not release it because i simply do not have the art assets to make an example.
     
  19. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    UFPS Example - the Robot AI Controller appears to be missing. The MineBot is fine. Could you please update the example. I'd really like to learn from this.
     
  20. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Sorry the Robot AI Controller was taken from the IK Examples and used in UFPS. So if you import the IK Examples you should have it.
     
  21. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    The Robot AI doesn't seem to do any damage. I see that the minebot just spawns an explosion. I thought it would be doing some Melee Damage. Do you have examples with the damage as well (preferably both ranged and melee).
     
  22. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    I have a video showing how to create ranged and meele damage in UFPS:



     
  23. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Cool, thanks! Appreciate the extra videos. I thought I was missing something in the examples you provided.
     
  24. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Is there any way to get access State.owner or BaseCondition.owner instance in the StateInspector class?

    State.owner member field is non-serialized object, so it is always null in a editor script.

    How can I get to access the gameObject of current selected state in a editor script such as StateInspector class?


    -Kim
     
  25. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    It is not possible, the system/AIController was made to work in diffrent scenes, so you can not access scene objects in editor mode.
     
  26. daven8989

    daven8989

    Joined:
    Jan 25, 2014
    Posts:
    29
    Hi Zerano.
    I have a question, when in a state of AI controller, i add an IEnumeration, when this IEnumeration ends but the state machine is still in that state, the IEnumeration don't start again right? Because i have a problem with my zombie, when he attack, he play a lot of time the sound effect of attack.
     
  27. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Do you marked the action as queue and added a WaitForSeconds action? If the queue is finished it will restart it again.
     
  28. uansgheps

    uansgheps

    Joined:
    Dec 5, 2012
    Posts:
    11
    Hi Zerano,
    when I start Unity and I'm not connect to internet your chek for update component correctly fails, but it fills of errors my console:
    You are trying to load data from a www stream which had the following error when downloading.
    Could not resolve host: zerano-unity3d.com; Host not found
    UnityEngine.WWW:get_text()
    <Run>c__AnonStorey7:<>m__1D() (at Assets/AI System/Scripts/Editor/Update/CheckForUpdates.cs:32)
    ContinuationManager:Update() (at Assets/AI System/Scripts/Editor/Examples/ContinuationManager.cs:34)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Is it possible to handle this Exception without throwing those errors?
    Thank you

    Edited: I read now your request for using your support forum, I will use it for next questions, sorry.
     
    Last edited: Mar 28, 2014
  29. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Yes going to fix this.
     
  30. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    Can you tell me or at some point do a tutorial on how to trigger events to send messages back to game objects? That is assuming you can do that with your plug in
     
  31. popawheelie

    popawheelie

    Joined:
    May 27, 2013
    Posts:
    23
    Hi Zerano,


    Regarding line of sight, I was wondering if its currently possible for the character to hide behind a gameobject with a collider. I thought I had this working before, but I can't seem to recreate it.

    cheers
     
  32. Apiweb

    Apiweb

    Joined:
    Nov 26, 2011
    Posts:
    57
    Version 1.3 is still in beta?
    Would have an approximate date when the final version come out?
     
  33. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    Guys Zerano is still out with a death in his family. He should be back soon though.
     
  34. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    Sorry to hear that, I was wondering why I hadn't heard back from him. I am in no big rush so I will wait for his return.

     
  35. VeTaL

    VeTaL

    Joined:
    Jul 2, 2012
    Posts:
    125
    Hi,
    would this AI works good with a Photon?
     
  36. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    You can use SendMessage action to send a message to the owner or a gameobject that you have assigned before to a parameter. This is realy not that hard. Just use the SendMessage action with a custom parameter or without. To send a message with a parameter use the parameter type to define the parameter you want to send.

    Yes this is possible of course, you have to define the correct layer mask in the LineOfSight condition. Just remove the enemies layer and use the equals field to check if the enemy hit something.

    It will still take some time. The earliest time when it goes out of beta will be, when i have integrated it with the rpg kit and made more tests and bugfixes.

    The ai will not work out of the box with photon.
     
  37. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    I would really like to see how you would implement a ladder for the AI to go up and down, and a jump zone for the ladder to jump over a gap using your system and Astar pathfinding. I see you have a cool example using 2D for jumping over the gap. I'd really like to have an example for 3D. I tried for many hours to make your 2D work in 3D with Astar pathfinding, but couldn't.

    End goal - have AI chase player up a ladder because it's the shortest route. Have AI jump over a defined gap because the player does that.
     
  38. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Well it is possible with the build in NavMesh, but i still need to make something similiar for the AStar package.
     
  39. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Could you explain how or make an example please.
     
  40. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Well for the NavMesh you just create regular OffMeshLinks, which works only on unity pro as far as i know. For the AStar project i would still need to make this integration.
     
  41. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    What's the intended use case for the Animator CrossFade action? I could have something set up incorrectly, but it seems to me that it's starting the cross fade every frame, which has the effect of sticking to the first frame.

    The documentation doesn't really tell me anything, and I downloaded one of the examples but it doesn't seem to use the CrossFade action. Any pointers?

    Edit: I just made another AI state system that just has two states with crossfades and they work as expected. So my guess is that I've got the transition happening each frame somehow.
     
    Last edited: May 9, 2014
  42. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Actually, there's definitely something odd going on...

    Cross fades with duration set to 0 work fine, in that the correct animation state gets set. Cross fades with durations greater than 0 cause animation to stop. Not sure where the issue is.
     
  43. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Thanks, i will test it. However the next update is almost finished and will change the worklfow a little bit. I removed the queue option from the actions, because it was making to many bugs and strange behaviuor, however it will be still possible to make the same timed execution using states and everyFrame option in the actions.
    The new update will contain
    - clean execution of states and actions
    - tooltips for the action and condition fields
    - you will not need to drag the AIRuntimeController script on the game object, just drag the new called "StateMachine" asset(AIController renamed to StateMachine)
    - Predefined StateMachines that you can just drag into the working editor window and it will place the states, paramerer... into the working StateMachine.(So no need to create same states for diffrent StateMachines)
    - Global and local(action fields, condition fields) parameters will be clean (Not more defined by a string and attribute)
    - Easy to extend actions and conditions.
    - You can use it not just for the ai but also for other things like character control, rts unit control, game control. So it is not longer only an AI System, but still more focused on that.
    -ObjectParameter for diffrent kinds of assets(AudioClips, GameObject, Transform,Materials...)
    -Conditions for all global parameters
    ....
     
  44. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    I bought the package. But there are no example scenes. I don't understand what I have to do to make my enemy behave like in the demo.
    Where are the example scenes from the description?

    Thank you.
     
  45. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    I just sended you the link with examples.
     
  46. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Can i get the links with examples ? Thanks

    NB:
    I use an old AI_System_1_1b . When i update it with AI_System_1_3_2b , i have this error message:

     
  47. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Please delete the AI System folder and then import the update.
     
  48. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Will this break the custom actions/states/conditions I've already made?

    I did notice that the guts of your state machine architecture is incredibly similar to what I've written for my character control system.

    On another note, I imported the updated package and have run into an issue where I can't open the AI Controller editor any more. The AIs are still working, I just can't open/modify them.
     
  49. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Yeah, actually, I can't open the AI editor any more at all. It's not just my existing assets I can't open, even if I create a new one and double-click it immediately I can't do anything.

    No errors are logged. Quite simply nothing happens.

    Edit: Crisis averted. No idea what it was, but it wasn't your plugin. I noticed that I also couldn't open some other windows, either. I think that what happened is that when Unity hit an error on load earlier today and asked me to reset the layout, it somehow still thought all the old windows were open, so it wouldn't open them again. Loading a new layout again seems to have got everything going again.
     
    Last edited: May 11, 2014
  50. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    I am very sorry but yes, this will break all actions, states and conditions you have made, but it will be very easy to convert the states into actions and the conditions have a similiar structure. There will be no longer multiple states, but you will be able to write state code as actions.