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

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    Im doing something similiar now. For the animation it depends how you set it up, and whether youre using direct or advanced...
    If you are using advanced with a trigger I believe there is a bug that I reported a while back that does not fire the trigger again after its fired once. You would have to replace something in the ice code to get it working. I think I posted what specifically earlier in the thread.

    Right now im using advanced with mecanim and instead of a trigger im using a bool in the fsm which in this project works better.
    For attacking again, I just set the attack behaviors link behavior to attack.
    Have you set your link behavior?

    @icetec There seems to be a bug where after stopping play mode and using animation type advanced your paramteres are not shown properly in the editor. Gives the impression that they were lost. I have to reopen the scene for them to show.
     
  2. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Wow, that's just a totally incorrect usage of that. Animation looping means to loop the animation, not repeat the function for which the animation is being played for.

    OK, I'll give that a try.

    Any ideas why the creature doesn't loop the idle animation when not attacking?
     
  3. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Thank you! Will give this a try today.
     
  4. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    What are your import settings for the animation?
    And the settings for the Idle Behavior?
     
  5. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Nope, you can use Final IK for any pathfinding motion.
    My issue is just with using the Root Motion on animations to prevent characters from sliding around.
     
  6. darkcser

    darkcser

    Joined:
    Oct 3, 2016
    Posts:
    10
    Basic tutorial question:

    I've been trying to follow the basic tutorial with the rhino (http://www.icecreaturecontrol.com/forum-news/?view=thread&id=18).

    I've set the essential to quadruped, and added the animation component with run/walk/eat/etc. but the behavior tab shows odd truncated dropdowns when I try to select an animation.

    upload_2017-7-17_13-46-5.png

    I've also tried to reset the behavior, and just add Run but same issue
    upload_2017-7-17_13-49-55.png

    ICE 1.3.6
    Unity 5.6

    Did I overlook something?

    Thanks.
     
  7. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Yah, I have encountered this annoying bug before.
    Try removing all the animations from the Animation component, and then re adding them.
    This seems to only happen with Legacy characters, and the Animation component.

    So you could also try to change the Rhino to generic, and use the Mecanim animator controller on it.
     
  8. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Not sure if I posted these early videos on this forum thread, but here are some of the early AIs I created for testing:


     
    julianr likes this.
  9. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Gave this a try today in a clean project, but it throws the same errors as the latest version of A* once you enter the ICE_ASTAR define. Thanks for the link, though!
     
  10. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    That may be solved by comment out the line that causes this error just like what Tonan did in his video.
     
  11. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Yeah, that is the worse choice in this matter, but I think this may be the ICE's problem that not able to exit an animation without changing behavior, for the behaviors are called in every certain time or frames, if it replays the animations every time when a behavior is triggered, it will cause the animation to stuck in several of the beginning frames.
    I looked into the animation controller to look for reasons and I found that the attack animation stuck on the last frame for the animation itself is not looped and the creature is still in attack behavior so no exit from this animation, the creature will just stay in the last pose of its attack animation until you move out of the attack range and it changes to another behavior.
    Seems the direct animation control with unity's animator still needs some work, I'll suggest building your own animation controller and use the advanced method.
     
  12. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I have final IK too, but have little time to dig it with ICE, will be super excited to learn what you have done with them!
    I'm interested in making final IK creatures too :)
     
  13. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Did some tests, but the overhead of that full-body IK is just too much for the volume of creatures I need.
     
  14. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I've got a new problem with fishes, my fishes will sometimes swim to land and do not know where the water is.
    I don't have a water plane collider for the check though, I'm using ceto infinite ocean, the water surface can be different height on different locations, how can I let the fishes know they should stay in water?

    Edit: I'm trying to use fishes' altitude to limit them in water, for their home is placed underwater, I'll let them return to home if their altitude is higher than sea level. But then comes the problem, there is no absolute altitude option in advanced Target Selection Criteria:
    upload_2017-7-18_17-46-22.png
    This Owner Altitude is the relative altitude to terrain, totally useless in this matter.
    Anyone know how to add custom options in the selection criteria?

    Edit: I found the way to add absolute altitude as a condition
    upload_2017-7-18_18-39-22.png
    And made this funny effect for the Salmons when they swim up to land:


    Now we have a new way to fish Salmons ;)
     
    Last edited: Jul 18, 2017
  15. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Had tried that, but it's a weed. Commenting out the RVOController error just spawns another dozen errors, and so on, etc.
     
  16. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    Have you tried to handle this in a Behavior?
    Under Movement/Vertical/Operating level you can set a min/max altitude.
     
  17. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Yeah I tried, not helpful, for the fish can not swim through the terrain, it still will generate waypoints which are on shore.
    Then the fish will maintain the operation level swim to these waypoints, then got pushed up by terrain.
    By adding absolute altitude to the condition options, I can let the fishes check their absolute altitude and relevant altitude, when the former is slightly below sea level and the latter is smaller than 0.5 meter, I can assume the fish is about to be pushed over the shore, and I can assign a new behavior that let it directly return home (fishes' homes are all under water and a bit away from shore), and when they got back to the deep water, they will continue their leisure behaviors.
    I my video up there, I just made a struggling animation for the salmons for fun, and they can rush onto land, but have to jump back to water instead of swimming.
     
  18. Ryuichi173

    Ryuichi173

    Joined:
    Apr 12, 2015
    Posts:
    141
    Wow, it looks very funny! I didn't try to make "struggling" my fishes.
    Also I didn't imagine that we can make effect like that using ICE! Very impressive.:)
    Thank you for sharing video! It bring me some ideas I haven't before.
     
    Harekelas likes this.
  19. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    You will need to move those way points then! :p
    Or create new ones for each body of water.

    Or, you could try setting the Patrol Mission to Cycle/Ping-Pong, and make sure they are arranged in the correct order.
     
  20. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @TonanBora
    Is there a link to a repository for these settings established? I have just started to experiment with this and although I have one working AI character, I have no idea what the heck I'm doing, or if I've missed or misconfigured things. A decent starting point would be freakin' AWESOME! And so very much appreciated. (The website has an area that I suspect was created for sharing these, but it's nekked.

    Mark
     
    jabevan and TonanBora like this.
  21. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    I am having a problem. I don't know what I did, but now the pointers (MovePosition, TargetMovePosition, DesiredTargetMovePosition) are showing up during runtime. They are even visible after build. I have turned off of the debugs on the CreatureRegister and Ice Creature Control, but they are still there.
    I have using deer to roam around in this example and seeing the red cylinder popping up it getting tiresome.
    It is doing this with all of my creature movements.

    Can anyone help and tell me how to turn this off?

    Here is what I'm seeing during play.
    Thanks, David
     
  22. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    Does anyone know how to get a reference to all current and active ICE objects, including spawned ones, using the API?
    Or perhaps listen to some Spawn event?
    I just can't figure out the API 'documentation'.
    Code examples would be helpful.
     
  23. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Maybe spawn all of the creatures inside a group instead directly in the scene. Then list out every child in that group?

    And I go one question too: How can I set spawn max numbers for each Home location separately?
    (the home locations are prefabs and multiple home locations for one creature race can be put on map)
    Now the spawn limit seems to be the overall number limit but not for each home.
     
    sylon likes this.
  24. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    Thank you! Good idea.
    I think i'll give that a try.

    [EDIT}
    Works like a charm.
    I am using this with my own culling system, to try and optimize my characters a bit.
    But ICE GC spikes are really killing my performance anyway.
     
    Last edited: Jul 20, 2017
  25. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Glad that helps, I'm struggling with ICE's culling methods too, all spawned creatures will be put on the original point and got culled for long distance from camera even it's HOME is just beside the camera.
    Probably I'll make my own culling system too. :)
     
    Ryuichi173 likes this.
  26. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I managed to create 2 fishes' AI, one predator and one prey.

    The shark can hunt Salmons and salmons will flee when they sense the shark, but salmons are slower so the one got locked by the shark is pretty much dead for sure.
    The shark also knows to return to ocean when it hits the shore and abandon even hunting actions, so stay in shallows should be safe from the sharks.

    Now I have to add some dynamic limits to the predator and let it act more like an animal than a killing machine...
     
  27. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Has anyone heard from Pit?
     
  28. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    This is the first Ice Creature AI that I have setup. Has anyone else seen an issue where you setup a Mecanim biped through the wizard, and both its Home Location and Quick Selection bar identify themselves as "biped_name_Home"? Shouldn't the biped_name character have a quick selector of "biped_name" and the biped_name_Home object have a quick selector of "biped_name_Home"?

    I also repeat my previous question, is there a repository that contains base samples (or one working example!) of a working character's AI settings? This trial and error stuff is ridiculous for a paid asset. Although the documentation is decent and thorough, I would recommend the author consider documentation from a USER perspective, rather than from a DEVELOPER perspective. Don't just tell me what it does, tell me how/when to use it, too.

    Consider also a "configurator". Ask me 6 questions, and then build the basic shell for the 6 components. (Essentials, Interactions, Behaviors, etc.) Customization then becomes somewhat simplified. Similar to the existing Wizard, but take it to the next level.

    Mark
     
  29. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    I'm totally new to animation and am just getting Mecanim under my belt, so I apologize if this is a really stupid question. Is Final IK compatible with ICE Creature Control? If so, how? How would I include it in my pipeline if I have rigged models and state animations in Mecanim that I'm referencing in ICE?
     
  30. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hey guys I'm back with one more vid to share :)
    I tried to write my own adapter script to let ICE environment use Tenkoku's time data, and succeeded.
    Here is the result video I'd like to share:


    The stag will go to grassland from 8 to 16 and return home at night, a very simple demo, but I can add my own nature system's data into it too and make animals react to weathers and temperature as well.
     
  31. Ryuichi173

    Ryuichi173

    Joined:
    Apr 12, 2015
    Posts:
    141
    Hi, I'm a fan of this asset.

    If you want to use FinalIK with ICE, you might have to write some codes.
    And it is depend on what you want to do too.

    In other words, ICE is not "conflicting" to FinalIK but you have to be learn how to use FinalIK like when using it with Character controller.
    You can control FinalIK's from ICE with SendMessage, CallMethod, etc...

    For example, if you only interested in "grounder" provided from FinalIK, what you have to do is learn how to setup grounder component and you may not forced to write any codes.
     
    Last edited: Jul 22, 2017
  32. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    @icetec


    Was this video made with 1.3.6? Just curious since "1.3.7" was only a test upload. If it's 1.3.6, would you mind sending the cc presets for both creatures after sending you my invoice? I'd just like to learn from their behaviors and interactions.

    None of the current 1.3.6 tutorials show an example of playing a death animation (ragdolls only), and in the above video I see the ICEAllosaurus reacting to physically being bitten (colliding), rather than "pain" existing as a randomized rule that interrupts a default behavior. Like in your Interactors video (13:55):


    However, I did take the random behavior rules concept from the above video to make AI randomly stop wandering and idle for a bit before continuing. Again, it's about learning what this amazing tool can do :)
     
  33. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    I just read in the manual last night that Final IK is integrated (chapter 14). I'm curious how far that integration goes. For example, I'm using the Zombie Starter mocap package and the zombie's walk speed is not consistent, it's kind of stumbling around. So there's not speed you can set that doesn't make it look like it's skating (and checking root motion doesn't seem to do anything either). So is the integration tight enough that I can use RootMotion Final IK to fix this?

    EDIT: When I switch to the Rigidbody motion control, with Ignore Motion Control and Gravity unchecked and Kinematics checked, the stumbling zombie stops skating around.

    HOWEVER, it doesn't seem that I can do anything to keep it from running through meshes, unless I add them to the Obstacle layer which isn't practical. I have a rigidbody and a mesh collider on my creature, and have tried mesh colliders, convex mesh colliders, and box colliders on walls and objects and the creature continues to walk through them.
     
    Last edited: Jul 23, 2017
  34. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    I would definitely vote on more Mecanim tutorials with ICE too.

    In fact, if @TonanBora would do a full ICE tutorial from zero to hero (that covers Mecanim) on Udemy I would definitely pay for it!
     
    Last edited: Jul 22, 2017
    HeadClot88 likes this.
  35. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Yep same.
     
    jabevan likes this.
  36. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Hmm, I prefer just doing the tutorials, and throwing them at you guys.
    So how about a middle ground, and doing a Patreon?
    What do all of you think about that?

    Also, I am currently putting together a new tutorial for ICE, although it is not Mecanim sadly.
    It will be about having a creature "grow up" and physically change (by switching out Creatures).
    Once I am done with it, I will tackle some more Mecanim based videos that I might break up into smaller bit sized chunks.
     
    Nateply, jabevan and Teila like this.
  37. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    I would prefer a Udemy style full tutorial, but I'm not against the idea of Patreon. A monthly fee would probably require a consistent quantity of tutorials released. Maybe that's just quick 15-30 minute videos responding to the issues your patrons are having. I'd be down for something like that.
     
  38. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I'm also working on tutorials, they will be varied (basic) and (advanced) for my magazine (indiegamesdeveloper.com) - the only payment I seek is that you watch a 30 second advert at the start, or you visit a sponsor - we get some revenue in that way or get to give away some merch from our sponsor. That's all. But good to have some varied tutorials out there from various sources, which is needed for an asset of this scope.
     
    Last edited: Jul 23, 2017
  39. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Growing up is intuitive! Like to see it first, I tested the turning animations with mechanim controlled by parameters from ICE, and found it not that difficult, need more tutorials about the status and environment sectors of ICE, got to know how and when to use the dynamic status in specific cases.
     
    Ryuichi173 and jabevan like this.
  40. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    Is there any means possible (other than adding objects to obstacle layers) to prevent creatures from walking through obstacles?

    I've read forum posts and the Unity and ICE manuals, and have tried every means possible and cannot prevent it. I have a character with a collider capsule and rigidbody and obstacles that I've tried mesh colliders (the default for static objects), convex mesh colliders, box colliders, all three, etc. The creature continues to walk through them. Additionally, I added the walls to the obstacles layer, which does prevent it from walking through them, but it will follow the walls halfway in the wall.

    I also tried overlap prevention with a capsule, but that causes all kinds of weirdness. The creature will teleport around. When I click Deadlock Prevention and select Update (Die, the default, just kills him off within a few seconds), he just kinds of freaks out when approaching walls. Deadlock Prevention also causes the skating/sliding effect.

    I'm willing to look at A* Pathfinding, if it will definitively fix this issue.

    EDIT: I just added the obstacles to the Obstacles layer (made sure to hit apply) and the creature still walks through them. These obstacles are about 1m high (waist height), could that be part of the issue?
     
    Last edited: Jul 23, 2017
  41. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    @Harekelas maybe you should create a tutorial on that. I guess many of us don't find it intuitive, we'd like to know how you did that.
     
  42. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I take it that you are not using Unity Nav mesh? If you are, then you could set the obstacles to static on the gameObject and then bake the navmesh, or add in Navmesh obstacle avoidance. They will avoid them unless you specify the navmesh not to. You could also create a trigger for doors or paths that you want to cross if the door is open or avoid it but hang outside for a while if a player is in range.

    dynamicnavmesh.jpg

    5.6 has the option for dynamic nav mesh baking, but I've not used it yet. Extra download I believe?
     
    jabevan likes this.
  43. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    I'm using Rigidbody in the motion and pathfinding. I assumed I couldn't use a Unity Navmesh unless I was using Navmesh Agent in motion and pathfinding. Is that wrong?
     
  44. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    yeah, you need to specify NavMesh agent in the settings and make sure your AI has the Nav Mesh Agent, if it does not add it - otherwise it will not work
     
  45. Ryuichi173

    Ryuichi173

    Joined:
    Apr 12, 2015
    Posts:
    141
    Hi,

    I can guess a lot of cause which caused the problem.
    Sensor setting and check interval can be cause of problem.
    Addition, there are setting in the sensor section what height of obstacle can creature detect or ignored.

    Sliding problem cannot be perfectly solved by FinalIK but it may reduce the problem as you know.
    The problem is reduced by editing creatures walk or run speed, too.
    Of curse using root motion is one of solution to avoid sliding but it have some of limitations, and you may need a lot of motions for that.

    NavMesh can increase accuracy of detecting static obstacles but there are a bit of sliding bugs.
    A* was best answer for such problem, but it is expensive and you have to download old major version of it because huge update broken compatibility of asset.
     
    Last edited: Jul 24, 2017
  46. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Maybe a text workflow instead of a video tutorial?
    I'm not familiar with making video tutorials...
    1. You should have the turning animations for the creature, both left and right.
    2. Set the basic movement of your creature to one blend tree and control them through forward speed and angular speed.
    3. Make some tests to find out the actual speed of each walk/run animation and assign them into the blend tree's forward axis (say the walking is 1 meters per sec and running is 5, then assign the walking animation on the 1 forward speed in the blend tree and 5 for running)
    4. Set the turning animations to 0 forward speed and -90/90 of angular speed.
    5. Go into the ICE behaviors, use advanced animation control and add forward speed, angular speed to the parameters. Then use dynamic data by choosing the same named data for both parameters.
    6. have some tests and see if the turning animation is too much or less then adjust the angular speed assignment in the blend tree ( increase them or decrease) to tune the animations right.
    Hope this helps ;)
     
    Ryuichi173 likes this.
  47. Ryuichi173

    Ryuichi173

    Joined:
    Apr 12, 2015
    Posts:
    141
    Thank you detailed answer @Harekelas !
    That advise may help for not only to setup turn animation but setup all of animations for ICE behavior, I guess.
     
  48. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    I'm using unity 5.5 and not able to update to 5.6 for now.
    I'm using mapmagic to generate random terrains in runtime, and trying to figure out how to prevent creatures bump into rocks. Any suggestions?
     
  49. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    @Harekelas I think you're steps are missing a Direction parameter on you animation controller, and to set Move Direction under the Advanced Control Type in ICE, right?

    I've followed Pit's tutorial example, even tried to copy it several times with multiple edits for my own animations, that didn't work at all. But what I have setup in my animation controller works mostly... the problem I have now is that when my creature turns towards the target it immediately snaps back in the original direction it was going. So the walk to turn state change seems to work fine, but I can't figure out what's wrong with my turn to walk state. It's crazy, I log my hours in HacknPlan and just now crossed 15 hours working on getting the most basic ICE behaviors working. For some reason I don't think it should be this hard :confused: I'm definitely dumber than I thought I was...o_O
     
  50. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    246
    This asset certainly can make you feel that, but i don't think it's you. I'm struggling for weeks now ... and i'm on the point of giving up.