Search Unity

[UPDATED] ICECreatureControl v1.4.0 - creature AI for enemies, animals, monsters, zombies ...

Discussion in 'Assets and Asset Store' started by icetec, Aug 11, 2015.

  1. farooq-gill

    farooq-gill

    Joined:
    Oct 8, 2016
    Posts:
    13
    Thanks sir, it worked. Don't why it wasn't working earlier when i did almost the same i guess :p
     
  2. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Andy, I'm sorry for this. It's a known bug, based on a missing [XmlIgnore] tag. This issue is already fixed and if you let me know your order number, I'll send you the update link.
     
    AndyNeoman likes this.
  3. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Andy,
    you need to define interactors. Interactors are GameObjects your creature will interact as soon as the specified conditions are true. Here you can find a small tutorial which handles the relationship between two or more creatures (or other GameObjects such as your player )...


    In this way you can handle also the plants you herbivore creature can find and eat (check the collect tutorial to lear more about this topic) but in addition you could use also the Environment section to define surface or collision events, so your creature can detect specific textures and/or collisions and could run it eating behaviour.

    Hope this will be helpful so far but please feel free to contact me whenever you have a question or runs into a problem with ICE.

    Have a great day!

    Pit
     
    Crashnblake and AndyNeoman like this.
  4. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Paulo, the current version 1.1 can handle this topic by using external weapon systems but version 1.3 supports ranged weapons directly and comes also with own weapon scripts. In v1.3 weapons are item objects your creatures can find and pick-up, so your creatures are able to equipt themselfs during the runtime. To search cover you can define interactor objects which will be used if your creature is under attack (e.g. if your creature is wounded or its stress level its extremly hight). In v1.3 you can also define sub-targets your creatue can use while a specific main target is active.

    btw. I'm current updating all the adapters so you'll get also a new UnitZ adapter ...

    I hope my answer will be helpful to you but please feel free to contact me whenever you have a question or runs into a problem with ICE and in urgent cases you can contact me also via skype.

    Have a great day!

    Pit
     
    arnesso and antoripa like this.
  5. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Miroku,

    please deactivate the 3D flag, so the distance will be determined over-ground by ignoring potential level differences, so the TargetMovePosition of your launcher should be grounded, also make sure that the internal Gravity of your creature is active, because it seems a bit that your arrow launcher will be affected by additional forces.

    If you are using ICE with additional (motion and/or physics controller) components, you have to make sure to avoid interfering forces. A typical case will be a non-kinematic RigidBody while using ICE with its internal Motion Control (here ICE tries to move your creature to the given TargetMovePosition, while the physical forces of the RigidBody compel your creature in another direction). Another source of interference could be an undesired root motion which could affect the movements of your creature as well. ICE supports such additional features, so you can use ICE absolutely with a non-kinematic RigidBody, a Character Controller or NavMeshAgent and Root Motions as well, but in either case the setup of the used components have to be concerted.

    I hope this will fix your issue, otherwise it would be helpful if you could prepare a small video which demonstrates this issue and if you want you can contact me also via skype, so we can fix it in real-time if required.

    Have a great day and sorry for the late response!

    Pit
     
  6. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks Pit,

    I will send you a message. I also have a question regarding levels.

    The problem i have is setting water. I want my animals to go to waters edge and drink when thirsty but the same to do it whereever they choose instead of waters edge. I think it is because I use Aquas and have one large plane under the terrain apart from areas for lakes,rivers etc.

    So I was wondering if you could set the interacter to a height. I.E water table level is 86. so animal will always go to 86 height to perform drink interaction. This would make them at the waters edge anywhere on my map. Also stopping them going below 86 would keep them out of water.
     
  7. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Andy, in v1.3 you could solve this issue with custom water layers and the GLIDER feature which allows your creature to swim, dive or fly but also to change their vertical level (for this you can use the given ground level, zero or any custom level). I'll contact you later via pm.

    Have a great day!

    Pit
     
    wood333, magique and AndyNeoman like this.
  8. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    When does come 1.3 out? And why did you not released a 1.2 version before?!? Confused...
     
  9. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    Hey,
    Sorry for latee reaction to this, but I have tested it just now.
    Well I added my XP code ( levelup.experiencePoints = levelup.experiencePoints + getxp;)
    But I have a little issue, When the NPC is dead the XP constantly increasing , so it add the in every sec, until the creature status is dead . ( I tried something with time, but not worked) I know it is not too hard, but i could solve it.
    So I would need the xp would be added only once,
    Idea guys ? :\
    Thank you :)

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4. using ICE.Creatures;
    5.  
    6. public class GainXP : MonoBehaviour {
    7.     private LevellingSystemCSharp levelup;
    8.     public int getxp; /// How many xp will you get if you kill
    9.    
    10.     /// </summary>
    11.     // Update is called once per frame
    12.     void Start(){
    13.         levelup = GameObject.Find ("FPS Player").GetComponent<LevellingSystemCSharp> ();
    14.     }
    15.     public void Update(){
    16.  
    17.         // get the control ...
    18.         ICECreatureControl control = GetComponent<ICECreatureControl>();
    19.         float time;
    20.  
    21.         // evaluate if the creature is dead
    22.         if( control != null && control.Creature.Status.IsDead  )
    23.         {
    24.             // compare the tag of the active target
    25.             if( control.Creature.ActiveTarget.TargetGameObject != null && control.Creature.ActiveTarget.TargetGameObject.CompareTag( "Player" ) )
    26.             {
    27.              
    28.                 levelup.experiencePoints = levelup.experiencePoints + getxp;
    29.      
    30.             }
    31.         }
    32.  
    33.     }
    34.    
    35. }
     
    icetec likes this.
  10. farooq-gill

    farooq-gill

    Joined:
    Oct 8, 2016
    Posts:
    13

    This is how i solved this problem

    bool scoreAdded = false;
    ....
    ....
    ....
    if (scoreAdded == false) {
    scoreManager.score += scoreValue;
    }
    scoreAdded = true;

    so do it for your program. This should be easy.
     
    icetec likes this.
  11. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Very much looking forward to 1.3. :)
     
    icetec likes this.
  12. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    Thank you for your help, here is th working GainXP script :)

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4. using ICE.Creatures;
    5.  
    6. public class GainXP : MonoBehaviour {
    7.  
    8.     // Use this for initialization
    9.  
    10.     private LevellingSystemCSharp levelup;
    11.     public int getxp; /// How many xp will you get if you kill
    12.     bool xpadded = false;
    13.  
    14.     void Start(){
    15.         levelup = GameObject.Find ("FPS Player").GetComponent<LevellingSystemCSharp> ();
    16.     }
    17.        
    18.     public void Update(){
    19.  
    20.         // get the control ...
    21.         ICECreatureControl control = GetComponent<ICECreatureControl>();
    22.  
    23.  
    24.         // evaluate if the creature is dead
    25.         if( control != null && control.Creature.Status.IsDead && xpadded == false  )
    26.         {
    27.             // compare the tag of the active target
    28.             if( control.Creature.ActiveTarget.TargetGameObject != null && control.Creature.ActiveTarget.TargetGameObject.CompareTag( "Player" ) )
    29.             {
    30.  
    31.                 levelup.experiencePoints += getxp;
    32.                 xpadded = true;
    33.             }
    34.         }
    35.  
    36.     }
    37.  
    38. }
     
    icetec and farooq-gill like this.
  13. ebizcraftsman

    ebizcraftsman

    Joined:
    Dec 10, 2015
    Posts:
    20
    Hey Pit,

    I am trying to get UFPS working with ICE 1.3. When I change my bullet message to Unity and ApplyDamage, the creature is damaged and dies, BUT

    When I use the Target Event to send damage to my player, nothing happens. I switched it from HeroWeaponsHD.ApplyDamage to HeroWeaponsHD.Suicide and my player instantly dies. So it seems to be sending the message. But the ApplyDamage float does not do anything to my player.

    PLEASE HELP :)
     
  14. KingLlama

    KingLlama

    Joined:
    Jul 18, 2015
    Posts:
    199
    I also am having issue similar to this issue. My character dies and then doesn't get noticed by the other respawned zombies. Also The damage being applied to the zombies it is only 1.5 damage and when I change it reverts back on play. Its quite strange.
     
  15. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    May I ask where you got the 1.3 version? The asset store version is still 1.18 ?!? Or does the asset being sold somewhere else?
     
  16. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    164
    Need a way to apply damage to creature`s health, or maybe even a method to instantly kill it.
    Can someone please give me a syntax of SendMessage for damage?
     
  17. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I bought ICE months ago, and keep hearing the release soon, yet no release. The last update was nearly a year ago. it would be better to release smaller features, than wait a year to release a ton. just saying so it can put some of us to rest...

    as I keep hearing release soon, but no release.. Hope to see it before the end of the year...
     
    icetec and Tethys like this.
  18. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Ebizcraftsman,
    while using the target event to affect the damage of your UFPS player you have to use 'Damage' instead of 'ApplyDamage' ... simply activate the 'CUSTOM' flag, enter 'Damage' as custom method, select FLOAT as type and adapt the desired damage value. In addition to that you could define the interval which will be used to call the damage event, otherwise the event will be called uniquely if the target will be selected.

    Have a great day!

    Pit
     
  19. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Silvermurk,
    here the requested code example ...

    Code (CSharp):
    1.  
    2. ICECreatureControl _control = GetComponent<ICECreatureControl >();
    3.  
    4. if( _control != null )
    5. {
    6. // use this with the desired damage value ...
    7. _control.ApplyDamage( 10 );
    8.  
    9. // ... or this to kill your creature instantly
    10. _control.ApplyDamage( 100 );
    11.  
    12. // ... or
    13. _control.Kill();
    14. }
    15.  
    alternative you could do also this ...

    Code (CSharp):
    1.  
    2. ICECreatureControl _control = GetComponent<ICECreatureControl >();
    3.  
    4. if( _control != null )
    5. {
    6. // use this with the desired damage value ...
    7. _control.Creature.Status.AddDamage( 10 );
    8.  
    9. // ... or this to kill your creature instantly
    10. _control.Creature.Status.AddDamage( 100 );
    11. }
    12.  
    Have a great day!

    Pit
     
  20. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Devision4,
    v1.3 isn't official published currently but you could send me your invoice number via pm to get the current release candidate.

    Have a great day!

    Pit
     
  21. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
  22. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    164
    Works perfect, thanks alot, and another thanks for links)

     
    icetec likes this.
  23. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Recon, you are right. I know that I have to shorten the update periods, but as already mentioned the current update contains more than some new features. Large parts of the code was rewritten to open the structure for current and future developments and there was no practicable way to do this within smaller steps. I’m sorry for this and I’ll try to provide more minor updates instead of such complex ones in the future.

    Have a great day!

    Pit
     
  24. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    164
  25. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    Oh ok, ya I don't read every post, hard to keep up with every asset, so sorry if I missed that post, glad you explained it and I do understand and that is great news, do you have an ETA on release ? If not that is fine, just an idea , as I'm beta releasing soon and was hoping to get ICE in this beta/

    Thanks.
     
    icetec likes this.
  26. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Recon, no worries! A frist release is already available, if you send me your invoice number via pm, I'll provide you the latest version.
     
    recon0303 likes this.
  27. ebizcraftsman

    ebizcraftsman

    Joined:
    Dec 10, 2015
    Posts:
    20
    Have you made any updates to 1.3 since you passed it out to everyone? I see a lot of the ToDo areas noted and just wondering if the copy I have is the freshest. If not, can you send me a link to it.

    thanks again and also thanks for replying about my UFPS damage problem. Going to try it out when I get home.
     
  28. ebizcraftsman

    ebizcraftsman

    Joined:
    Dec 10, 2015
    Posts:
    20
    TZYalcin and wood333 like this.
  29. Jacky_Boy

    Jacky_Boy

    Joined:
    Dec 8, 2013
    Posts:
    95
    @icetec Can you please release the Adapter for TPC 1.3 in the time being. I've been waiting for over a month now. I recall you saying by the end of October ICE update would be released but since you're jumping to ICE 1.3 I iunderstand you need more time. I do need an updated adapter for TPC 1.3 because the current one gives me errors. Thanks
     
    icetec likes this.
  30. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    UI is over complicated, spent 3 hours so far, Ai just walks to a cube then nothing...
     
  31. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Having put in a lot of hours myself, I recommend that you mimic two video tutorials. Do the tutorial about the wizard (the one with the cave trolls). Then to get some action happening, mimic the video up above on this page of the thread. The one with the skeletons. You can have skeletons fighting and chasing each other without much difficulty, and I think then you will have a sense of progress with this asset.
     
    Crashnblake, icetec and llJIMBOBll like this.
  32. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey Thanx, I will take a look tomorrow :D I really would like to use this AI System, really like the fact it doesn't require nv mesh :D

    Thank You Jimbob
     
    wood333 likes this.
  33. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    yes sir, is nearly done ...
     
    Jacky_Boy and Crashnblake like this.
  34. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Jimbob, don't worry ... looks more complecated as it is, the most settings are optional and only required in special cases ... for the beginning all you need is to understand Targets and Behaviours. The best here is to follow the suggestion of Wood but please feel free to ask whenever you have question or runs into a problem with ICE.

    Btw. If your creature is already walking to cube, you could increase the Random Positioning Range and activate 'update on ... ACTIVATE and REACHED for example, so your creature will using dynamic waypoints. Activate also the debug features to see the gizmos and to visualize your settings.

    Have a great day!

    Pit
     
    llJIMBOBll likes this.
  35. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Pit you can record a short video how to configure what you wrote. The player could cause damage to other players and creatures. Similarly, the creatures that could kill the player. ( ufps multieplayer ) I think many useful.
     
  36. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Has anyone set up the damage?; player-player / player-creature/ being - the player. Write details how to configure the screens send. (UFPS)
     
  37. farooq-gill

    farooq-gill

    Joined:
    Oct 8, 2016
    Posts:
    13
    how one creature can damage another creature?
     
  38. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I'm wondering could you add some prefabs, like some ai that will attack another ai/ player, I cant work out how to make the ai ttack the player

    Thanx Jim
     
  39. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Jim,
    if you are using ICECreatureControl v1.1 with your own player script you have to create a custom damage script. The best way here is to check the current behaviour of your creature and send the damage if the desired ATTACK behaviour is active.

    Code (CSharp):
    1.  
    2. ICECreatureControl _control = GetComponent<ICECreatureControl >();
    3. if( _control != null && _control.Creature.BehaviourModeKey == "ATTACK" )
    4. {
    5.     if( _control.Creature.ActiveTarget != null )
    6.         _control.Creature.ActiveTarget.TargetTransform.SendMessage( "Damage", 5f, SendMessageOptions.DontRequireReceiver );
    7.  
    8.     // -... or ...
    9.     if( _control.Creature.ActiveTarget != null && _control.Creature.ActiveTarget.TargetGameObject.Tag == "Player" )
    10.         _control.Creature.ActiveTarget.TargetTransform.SendMessage( "Damage", 5f, SendMessageOptions.DontRequireReceiver );
    11.    
    12.     // -... or ...
    13.    
    14.     if( _control.Creature.ActiveTarget  != null )
    15.     {
    16.         MyCustomPlayerScript _player = _control.Creature.ActiveTarget.TargetGameObject<MyCustomPlayerScript>();
    17.        
    18.         if( _player != null )
    19.         {
    20.             _player.YourPlayerDamage( 5f, _direction, _force, _attacker, etc. );
    21.         }
    22.     }
    23.  
    24. }
    if you are using UFPS, TPC, UnitZ, RFPS you can use one of the included adapters, also you can use the adapters to learn more about the damage handling.

    If you are already using ICECreatureControl v1.3 you can use the integrated target event handler to call the damage method of your player. The new version also comes with an improved player script which handles the damage of your custom player automatically.

    I hope my answer is helpful to fix your issue, but please feel free to contact me whenever you have a problem and in urgent cases you can contact me also via skype. Btw. if you want you can already work with the latest version of ICE, simply send me your invoice number via PM.

    Have a great day!

    Pit
     
    Crashnblake likes this.
  40. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    When is the new version out? Also my guys tend to get stuck just running into walls trying to get me, it would be good if there was some awesome working AI prefabs as suggested earlier in the thread. The menus too are quite intimidating after all these months even, but I think I am going to bite the bullet and read the full docs :) thats why I want to know if theres an imminent one that is different, great asset most of the time for me.
     
  41. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Pit , you have not answered. Can you write more details how to do it all and make screenshots. Or record a short video. ?
     
  42. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Alex, I'm currently working on a demo scene which should answer all damage related questions. The named scene covers melee and ranged weapons (incl. turrets) and will be part of the ICECreatureControl v1.3 package.

    Here the webplayer of the Energy Bar Toolkit Adapter demo ...

    I'll prepare a small video which shows how to handle damage ...

    Have a great day!

    Pit
     
    Tethys, antoripa, julianr and 5 others like this.
  43. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Thanks , email me please. I have everything working apart from the damage to the player
     
  44. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I seem to be getitng very high cpu usage (30%) from SetupCoroutine.InvokeMoveNext() , any ideas? pretty sure my guys are constantly getitng stuck in deadlock.
     
    Alex3333 likes this.
  45. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Pit , when will be ready the scene (video)??? A week has already passed -((
     
  46. ebizcraftsman

    ebizcraftsman

    Joined:
    Dec 10, 2015
    Posts:
    20
    Piiittt!!!

    Come Back buddy! Seriously, need some help with the UFPS damage and attack animations. The monster just gets stuck and the damage is not working..

    PLEASE PLEASE youtube video step by step with a 4-Legged Monster attacking and getting attacked by a UFPS character along with a Biped Mecanim character attacking and getting attacked.

    My project is at a stand still since I implemented 1.3 .. PLEASE HELP :)
     
    Alex3333 likes this.
  47. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39
    Hi,

    I have a problem, i'm using a navmesh to navigate my Ai's with ice.
    I have a building 2 stories high and when i am on the second floor the AI's hit threw the walls, they also hit and target me when i'm on the same level as the AI's.

    I tried turning on visibility check and that did the trick but now when the ai's attack me, the attack animation get's stuck, really weird animation. i tried changing all sort of settings and values but i can't get seem to get this to work.
     
  48. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Where Is The Pit ??? It took half a month!! And no response -(((
     
  49. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Dion,
    because of your NavMesh issue you can find a NavMesh Tutorial already in the beta version of v1.3 ‘TutorialNavMesh’ which covers exactly your scenario.

    If you are using the NavMeshAgent you should deactivate the internal Obstacle Avoidance and the Overlap Prevention to avoid conflicts with the NavMesh navigation and also the OffMeshLink options of the NavMesh. Furthermore activate the Stopping Distance 3D Button, so the creature will heed the level differences within a building.

    To use the Visibility Check (or rather all the Sensoria options) it’s the right way but make sure that the ‘Eye’ position will be adapted correctly. To avoid quickly swaps between behaviours you could favour your ATTACK behaviour to make sure that your creature will use this behaviour at least for the specified time (btw. while using the beta of v1.3 you can defines also a retaining time for the interactor directly, so the given target will stay active for the specified time-span also if all the conditions will be false).

    I hope this will be helpful so far but please feel free to contact me whenever you have a question.

    Have a great day!

    Pit
     
  50. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Alex! Hi ebizcraftsman!
    I haven't forgotten you and will provide you the mentioned clip asap but please let me finish the update first – it’s not so much to do anymore but due to additional obligations my days are currently very long and I can't rest easy until the update is officially online. If this is done, I'll do a jig and will spend the rest of the year to provide you more tutorials and videos and especially a more quickly support.

    Have a great day!

    Pit
     
    Crashnblake and julianr like this.