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. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    yes there is a Break in nav Mesh but not everywhere , those stopped creature and other creature which move pass by them have same move location that is inside a compound and those break are walls of compound . so there is one way from which they can enter the compound , but some of them don't and when i disable the agent it starts to walk . may be something internally in ice stop to work there and when i disable agent it finds and enable it and then starts to move
     
    julianr likes this.
  2. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,108
    I get why you are doing that now. How are you making the walls with obstacle avoidance, or an invisible wall with a mesh, set to static?
     
  3. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    I got many Buildings and wall in That Area Which Offcourse Are static , Now I Bake the Nav Mesh And Then i disabled The Parent Object of the walls and buildings To clearly See the nav Mesh , Enable or disable Its same because nav Mesh Is already Baked
     
  4. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Got A temporary Solution By Enabling the DeadLock And Setting It To Update . Now Whenever Those Creatures Don't Move They Trigger The Update (My be position Update To Get New Position) The Problem Is Solved Now But As Said Its temporary , god kn:Dws Whats Happening There
     
  5. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,108
    I think it may be ICE, but there is probably a solution that is better than what you have added. After contacting Pit and with the posts we have put down should help further investigate. I had the same issue when the target destination was beyond the scope of the available navmesh, so it would just walk along the border of the navmesh until it got there, which didn't look good. So really if it cannot reach it, it should maybe go a different route. Maybe try switching DeadLock prevention on and the action to update, and tweak the settings there.
     
  6. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Got New Problem Whith One of Those Creature , It Stopped at Stopping Location I mean just Before The Move location I mean The Agent Stopped but The walk Animation Is playing , I clicked on Info And it Says at bottom that active mode is Walk , so its in walk And Playing Animations but Still not Moving to Move Location which is inches Away So its in A dead Lock , now Dead Lock Triggers it gets updates As i can see the white line changing in debug but move position Is Not Changing . So Again No Use Of Deadlock in this Condition Where It Stops moving at stopping distance . W t Fuzzz , i am tired now .OMG:confused:
     
    julianr likes this.
  7. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,108
    I have to go, but I'll pick this up again in the week, until then maybe Pit can resolve it for you.
     
  8. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Ok No Problem Thanks For The Help . And Pit Didnt Reply Fast :D So i will msg you for further info
     
  9. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Impressive Bug , Creature In Deadlock With Update As Option Selected in Dead lock But Upon Update Creature Don't Get New Position . And Stuck in Deadlock For Ever

     
  10. moria15

    moria15

    Joined:
    Feb 25, 2011
    Posts:
    390
    Greetings.. like the package so far. Am using it with RealisticFPS. Have followed all the import settings.

    I noticed back on around page 26 of this thread that you had an RFPS and ICE demo package.. is this still available as I would like to double check all my settings and things before going further and on clicking the link it 404's.

    Regards
    M
     
  11. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    Good afternoon. After adding define symbols (ICE_PUN) A lot of errors have appeared. What to do with them? We can not continue to work. Can you solve them?
     

    Attached Files:

    • ice.jpg
      ice.jpg
      File size:
      275.9 KB
      Views:
      321
  12. Gamarray

    Gamarray

    Joined:
    Apr 21, 2017
    Posts:
    4

    Hi @icetec,

    I'm doing all that already, but still the position of the sensor is the center of the creature itself, not the one I'm setting as the position.

    Is there a demo scene or something using the dynamic visual sensor position that I can use as an example?

    Thank you!
     
  13. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    @icetec - Lots of folks will need that parameter though, an easy way to just check, with one setting, as an AI agent "Am I being damaged and by whom". Here is another example - right now you cannot intuitively make an NPC with ICE, that is neutral unless attacked - lots of scenarios where you are going to want NPCs that can stand and stare another player in the face, 2 feet away from them, and do nothing unless the player attacks them, then the NPC reacts. Without that parameter, it just doesn't seem possible, or too convoluted. It also seems counter intuitive to try and have to explain every time on Skype to someone who wants to set this up via a bunch of non-intuitive steps rather than make it simple on the ICE end with a drop down option. Per the last 20 years of 3d games, an AI agent shouldn't need to SEE a player that is attacking it from range in order to realize it is happening and do something about it. The simplest games from way back when still have AI that doesn't stand around and do nothing while being killed just because their back is to the player and they are standing out of range.
     
    Last edited: Nov 21, 2017
    TonanBora and Mad_Mark like this.
  14. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    I have a neutral character !! Pit helped me with this personally. So this is EXACTLY possible to do in this asset!
     
    Mad_Mark and Tethys like this.
  15. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    384
    Can you share the steps or prefab settings? That would reduce the number of wheels that need to be re-invented!
     
    Tethys likes this.
  16. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    No problem. For a couple of hours, lay out the screen settings.
     
    Tethys likes this.
  17. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    Neutral character. (dealer)
     

    Attached Files:

    lawsochi likes this.
  18. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    Who had such a problem after switching to a new version and how did you solve it? problem. Mobs were fully tuned and worked well in terms of moving around the world. BUT after the transition to the new version, they began to stand still. and a little began to twitch. It feels like they're stuck. The speed of animation and the speed of movement are set. house, purpose also equipped. Maybe there is a new settings option about which I do not know?
     
  19. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    These screens don't really have anything to do with a Neutral Character that will attack if attacked - this is just an AI agent with no instructions. You have shared some disabled interactor for an AI where when the AI has 0 health when interacting with the Player, they do Attack behavior and go to a broken act. :/ You would have to be showing us the interactions and missions and behaviors for an NPC that is neutral unless attacked. This is just a character that just stands around doing nothing but the Idle animation. Anyone can of course do this simply by adding the Ice Creature Control script to an agent and then not setting up anything but an Idle animation so it has no instructions. Thanks for responding though, E for Effort heh.
     
    Last edited: Nov 22, 2017
    lawsochi likes this.
  20. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,108
    Did you import over the original ICE? or delete ICE first then import the new one?
     
  21. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Better this, than Skyrim's "must be a rat/my imagination" circus act. :p
    Can't tell you how silly it is to play Skyrim, kill a bandit while sneaking, and have his buddy, who is standing right next to him and even talking to him, pull out his weapon, walk around a bit, then say "must be my imagination" even though his buddy is laying dead on the floor with an arrow sticking out of his forehead...

    But yah, some default ICE way for an AI to detect who is attacking it would be nice.
     
    Vondox and Tethys like this.
  22. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Hey Bro Can You Help Me integrating ICE With RFPS , I am at Dead End Nothing Works When Shooting And Attacking, I want To Damage The Creature When Attacked By Gun by Player And Damage the Player When Attacked By Creature . For Now Nothing Seems To Work .Plz Anyone Help Me Setting That Up.:(
     
  23. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    I deleted the folder and then imported it again.
     
    julianr likes this.
  24. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Hello Pit I am In Much Trouble As I am Not Able TO Integrate ICE with RFPS, Time Is Running Short As The Deadline For My Project Is Near All Is Set But The Core Of My Game That Is Killing The Creatures And Get killed By Creatures Is Not Working . I am Constantly Trying To Shortout Other Problems With Ice And Some Get Fine But This Is A Dead End For Me Please Help Me and Other Who Are Facing The Same Problem With RFPS, Atleast Make A tutorial Not Too Long May Be 5 Minutes On RFPS Integration , But It will Really Help A Lot ,In The Mean Time Trying to Shot Out Other Problems.
     
  25. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Hmm, I don't have RFPS, but I might be able to give it a shot.
    I am going to need some information about your setup though.

    Does RFPS have its own creature script that controls things like health? If so, are you using that, or are you just using ICE?
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,703
    You don't know what you're getting into. ;-) RFPS's damage system is a bit convoluted. It's probably easiest to let ICE handle all the AI, and just worry about how ICE creatures damage the player. The player has a script named FPSPlayer with this method:
    Code (csharp):
    1. public void ApplyDamage ( float damage, Transform attacker = null, bool isMeleeAttack = false )
    If for some reason you want an ICE-controlled player to damage an RFPS-controlled NPC, RFPS NPCs have a script named CharacterDamage with this method:
    Code (csharp):
    1. public void ApplyDamage ( float damage, Vector3 attackDir, Vector3 attackerPos, Transform attacker, bool isPlayer, bool isExplosion, Rigidbody hitBody = null, float bodyForce = 0.0f )
    There's also a LocationDamage script for location-based damage, but you can ignore that unless you need to track location-based damage.
     
    julianr and Tethys like this.
  27. crimsonmortis

    crimsonmortis

    Joined:
    Feb 21, 2016
    Posts:
    60
    Has anyone used this with Voxleand5? Looking for AI that works well with voxels.
     
  28. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    No I will use Ice To Control The Creatures With All Essentials Like Health Etc , But I will Use RFPS For Player , So As Tony Said we just have to worry about how to apply damage From RFPS To Ice And ICE to Rfps player Which Got This Apply Damage Function To Get Damage "public void ApplyDamage ( float damage, Transform attacker = null, bool isMeleeAttack = false )" As Tony mentioned,
    Now For RFPS player to Damage Creature it Uses This A Function Named " void HitObject ( RaycastHit hit, Vector3 directionArg, bool isSecondCast = false ){" Which cast Raycasts To Find If Its hitting a rigid body and if the ray Is hitting A rigid body and If its a creature Then It calls another Function named same"ApplyDamage" But this Time On Different Script Named CharacterDamage() Which is On The Creature to apply damage .

    So Now How to Integrate all This With ICE To Work Properly.
     
  29. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Just Got It A few Days Back , Didn't Tested Yet
     
  30. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    We use ICE on our voxel based procedurally generated terrain. Actually, one of the reasons we use ICE is it doesn't require nav mesh so perfect for procedural environments. Just make sure to set your tag and layer for the terrain mesh and then use raycast on the ICE motion and pathfinding, set the layer you used for terrain mesh and the creatures walk find. Obstacle avoidance and tags and layers also important to set up.
     
    crimsonmortis likes this.
  31. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Could you not create a simple damage handler script then?
    Have the ICE creatures send an "RFPSDamage" message with a float parameter to the player, that gets handled by the handler, which in turn, calls the FPSPlayer's Damage method.
    Since the attacker, and isMeleeAttack parameters are optional, this makes it easy.

    That is how I integrated ICE with Opsive's Third Person Controller, and Opsive's is FAR more convoluted:
    Code (CSharp):
    1. override void Damage (float amount, Vector3 position, Vector3 force, float radius, GameObject attacker, GameObject hitGameObject)
    :p
     
    Last edited: Nov 25, 2017
    TonyLi likes this.
  32. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi Pit,

    1) Pooling issue
    I added a spawn condition, and set up max creatures to 7, but it creates lot more instances and do not re use deactivated ones.

    The plugin should never be able to instanciate more than the maximum pool number we entered whatever other settings values or options.
    I think there is a bug (IceCreatures 1.4 and Unity 2017.2.0 f 3 ).




    2) Options target selection disabled and not usable
    Selection criteria like FOV or Visibilty Check are always disabled and can't be used ?
    Also did i miss something about last update ?

     
    Last edited: Nov 25, 2017
  33. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Go to STATUS, then scroll down and enable Sensora. Everything should show up then. :)
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,703
    That should work.
     
  35. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Thanks.
     
    Last edited: Nov 26, 2017
  36. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    ICE confirmed this bug and said he was fixing that and a few others. We are all now eagerly waiting the update. I also noticed that when using an Attack as Act 2, it will only fire off once. If your animation is set to loop if give the FALSE ILLUSION that the attack method is running - it is not. There is a bug or something missing. I learned this because I use some of the extras in the act, like the Target Event. When my creature goes from Run in Act 1 to Attack because they are now in range, they only fire the method ONCE. After that they stand there looking at the agent and will never attack again unless I move out of range, then they attack again, once and then freeze. If @icetec is going to place methods within the act, then the act needs to be able to loop on as a whole. You can create the illusion that it is running in a loop by looping some things manually, but this is also not complete - the act should be looped as a whole (or given the option to) rather than looping all the individual methods. It becomes a problem when the creature dies and they are still firing off the attack target event even though the agent is dead and play has moved out of range. You can confirm this your selves simply by making sure your attack animation is not looped. Set up a run and attack act on an interactor and you'll get the same thing. Just did this was 6 new AI agents. They all stand around and do the same thing after attacking once and will never attack again unless player moves out of range so that it initiates the act again. Maybe the behaviour used to loop and now doesn't because something changed? For such a complex asset, a lot of the simple things are broken or don't work as intended. Frustrating. We got all these bells and whistles for all this extra stuff lots of folks wont even use, but we don't have simple functionality like "Am I being attacked" check. :/
     
    Last edited: Nov 26, 2017
  37. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I agree, simple behaviours can become hard to make in IceCreatures sometimes.

    For example here is some behaviours i don't know how to do it :

    1) A creature pursue the player once it is detected (range, field of view, visibility), and i would like the creature to always stay in pursue mode and always know the player position once it detected player a first time

    2) If a creature looses player detection like out of range, i want it to idle some random time between 1 and 5 seconds, after that move to a random position during 1 or 5 seconds. And get that sequence loop until it could detect the player.

    3) AI able to make different combo attacks, or some random attacks, randomly blocking with percentage priority

    4) when many AI in front of the player, other AI try to circle around the player

    5) AI lauching and using projectiles , one fire or automatic. It must be some bugs as i get it worked before 1.4 update.

    Those are pretty simple behaviours i don't know if it is possible. It's sad because the plugin seems to have huge potential.

    We should have small video tutorials examples about common characters behaviours, otherwise many users won't be able to use the plugin for their needs.
    Or have some voting list about tutorials we would like to have.

    I'm waiting for Esmerald AI next update , it's not based on rules and behaviours so it's more limited but it is easy to use and focused on characters. Perhaps Ice Creatures bug fixes will come soon and perhaps we'll get more video tutorials focused on characters behaviours.
     
    Last edited: Nov 26, 2017
    Tethys likes this.
  38. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep, for characters AI you will stay with limitations as some other plugins.
    The only way to get AI behave in very specific ways you need and in your game context is to code it yourself, or use plugins like Behaviour Tree or FSM.

    About IceCreatures, each time i come back trying to use it, i can't figure how to make specific AI, when it's different from general and common behaviours examples or tutorials.
    The choice of using AI plugins or plugins like FSM or BT depends on your needs, if you only need basic AI or very specific AI behaviours.
     
    Tethys likes this.
  39. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    Yeah I rolled my own AI about 1 year ago for Astral Terra and thats whats been live in our game ever since. Its complicated though and doesn't have pooling and also isn't particularly efficient or optimized, and every time I want to make a change it takes a lot of time and I have to do it manually to all my agents(everything is driven by FSM). The ironic thing is, all I want is basic, simple and efficient, pooled AI thats responsive and doesn't require Nav Mesh(which ruled out Emerald AI a long time ago). HerdSim does basic AI very well but its hard to move beyond the very basics they have included. The other ironic thing is personally, I LOVE ICE, I love all the options, all the potential. Its a robust system and once you know the basics you can get creatures wired up and walking pretty quickly and the developer is not limited to using Navmesh, so many motion and animation options here. All the stuff within a behavior or act is also great, lots of things we can set-up when its working. IMO, ICE just needs refinement and some adjustments(hence me also sticking with it since launch even though its not live in either of our 2 projects).

    I have a melee weapon setup on one creature and I did notice that you have the option to send commands to inventory items within an act or behavior. I'm tweaking it now as I have and axe setup on one mob but it damages things as we walks into them since the script is always active right now. Going to change it so that it only activates when hes attacking. You might try setting your ranged weapon up with the ICE ranged weapon script and see if you can activate it through the Act or behavior.
     
    Last edited: Nov 26, 2017
  40. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Here, try this:
    Code (CSharp):
    1. using ICE.Creatures;
    2.  
    3. ICECreatureControl m_ICE;
    4.  
    5.     void Awake(){
    6.         m_ICE = GetComponent<ICECreatureControl> ();
    7.         Debug.Log(m_ICE.Creature.Status.Durability);
    8.         Debug.Log (m_ICE.Creature.Status.DurabilityInPercent);
    9.     }
    Durability is the creature's health. You can use the "InPercent" version for things like health bars and such.

    You also have:
    Code (CSharp):
    1. m_ICE.Creature.Status.SetDurability(10);
    If you want to set the creature's health directly. :)
     
    Tethys likes this.
  41. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Like this?


    :p

    Just to see if I could, I integrated GKC (Game Kit Controller) with ICE, so that ICE creatures can damage the GKC's character, using the following method:
     
  42. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    Nice! I tried something similar a few weeks ago but had the wrong attribute. DOH! Thanks! I ended up just rolling a custom damage handler that bridged my system with ICE.
     
  43. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I am not sure you need Ice Plugin to make so basic behaviour.

    Glad you got it working.Last time i tried it didn't worked for many reasons i could not understand.
    Anyway, i had other issues with the plugin as unable to create specific behaviours.

    The biggest issue about the plugin because it is not so easy or not intuitive to use, it lacks video tutorials showing how to make common AI behaviours used in diverse games genres.

    This is the most frustrating, many custom behaviours i want to make are eay to code or make using some Behaviour Tree, While i can't figure out or it seems not possible with ICe Creatures plugin lol
     
    Last edited: Nov 27, 2017
  44. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Ok Guys So Now my Ice Creature Is Able To Damage My RFPS Player Without Any Other Script Or Modification . But Now I Need To Figure out How To Make RFPS Player Damage The ICE Creature . Anyone Got Any Ideas On that
     
    TonanBora likes this.
  45. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Hmmm So Nav Mesh Didn't Go Well As Its Buggy For Me . the Internal path Finding Is going great But how To Make my Creature Avoid from overlapping On Each other And Avoid the Trees On the Terrain
     
  46. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    492
    Are you using actual game objects for bullets?
    Or is RFPS raycast based?
     
  47. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    662
    I found something the other day that needed to be tweaked maybe in code. In the test case its MOBS targeting Players. I have Animation on Loop and Audio and Damage timed to the animation. I am using Target Events with a custom method for damage, set on an Impulse Interval. I dont want to set a limit but have set an Interval to match the animation for outputting this damage. Everything is great until the creature dies. While playing the death behavior, and even sometimes after the animation is even done, it will do one last loop of the damage impulse from Target Events. I have tried setting an advanced parameter on the Act such as Owner Health > 1 or OwnerIsDead to False - both do not prevent a last loop of the damage interval. Maybe the Target Event method is not checking that advanced parameter set from the Target Selection? Maybe it doesnt check state before the loop fires? I tried a workaround by putting the damage output interval in the attack behavior instead of the interactor, but realized it isn't possible because I cannot set the same target used in the interactor in the behavior, and trying to set the specific Target in Priority is not possible because it does not let us choose tag as the target. I'll probably roll with it for now until someone has a suggestion or ICE tells us it's something needed to be tweaked in code.

    ** Also found a bug. In an interactor, if you set the move specification type to Other Target, and then set the target an Ice Creature (one that exists in the scene as well), the act breaks and the creature instead follows the target of the interactor rather than the set, valid, Other Target.
     
    Last edited: Nov 28, 2017
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,587
    First of all, that's irrelevant because Pit was already making the integration and had assured us it was coming in the next major version.

    Second, I'm fairly certain you have no factual data on how many people use Apex that might also use it with ICE.
     
  49. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    123
    Ya RFPS is RayCast based and I Don't no How to Get It To Work For Damaging Ice Creature , I Hope Someone Soon make it To Work
     
  50. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    109
    Hi guys/gals,

    I just picked up Ice and I am trying to integrate it with Protofactors forest animals. I have the stag setup to move around nicely but I have not had any luck with getting him to orientate correctly to the ground. i.e. he is not always parallel to the ground when the ground is sloped.

    Any pointers? I also picked up FinakIK but have not used it yet at all. Should it be handling this? Thanks!