Search Unity

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

[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. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I am not sure it worth it when only two or three people uses Apex with Ice Creatures plugin.
     
  2. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings folks. Setting something up and testing but wanted to pick brains to see how you guys handle a situation. Sometimes my solutions are not the best heh. Anywho, something simple like "Run away if entity is close" and "Run away if damaged by anyone" can be tricky to work out. Cant seem to find an "if target damages me" option in advanced. In our game we have 3 tiers of interactive things - Creatures (animals), Enemies (monsters) and Player. Most entities need to take in account all three so have to have mad interactors set up. Anywho, for a deer, I have set interactor player and range of 6. I want it to run away anytime the player gets close. I set behavior to run and boom, found the awesome option to set a NEW TARGET! Wow, good stuff, this is what I needed..... now here is the BUT... but @icetec has only included the option to set it to a named ICE object. Our problem with this is of course everything is using layers and tags for targets and combat hits heh. So, we need to be able to set that second target to whatever we want, which in this case would be a tag so that when the deer runs away they can get a dynamic target. Work arounds? Any ideas from the peanut gallery on how you handle simple interaction like "only attack if attacked" or "Run to this new target when given target gets in range" scenarios? Thanks in advance! I really wish there was a way to link a MISSION from an interactor. To me, it would make sense to be able to tell an agent to go to say an escape mission, from being attacked by a target. Right now I can only set a behavior, and you cannot set travel point to go to in a behavior. So I find Escape to be useless without being able to give coordinates, and I cannot give coordinates in the interactor to a different target (well until Tag is added anyway). I also found the IsInjured in the OWN advanced parameter. The other scenario I'm thinking of using is enabling a mission with that IsInjured OWN parameter and a tag target as an escape point (in this case its just a tree in the environment). This I supposed would cover all interactors since the mission would just be waiting for the agent to be damaged.

    The reason I am also wanting and looking for an option to set for "If damaged by target" is I don't think MOBS should be able to see behind them, so I set my range and angle so that mobs only are attracted to things in their FOV and in range. The problem is, its looks goofy when a player can just stand behind the mob and shoot ranged projectiles at them, eventually killing them, while they continue to just walk around and ignore the damage they are taking. I haven't been able to figure out how to set mobs up so they work like that, only attack if Player is in view or if player has damaged the agent. How do you guys get around this limitation? I added an extra double of the player interactor, with run and attack a second time, this time based on unlimited range in the first act, no selected angle and the advanced parameter OwnerIsInjured. Everything else is standard run to player and attack in range. When I test this though, it doesnt work. I stand behind the enemy and pummel them with damage and they just keep walking around heh. I also set the priority on that act high but no luck.
     
    Last edited: Nov 16, 2017
  3. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Some solution could be to let the user ad mutiple possible destinations for specifc behaviours, like multiple possible escape routes.
    Or a new option to have the Home location become "dynamic", when a group flees away it's home location is invalid and the new one will be the new position when they stop fleeing.

    Mobs should hear the player when he is near, even walking would do sounds. so they have a minimal "sound radius" that is the awareness of the player presence, when the player enter that radius the mob is attacking.
    While the player beeing far "sound radius detection" the mob will only be able to detect the player with it's FOV.
    It's a common practice.
    Another feature you would need is alert system : when one mob on the zone is alerted, all other mobs around are alerted and know where is the player without using detection (fov, radius, los).

    Anyway, a great addition have been ICe Creature plugin exposing features (detection and conditions, actions) to other AI plugins like NodeCanvas or Playmaker plugins to manage the beahviour part instead.You could benefit from ICe Plugin creatures definition and customize the AI to your very own needs.
    Better ICe Creatures 2 including it's own FSM or BT editor lol
     
    Tethys likes this.
  4. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    I agree sound options do make sense and I already have this scenario rigged(thanks), however, it still doesn't fix the range problem. Mobs attacking a player they cannot see, but are alerted because the player attacked them from range, is also common practice. Even 10+ yr old WOW has that. Did some more tests today but cannot seem to alert a mob from range with ranged damage. I also cannot find a way to set an interactor also to say only attack this object if it has attacked you.
     
    Last edited: Nov 16, 2017
  5. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    You Can Increase The Mobs Range From A Behaviour , Like If Player Is attacking The Mob From Far Then Mobs Ranges Get Increased To say Like From 50 to 200 Now Add a behaviour To Check For Player if its in That range if He Is Then Check if he Is Attacking Or Not . If yes Then Set Mob To Flee Or take Cover(Offcourse u Need to Define Those behaviours To ) I will try To Replicate This Part And Will Try to Provide the Interactor . But For me The Urgent Concern is the integration with RFPS No Tutorial On that its Getting Too Hard For damage From Rfps to Ice and Ice To RFPS. I Hope Someone will try to Help me with that part:)
     
    Tethys likes this.
  6. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I didn't tried it, but you can trigger behaviours on functions, for example OnDamage() the creature will trigger to flee.
    Almost sure, this basic behaviour can be done in Ice Creatures.
     
  7. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    How? If I can detect if player is attacking this solves everything, as I already have an interactor set for the player on the mob with unlimited range. However, I cannot find the correct setting in Advanced Options(if its in there) for detecting if that particular target is attacking. I tried Injured option on the Player interactor for the mob, with unlimited range and angle but they never react(those ACTS never fire). 1 set of interactors is the standard needs to be in range and FOV and they work fine. The 2nd set is the unlimited range but advanced parameter set for OwnerIsInjured - that is the one that never fires. Set it to higher priority as well. I have also tried the OwnerIsSelectedByTarget and that also does not fire off the ACT on the interactor.
     
    Last edited: Nov 16, 2017
  8. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Try CreatureHealth and CreatureisInjured Simultaneously . That Way You Can Find that Its Getting damaged Then Use range to Set Target. But Ya This is Just a Temp Solution And Fixed ActionOption For Like IsAttackedByTarget or IsDamagedBy Target or TargetIsAttacking Can Be To Good Hope They Come In Future Update . For Time Use The Temp Solution
     
    Last edited: Nov 16, 2017
    Tethys likes this.
  9. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Yeah totally, I'm thinking if you're making an FPS also going to definitely need this on AI. As it stands, if you have an FPS with AI and you shoot them from across the level, enemies are going to just ignore the player and go about their patrol behaviors. Seems like I might have seen this in the deathmatch demo as well where you can stand there and shoot bears from a distance and they just stand there getting damaged until they die. Maybe it was something else though.

    BTW, anyone get obstacle avoidance to work? I haven't ever seen it working, from version 1 to this newest one(and admittedly maybe I'm just using it wrong or misunderstanding what its supposed to do). My game takes place in a forest. I have the tree layer set to be avoided, and all trees are on the tree layer. I have tweaked the avoidance settings over and over, nothing seems to work. Enemies spawn in and just keep walking into trees. I also have prevent deadlock enabled with UPDATE as the option - they all just run into trees and then keep walking against the tree forever until enough force over time pushes them around the tree and they eventually can move forward again.

    ICE is probably going to hate me when this is all over. I will eventually test EVERY feature of this package because I'm using it in a real production environment for a live game. :p Hopefully this will help improve the asset.
     
    Last edited: Nov 16, 2017
  10. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Found another bug and its funny and I am tired of it , uploading the video :D
     
    Tethys likes this.
  11. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    I am Using Nave Mesh With Stopping Distance of 2 . Now Creature Find The Move Location And Move Towards It But As Soon As reached Near it and Crossed Stopping Distance Or Reached Stopping distance It Stops There And Don't Get New Move Location . Now When I Manually Move Creature Towards the Move Location Then The On Reached Gets Triggered And Creature gets New Location But Why It stops and Why We Have To Move it Manually. I have Enable OnReached In Essential Of Creature. Plz Suggest Some Fixes Or Any Thing That Can Fix This Sh*ty bug:( Here is the Video Showing That

     
    Last edited: Nov 16, 2017
  12. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Have you tried adding that last little patch of terrain to the nav mesh? I wonder if that is what is bugging it. Also one more thing, try enabling the 3d button ther enext to BAN so it ignores level differences. Great video.
     
  13. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    the terrain Is Not Unity Terrain its a single Mesh I set it nav static and baked , yes I tried that 3d Button too but No Luck , It Like This Bug Comes and Go I mean If At runtime I change the stopping distance to 1 from 2 then it starts to work but when I stop the game and restart the bug come again. can you guys test it too I mean its for me only or all of you are experiencing this
     
    Tethys likes this.
  14. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    My terrain is also made of mesh, procedurally generated and I am not using NavMesh so I unfortunately cannot say regarding that. I know the ban button will prevent the creature from going inside the desired stopping distance, and you have to account for that distance being calculated from the center of the reg point on the model, to the center of the reg point on the waypoint. I had to get used to this initially and change it per animal or mob depending on how LONG the body is. I DO see this behavior when trying to get a mob to run-to-and-attack and the stopping distance is too short with ban - the creature can never get close enough to attack so that next ACT never fires. If you havent already you might try turning off ban initially and play with that stopping distance. For bipeds 2 works for me, but for quadrupeds it needs to be larger.
     
  15. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Ya tHat BAN Button is Already disable . So I think Whats happening Is That BAN functionality Gets Activated sometime somehow Which Causes This behaviour . SO Now Only PIT can Fix This Because Its Ugly To See Creature stuck On One Position . I will Use Timer Untill This Is Fixed .
     
  16. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    ah! I had that before, its like it reaches the destination but then doesn't know what to do after that. I can't remember off hand how I fixed it, but it was one of the settings, to make them find a new target destination as its not updating the next path node. If I come across it again I'll be sure to post what I did to fix it.
     
  17. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    ;)oh thank got finally some help . thank and plz try to remember little hard:D , I am at dead end with that thanks again:)
     
    julianr likes this.
  18. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I'll be using ICE CC again this weekend, so I'll jump in and see if I can duplicate it - I do have some videos on the way, but things took a priority lately - under a deadline :)
     
    danteswap likes this.
  19. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Yupp Sure
     
  20. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    Ice creature dont work photon, remote player dont see AI or AI dont move for remote players bugged for me ;(
     
    Last edited: Nov 19, 2017
  21. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi danteswap, cloud you show a screenshot the the NavMeshAgent settings? It could be that the agent stop the move because break is active ...
     
  22. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hello Gamarray, that's not necessary. The important thing is that the object is in the right position and not blocked by Collider. In order to use the Sensoria settings now for a target selection, you only have to activate the FOV and VC button of the Target Selection Criteria of the desired target. FOV enables visual field check, so a target will be selected only if it is within the defined field of view. VC activates the visibility check, so that a target will be selected only if it is actually visible and not obscured by other objects.
     
  23. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hello Tethys, "When damaged by target" comes with the memory options, but for now, you could simulate it through the sensoria, OwnDamage and multiple Interactor rules. For example, at a great distance the creature only chooses your player as long as it is visible to the creature, but if the player comes closer, the creature could also hear him or select him because the creature is already injured ...

    Btw. If you want, you could contact me on skype, so I can show you the settings ...
     
  24. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hello anunnaki2016, could you please give me some more information about your settings and scene setup?
     
  25. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    its me hugo come in skype my friend :)
     
  26. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938

    Have you tried changing tags. For changing behaviours to an object I use change its tag and already have a behaviour for that tag.

    If this is a problem for player tag maybe an empty gameobject on the player setup as an interactor that you can change the tag of at runtime and change the AI's reaction to it.
     
  27. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Link Sended In Private Msg
     
  28. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    I Have All The Buildings inside an empty game object , So now I changed That Game Objects Layer To Obstacle Layer (Is Asked To Change Children's I Clicked Yes)That is Defined In World Settings In ICE Creature Register , Now I run The Scene But The Creature Still Go Through the Walls And fences And Houses Why, Also The Obstacle avoidance Option In Creatures Essential Settings Is Grayed Out So Cant Modify Anything There
     
  29. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Set the buildings as static, and bake the navmesh again. You should be good to go. They will stop going near buildings, but you could set a trigger for when opening doors and such to build a navmesh link between the inside when the door is open. Like I did here. dynamicnavmesh.jpg
     
  30. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    I was getting Some unknown behaviour When Using Nav Mesh Agent So I Reverted To Internal Path Finding. So Why Will I Need To Bake When i am Not Using NavMesh Agent?o_O
     
  31. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    ah right, thought you were using Navmesh before? May be a bit costly putting Obstacle avoidance on everything, but depends how big your level/map is. Not sure on that as i don't use internal path finding, not yet - maybe it requires navmesh?
     
  32. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Ya Right I Was Thinking About That Earlier And So Back To Nav Mesh . But Still Got That unkown behaviour which is , My Creatures Starts to move and turn back And Forth Between Two Short Points Like 2 units And Don't Go Towards The Distination , And As Soon As i disable Navmesh Agent Ice Reenables it And Creature Correctly Walks ,Same thing Happens With Previous bug Where Creature Stops At Stopping Distance and Don't Gets New Move Location , I did Same there (Disabled The NavMesh Agent ) And As expected Ice Reenables It And Creature Start To Move Again And Gets new Location To move
     
  33. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    No doubt Pit is looking at that.. but let me just looking into that for you and see if I can duplicate it... give me 5-10 minutes.
     
  34. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Ya sure
     
  35. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Ok, this should solve your issue ... duplicate the essentials bit here, and tweak as required.

    problemsolved.jpg
     
  36. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    On the offset, just click reset - no need to copy those values.
     
  37. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Ya Sure Doing Now Will Take Just A Minute Wait
     
  38. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    All The Creatures Are Moving As A herd To The Same Location
     
  39. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Disabled The Rect In Random Positioning Range Now Back To Normal , Testing Further For Those Buggy Behaviour , Will Let You Know If They Come
     
  40. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    problemsolved2.jpg
    I set the Rect so they wouldn't go beyond the confines of a plane with navmesh and it doesn't create a target destination beyond the scope of what was required.

    This will also help, so if it gets stuck it will auto repath and allow out of area moves. Under Essentials. Make sure you have ground layer set to your terrain layer, with a raycast.
     
  41. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Yupp Its All Good There . My terrain is 1000x1000 And The Area For The Current Creature For RandomPositioning and spawning is under 50 . So Its Limited In A circular Radius Of 40 . But Still The Problem Persist and The Solution in editor Is to disable the navmesh agent , And ice renables it and problem Solves.
     
  42. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I add the Navmesh in manually. This is created with a profile of legacy as for quickness I was using legacy animations.

    problemsolved3.jpg
     
  43. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Also make sure your creature is listed in the creature register - this can often have some strange results if its not.
     
  44. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Ya creature Is Registered Let Me try Removing And Adding agent Manually
     
  45. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Same problem Again I can give Team Viewer If You Want To See For Youself . i am So sad Now:(
     
  46. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Stick the Rect back on and the confines, just to see what they do over time.
     
  47. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Wait I am Uploading The Video . Without Rect
     
  48. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Here It Is Skip to 00:50 For The Problem
     
  49. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    It Start To Move when I disabled The Navemesh Agent
     
  50. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    There's your issue, you have a break in your navmesh, try baking with a better coverage. Its trying to get to a target that it cannot reach, but should really go around and find an alternative path. Not sure why that is. Add a control debug, it could be going to an animation that is not defined.