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

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Cheers Pit! The trigger on textures is a very nice idea, looks like you've thought of everything :)
     
    icetec likes this.
  2. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi mbowen89, yes it works with multiple splat textures, but also with the material main texture of a renderer when the ground based on a GameObject.

    Here you can read more about how it works …
    http://answers.unity3d.com/questions/34328/terrain-with-multiple-splat-textures-how-can-i-det.html

    It’s not so expensive but you should not do this in each frame while using dozens of creatures. I’m using now a scan interval which a default value of 1 sec. that should be suitable for the most cases but can be changed as needed and required.
     
  3. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Thanks a lot Jon, I try to do my best :)
     
  4. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    I bought your Asset nevertheless . He looks good and promising product . I would hope that you will make support for the photon pun UFPS. And you will improve your Asset .
     
    icetec likes this.
  5. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi alex, whenever you need support please feel free to contact me. I'm currently a little bit busy to finish the update but I'll try to answer all questions as soon as possible and in urgent cases you can contact me also via skype (pit.vetterick)

    Have a nice day!

    Pit
     
  6. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    I had the idea while talking importation) ) . You can do so for example when the wolf makes a sound ( howling ) . And this whine ( sound) resorted other wolves , are in the radius of the sound. It would be cool!. It's just my thought ..
     
    jonfinlay and icetec like this.
  7. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    That's brilliant - a kind of alerting and warning ... I could implement this in the behaviour or interactor rule class, so that a creature can inform other creatures about its active target ... would be basically really useful for a lot of cases if the creatures could communicate with one another to share information ... I'll think about how I can realize this but that's great ... thanks a lot alex!!!
     
    Teila likes this.
  8. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    icetec likes this.
  9. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    I'm having two small problems though:
    1. Although I can take damage, I can't shoot an animal. It's the same in the demo scene too, I can't kill the troll either. Is there any steps I may have missed?
    2. How can you get the animal to look at you? When I'm close it does its animation, but it continues looking in the direction it was walking in.

    Apart from these everything is fine. Thanks
     
  10. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
  11. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    1. Yeah I've downloaded that already. Should it work in the demo you provided (with the troll)? If so, there maybe a problem with my UFPS. I'll re-download it and re-import it to see if it works.

    2. I found the viewing direction option, I tested every option (offset, position, centre etc) and the animal still did its "idle attack" animation facing its move direction.
     
  12. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Jon,
    The adapter receives the vp_DamageInfo from the UFPS vp_HitscanBullet script, so please make sure that this script is assigned to your melee weapon or bullet objects also your creature needs a collider, otherwise the raycast the vp_HitscanBullet script used can't detect the hit.

    did you have defined the desired angular speed for the turn? you could also try increase this value, maybe the speed is to slow for the desired result ...
     
  13. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    I managed to fix the issue with the direction, basically I wanted the animal to stay to hold its position but with an aggressive stance, so I had the forward (z) setting at 0. When I changed this to 0.01, he turns fine. However, I noticed there is a short delay in turning to follow the player. If I move, it will continue to look in the same direction for a few seconds, then turn to look at me. Looks like it's a refresh setting. Which option should I change to reduce increase the refresh rate?
     
  14. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    ah, okay ... please open the status settings and decrease the perception and reaction time. Currently the default values are adjusted to 2 seconds, which is very performance friendly but not really suitable for quick reactions :) I think, thats will solve this problem ...

    btw. I have already changed the default values in v1.1 to 0.5f
     
  15. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    if the forward velocity is adjusted to zero the move procedure will skipped ... that's already fixed in v1.1 ...
     
  16. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Excellent Pit! It's much more responsive now. I've added a retreat behaviour so when I get too close it will run off a little then hold its ground again. However if I don't run after it, and stay in position but slowly move around the animal, it will still keep facing the same direction. But I'll play around with a few more settings to see what's happening, I'm quite sure it has something to do with the range. Looking very good though :)
     
    icetec likes this.
  17. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Here's a demo I've uploaded which shows the issue I'm having with walking around the hyena, I'm not sure if it is with the range distance because if it was, it wouldn't hold its aggressive stance



    However it still looks great, Ive already added an extra behaviour so when you chase it and get too close, it will jump and have its move speed increased, thereby the player can never catch the animal.
     
    icetec likes this.
  18. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Looks really great :)

    As you maybe already have seen, you can activate the debug features (Show Debug toogle at the top) to display all the target and move gizmos in the editor view, also you can activate the path and destination pointer of the ICECreatureControlDebug script to monitor the movement in-game during the runtime. both could helpful to you to adjust the settings. In addtion, you can activate also "Show Info" to inspect current values such as target, behaviour etc.
     
  19. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    I've re-imported UFPS and the animal still won't receive damage. I've checked my UFPS weapon and it's firing a bullet with the hitscan script attached. I've also added a mesh collider to the animal. When I reloaded the demo it's the same on that, it can kill you but you can't kill it. You can damage its collider (you can see the bullet holes hit it) but you can't kill it. At your end are you able to kill the troll in the demo?
     
  20. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
  21. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    ok great! Thanks a lot
     
  22. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    If have installed now the latest UFPS version and the result is the same as you describes. I'll check now what's the problem and will update the adapter script directly.
     
  23. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    That's the point I have to rework:
    vp_HitscanBullet:
    This script now caches known target damagehandlers in the same way as vp_Explosion, and falls back to sending a "Damage(float)" message in case the collider is known to have no damage handler.
    SendMessageUpwards is no longer used. This created problems in custom setups with multiple hitboxes, where hitboxes would hurt eachother recursively.
    The bullet should now work better (more stable) with systems that use "Damage(float)" methods (which are commonly used in Unity gameplay scripting). To make this work, disable the new "RequireDamageHandler" setting (like on vp_Explosion). This is an optimization in order for base UFPS to avoid spamming a lot of Unity messages to colliders that can't be damaged anyway.
     
  24. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Ah ok no worries, I can continue working on the other parts of ai in the meantime :)
    They messed up the shaders in their new update too, my guns go white after the scene is baked.
     
  25. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi Pit, just a very quick question so not to disturb you as I know you're busy:

    To get two packs of hyenas to fight and inflict damage on one another, I did the following:

    Interactor SpottedHyena --> Rule GetHit --> SelectionRange = 1 --> Anim = GetHit --> Influences Damage = +25

    The Hyenas fight each other fine with my previous interactor behaviours, though exceptionally the above line does not work, neither the Animation GetHit is played, nor 25 is added to damage. Am I missing something here?

    Incidentally, all my other interactions work like a charm; at SelectionRange = 10 the hyenas will either charge or play an aggressive animation (using the random function), and when SelectionRange = 3 will either Attack (play attack animation) or flee (again using the random function, as both species of Hyena are of equal size).

    Thanks in advance

    EDIT: Seems to be working now! I think the problem was that the ADV on the GetHit behaviour rule was red, when I changed it green, it worked.
     
    Last edited: Sep 27, 2015
    icetec likes this.
  26. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    maybe your TargetStopDistance is larger 1, so that the hyena can't reach the defined SelectionRange. You can overwrite the TargetMoveSpecification to decrease the TargetStopDistance just for the GetHit Rule. Also make sure that the priority is suitable defined.

    Btw. the problem with the UFPS adapter is fixed and I'll provide the update within the next hours ...
     
  27. Roughrider

    Roughrider

    Joined:
    Jul 17, 2011
    Posts:
    50
    This plugin along with a separate add-on for PUN at $50.00 would be worth its weight in gold...
     
    icetec likes this.
  28. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Excellent Pit, looking forward to using it. The kill and be killed is working fine now. However two quick questions:

    1. When you add an IF clause, how could I add this:

    Do GetHit ONLY IF the interactor object behaviour is Attack.

    Basically, all I can see are options to add clauses based on the object's own conditions, but not on the interactor's conditions. I noticed this part is still WIP, so wondered if it were possible to do.

    2. When the object dies, after a short period, the object disappears. How can I set it to not disappear?

    Thanks again
     
  29. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    Yes, I agree with the post above. What if there is support for the pun , the author of the Asset will be much more shopping . I bought this Asset with the hope that there will be support . Since at this point in the vastness of the Internet is not a good solution for Pun. Appeal to the author - I looked , and I say that support Pun do for you in the cellar !! I can help you with that little that I know personally . I hope that you will address this issue after the upgrade. It is in your Information Interests !
     
    icetec likes this.
  30. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    That’s true, currently the clauses based on the object's own conditions, but as also mentioned in the documentation, the given advanced Target Selection is just a stable interims solution and will be much more complex in the next version, and then you can also define conditions for the interactor, status values and other targets as well.

    Sorry, but there is no feature to stop the disappearance. Dead creatures will always disappear after the specified RespawnTime has elapsed, that’s an essential characteristic of the pool management, because dead creature can be performance friendly reused without creating new instances and basically everything we create, we also have to clean up, otherwise a user could flood his scene by mistake with an unlimited number of corpses until the memory capacity will be reached. Furthermore I will implement decay procedures for dead creatures in one of the next versions and also for this feature the disappearance will be necessary.

    But you can increase the RespawnTime within the Status settings, so that the bodies of your creatures will stay longer visible after dying. The max. value for the RespawnTime is currently 5 minutes but if you want to use a higher value you can change it in the script or please feel free to contact me if you are not sure how to do it.
     
  31. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    In that case, RespawnTime is fine, if possible please allow for the increase to longer than 360 seconds in the menu, to something like one hour. That would be great, saves editing the script. I'm looking forward to the update, as at the moment they can't really fight each other without seeing what the other hyena is doing, and they keep attacking a dead hyena, not realising it's dead.
     
  32. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Alex! Hi Roughrider!

    As I’ve already mentioned, I’ll will provide a demo scene for PUN as soon as all the update work is complete and in this connection it could be also possible to realize directly an adapter for PUN. I know that it is an important topic and I would like to do it directly, but I’m sorry, unfortunately i lack the time to do it until the update is finish.

    Btw. Thanks a lot alex for your offer, up to now I have just played a little bit with PUN, but have no further experience with this asset and so I am glad to accept your help - thanks a lot alex!
     
  33. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Dear Customers, I am pleased to announce that an update of the ICECreatureUFPSAdapter is available now. The new version supports the latest UFPS update and provides also the use of multiple damage handler, so that creature and player can receive several kinds of damage.

    http://www.icecreaturecontrol.com/icecreatureufpsadapter-ultimate-fps/


    Have a nice day!
    Pit
     
    Last edited: Sep 27, 2015
  34. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Cheers Pit! But when i run it I'm getting this error message:

    Assets/ICE/ICECreatureControl/Scripts/Adapter/UFPS/Editor/ICECreatureUFPSAdapterEditor.cs(144,69): error CS0117: `ICE.Layouts.ICEEditorLayout' does not contain a definition for `Button'
     
    icetec likes this.
  35. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    already fixed, just download and install it again ... sorry, my fault!
     
    Last edited: Sep 27, 2015
  36. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    I have not received damage to a player, and I could not understand why. But looking at the picture, I saw that you need to register in Damage Method Name instead of the default - Damage.
    It is right? I've already written a lot for you, I will fill in the cloud and send you mail a letter. 30 minutes later.
     
  37. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    I'm having a few problems too, the animal doesn't seem to take damage, so please post the answer here if you manage to do it. Although the player takes damage still, as I've just tested the Troll demo with the new adapter.
     
  38. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Working perfectly now, I just changed animal's collider from a mesh collider to a box collider. But I think Alex is right about the player not taking damage, when I deactivated the interaction script and just used the UFPS adapter, the Troll doesn't strike you.
     
  39. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Alex, to change the Damage Method Name is not needed as long the default handler of UFPS will be used. Momple, I'll update directly the demo scene ...
     
  40. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    I send a link to Skype.
    I already knew . I will continue to think , Why does the damage . But most of all because of the multiplayer. As the troll was moved completely out of the demo scene.
     
  41. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    I've accept your skype request and will upload the updated demo scene in some minutes ...
     
  42. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
  43. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Nice, the second one works fine, but the website link on the first demo is broken
     
    icetec likes this.
  44. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    thanks jon, already corrected ... too tired to realize that last night :) ... I hope everything works fine now again with UFPS and you will enjoy the work with it.

    Have a nice day!
     
  45. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    Good afternoon. I've got a strange bug appeared. I can not understand what was happening. I tried to do a long time standing in one place for a peaceful NPCs in UFPS, but which could have been killed. How is it implemented? How to solve this problem
    CAUTION: THE CREATURE 'GHOULPREFAB' HAVE NO BEHAVIOUR!
    UnityEngine.Debug: LogWarning (Object)
    ICE.Creatures.Objects.BehaviourObject: SetBehaviourModeByKey (String) (at Assets / ICE / ICECreatureControl / Scripts / Core / ice_CreatureBahavior.cs: 639)
    ICE.Creatures.Objects.CreatureObject: SetActiveTarget (TargetObject) (at Assets / ICE / ICECreatureControl / Scripts / Core / ice_Creature.cs: 437)
    ICE.Creatures.Objects.CreatureObject: SelectBestTarget () (at Assets / ICE / ICECreatureControl / Scripts / Core / ice_Creature.cs: 380)
    ICE.Creatures.ICECreatureController: React () (at Assets / ICE / ICECreatureControl / Scripts / Core / ICECreatureController.cs: 183)
    ICE.Creatures. <CoUpdate> c__Iterator16: MoveNext () (at Assets / ICE / ICECreatureControl / Scripts / Core / ICECreatureController.cs: 81)
    UnityEngine.MonoBehaviour: StartCoroutine (IEnumerator)
    ICE.Creatures.ICECreatureController: OnEnable () (at Assets / ICE / ICECreatureControl / Scripts / Core / ICECreatureController.cs: 47)

    PS: I even helped you than that I sent you?
     
  46. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Alex,
    just define the requsted behaviour ... Your creature always needs to know what it has to do, otherwise you get this message: CAUTION: THE CREATURE 'GHOULPREFAB' HAVE NO BEHAVIOUR!

    Please check all the behaviours of your creature, there must be at least one empty one, so that your creature don't know how to act.

    Here for example you can see the escort mission with a missing behaviour field (the field with the green button). If this behaviour will be select during the gameplay, you will get the namend error. In such a case just press the green button and the missing behaviour will created automatically, but you can also press 'NEW' to create the behaviour by define the desired name.

    Here you will see an example of such a behaviour rule, but it's not needed to adapt all settings. Important are basically just the animation and movement settings, but are also not obligatory required ...

     
  47. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    My help will be useful for Pun? You just did not answer)). Thanks for the detailed answer.
     
  48. icetec

    icetec

    Joined:
    Mar 11, 2015
    Posts:
    592
    Hi Alex, your are welcome! ... and yes of course, your help will be useful but I've already done some tests with pun today and ICECreatureControl works well with it ... please visit http://www.ice-technologies.de/unity/ICECreatureControl/ICECreaturePUNAdapterDemo.html and open the Demo Worker scene - It's just a quick and dirty test, just to see how it works ...
     
  49. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi, I had an idea which would improve debugging. Adding a little text which either appears above the object during runtime, or in the Show Info box, which displays the current stats (Hunger, Thirst, etc) of the object. Also, add a GUI which displays the temperature in the corner of the screen. I don't plan on getting UniStorm, however I do plan on getting Time of Day, so I'll probably use your temperature system. Also if I were to add the Creature Control script onto my own player, could it then be used to control the Player's own hunger and thirst levels?

    Finally, just to confirm, it's not currently possible to do a mission based on the status of the animal (e.g. an animal goes to the water when thirsty) is it?

    Thanks

    EDIT: Also, allow to increase the maximum time of the behaviours when there are more than one to allow for stalking and other advanced behaviours. So, an animal could watch the player for say 10 minutes, then come closer, watch again for 10 mins, then strike (the current max of 60 seconds is too short for this). Also, allow for two or more animations in the same behaviour, as the 4toon animals have three animations for some actions (e.g. sit down > sitting > stand up).
     
    Last edited: Sep 30, 2015
    icetec likes this.
  50. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    635
    I'm wanting to use Locomotion System with this, your pdf says

    All I can do is select a legacy animation, I can't set the animation to NONE.

    Edit: I realized only if I have an Animator component attached can I select none.

    Can I not use the Animation component with legacy animations and also set certain behaviors to not use an animation so I can have it done with the Locomotion System?
     
    Last edited: Sep 29, 2015
    icetec likes this.