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

[RELEASED] Emerald AI 3.2 (New Sound Detection) - The Ultimate Universal AAA Quality AI Solution

Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.

  1. neodotca

    neodotca

    Joined:
    Feb 20, 2016
    Posts:
    121
    I followed the tutorial for GKC/Emerald, and i get these errors, it looks like it's easy to fix, but i prefer to ask cause i dont want to start messing with the codes, thanks!
    --------------------------------------------------------------
    Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs(309,1): error CS1525: Unexpected symbol `public'

    Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs(309,9): error CS1547: Keyword `void' cannot be used in this context

    Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs(309,39): error CS1525: Unexpected symbol `('

    Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs(312,49): error CS1525: Unexpected symbol `)', expecting `;' or `}'

    Assets/Game Kit Controller/Scripts/Weapons/playerWeaponSystem.cs(319,8): error CS1525: Unexpected symbol `playerWeaponBullet', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
    ------------------------------------------------------------------------
     
    Last edited: Jan 25, 2018
  2. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Probably a missed '}' curly bracket somewhere
     
  3. neodotca

    neodotca

    Joined:
    Feb 20, 2016
    Posts:
    121
    Thanks, it's working now, add the missing bracket on line 225 of "playerWeaponSystem" script of GKC and please remove the name "Invector" from the "GKC" tutorial.
     
    Last edited: Jan 25, 2018
  4. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Quick Question - How do you assign the UI health bars to a UI camera layer so they aren't affected by visual effects on the main camera? The UI seems to be generated at run time and not attached in the prefab for the char --- so where is it?
     
  5. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    most post pro or visual effects come with a layer define, so you can set a layer that does not get affected by it. Check whatever visual effect system you are using and see if you can specify the UI layer.
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    I haven't tested Emerald AI with 2d projects. The only 2d game type that might work is top down. However, Emerald requires a model and Animator Controller to work. It also uses 3d colliders and 3d Rigidbody components.


    Doing as uberwiggett recommended should work. The UI has two prefabs, "AI Combat Text" and "AI Health Bar Canvas". You can set the layer through the Project tab via their prefabs. When your AI generate them on start, they should be created with the layer you set on said prefabs.
     
    BryanO likes this.
  7. VENOMOUS09

    VENOMOUS09

    Joined:
    Dec 27, 2014
    Posts:
    37
    thank you for the Game Kit Controller integration tutorial :):):)
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome! :)


    I've looked into your issue and cannot recreate it. The demo AI work fine with Invector. They fire projectiles and damage the player as they're supposed to. I'm also not having any rotation issues as you were. Try using the demo AI to see if you are still having issues. If you aren't, it has something to do with your AI's model.

    Also, set your AI's Player Offset Y position to 1 so that the projectile fires at the center of the Invector player. This can be found at the top of the Damage Settings right under Projectile Timeout Time.

    Invector.png
     
    Invector, Neviah and zenGarden like this.
  9. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Projectiles seem to do ok. Saw one instance where it didn't travel, but the ones after that did. I'll take that as a win! hah
     
  10. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186


    Thanks
     
  11. AVVelior

    AVVelior

    Joined:
    Jan 24, 2018
    Posts:
    2
    Hi BHS, we are developing an Acting RPG from the first person with sword battles -



    (we did on CryEngine but now we are considering the transition to Unity), so now we are looking at Emerald - as a potential candidate for building AI on it.

    Therefore, I and probably several of my friends are ready to buy and use Emerald, but stop such moments:

    1) Our models in the game use two sets of animation:
    The first set is the animation of the unit (movement, standing, attack, defeat ..) in a healthy state, and the second - in the damaged (when the current life of the unit becomes <30%). Total - two sets of all animations. So now doing most of the development for sale Action-RPG games, one set of animations is very primitive and suitable for very simple demos.

    2) Each combat unit has not three, but about ten types of assorted attacks, five types of attacks, six types of damage. So the question is how can they be integrated? And is it possible to add to Emerald an arbitrary number of animations for each type in the interface (for example, using the "+" button)?, And not constant 3, 2, 1 - as of now.

    3) Lack of use for the unit of different animation bias - in six directions of displacement (walking and running). Now - when the unit bypasses the obstacle, one and the same animation (s) for his feet is played. This looks extremely out-of-date for FPS.

    4) It is necessary that the unit can cause different impacts during the movement - in all directions.

    5) Jump the unit with a sword blow - on the hero. Jumping back.

    The question is - could you count on the introduction of this functional and when?
     
    Last edited: Jan 26, 2018
  12. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    'Allo..

    looking at the sounds section for the AI, I see Attack, Injured, Warning, Death and Footsteps, but no Idle sounds.. is there an option for random, occaisional idle sounds for creatures?

    Regards

    M
     
    erichey and Neviah like this.
  13. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    News about ootii?
     
  14. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    I just bought Emerald AI asset and coming up to speed on it. I studied the 'Line of Sight' demo scene, and even added my own monster assets to it to make sure they followed/attacked the player.
    However, when I try to implement in my Oculus VR project, I can't get the enemies to recognize my player. I even copied the Footman asset into my project maintaining the same tag/label structure, and he too will not respond to player.
    What could I be missing? I labeled both the OVRCameraRig and OVRAvatar assets as 'Player' thinking that would work, but doesn't seem to.
    As an aside, I'm using the VRTK toolkit for my controllers, so not sure if something faulty there.
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    1) Currently, there is no set of animations for damaged/injured units. However, a damaged set of animations can certainly be added for units in a future update.

    2) In an upcoming update, I plan on adding more attack and damage animations. The order that the animations will play in will also have more customizable options.

    4) I'm very open to suggestions/new features for Emerald. I can certainly consider the ones you have suggested. As of right now, my focus is getting the breeding and herd system finished. After that, I'm going to implement an improved combat system that's more flexible and customizable.



    Hey there!

    As of right now, there is not a feature for idle sounds. This is a great idea though and I will add this feature with the 2.0.3 update.


    Hey there!

    It's taking a little bit longer than expected, but I'm currently working with Tim, the ootii developer, to get everything working and the tutorial finished as soon as possible.


    Hey there!

    This is usually caused by tags and layers not being setup correctly. For a detailed explanation of Emerald's tag system, see the documentation here: https://docs.google.com/document/d/...2njM7Jx9pYlqgbtM8/edit#heading=h.bma0yitb4i6q Make sure none of your layers are set to Ignore Raycasts as this would make the AI's target appear to be obstructed.

    If you can, please provide a screenshot of your AI's Tags Options, the layers and tags on your Emerald AI object, and your player so I can try to identify the issue.
     
    MaliceA4Thought likes this.
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey everyone!

    For those who use Game Kit Controller, the GKC integration tutorial has been simplified and now has 5 less steps.

    You can see the updated tutorial here: https://docs.google.com/document/d/...uHce2BVLM3QTq5axg/edit#heading=h.f3z45wygsipy

    I’m currently working with the developer of ootii to get the Motion Controller integration tutorial finished as soon as possible. I hope to have it finished within the next couple of days.
     
  17. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    I know it's further down the road but can you elaborate on how the integration with love/hate will work? Will there be extra response features thrown into the available behaviours on emerald's end to reflect the choice options LH sets?
     
  18. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    I agree with this idea as it would make Emerald AI a powerful choice and contender in the AI department. Adding a few more variants for attacks could spice up the game and not make it seem to monotonous and boring. Examples:

    Melee:
    1. Cone attack.
    2. DashTo/JumpTo Player attack
    3. Combos that do several attacks

    Ranged:
    1. Cone attack.
    2. Targeted area of effect (like throws a projectile that explodes on impact. ie grenade, fireball, etc)
    3. Area of Effect damage that originates from the AI (like an enemy that does pushback damage if the player gets too close).

    Something to think about. I realize this puts a huge strain on your time and effort as you're super busy with tutorials, integrations, and improvements.
     
    zenGarden likes this.
  19. hugepool

    hugepool

    Joined:
    Mar 1, 2017
    Posts:
    5
    Hey, I'm wondering if it is possible to download a previous version of Emerald AI. I remember working with the skeleton models on a previous project and I wasn't able to find them on 2.0.

    Thanks
     
  20. hsxtreme

    hsxtreme

    Joined:
    Apr 14, 2017
    Posts:
    55
    In version 2.0 how to configure AI humanoid with guns?
    ( RFPS)
     
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I'm not entirely sure how the integration will go. I plan on adding Love/Hate specific API that users can access to control certain features. Right now, my focus is getting all of the integration tutorials finished then adding the herds and breeding mechanics. After that, I will begin integration with Love/Hate, Quest Machine, and UniStorm.


    Thanks for the suggestions!

    I totally agree. I plan on improving the attack system by allowing users to define abilities/attacks that an AI can use. After I have finished all the tutorials, and added the herds and breeding mechanics, I will start working on improving the attack system.


    The previous version of Emerald, version 1, is no longer available. However, the skeleton models used in that version can be found here: https://www.assetstore.unity3d.com/en/#!/content/71087


    Add your AI's gun as the AI's Ranged Attack Transform. Projectiles can be fired faster, for projectiles like bullets, by using the following settings.

    1) Min and Max Attack Speed: 0
    2) Attack Delays: 0
    3) Attack Speeds: 5
     
    hsxtreme likes this.
  22. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    thanks for the reply. Yeah I'm aware there is a lot of stuff to be made in between, lots to look forward to :) Just wanted to see if there was any info on feature additions planned but will have to wait and see. I have a lot of my own ideas for integration that I want to use both systems for, but I can discuss that at another time.
     
  23. HalDevOne

    HalDevOne

    Joined:
    Apr 12, 2014
    Posts:
    67
    Hi!
    I wonder if you are planing to implement a trigger based hurt/attack system and if so when can we expect the update for that? Now its all time based and thats not so precise.
     
    Last edited: Feb 1, 2018
    zenGarden likes this.
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome! Once I have a better idea of the integration plans for Love/Hate, I'll be sure to post them here. Feel free to share your ideas of integration here. :)


    Hey there!

    I do plan on adding this feature in the near feature. However, I cannot provide a date for when collision based damage will be implemented. You could technically use the ranged combat system for the time being as it used collisions for its damage. The AI's Timeout Time and Attack Range the would have to be as low as a melee attack would be.
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @uberwiggett - I'm keeping an eye on this conversation, too, so feel free to bounce ideas off me.
     
  26. hsxtreme

    hsxtreme

    Joined:
    Apr 14, 2017
    Posts:
    55
    Any tutorial or documentation that teaches you to do this type of quest?
    Like talking to an NPC and following him?

     
  27. Demonoid74

    Demonoid74

    Joined:
    Jan 20, 2017
    Posts:
    16
    Hello , just bought this asset a few nights ago and working with it to get used to it and try and set things up the way I want . A few questions , is there a way currently to configure the AI to run from and avoid certain objects...say like you threw a grenade near them...make them run from that projectile? also if it were a gas grenade or something similar...make them run from the actual gas or explosion effect?

    Thanks and looking forward to more options and systems!
     
  28. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Do you have any update on when Quest Machine will be integrated and have a tutorial available?
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi! I'm working on integration already. It should be available within the next two weeks, with full written documentation. A video tutorial will come later.
     
    hsxtreme and Razmot like this.
  30. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @BHS ,

    Good work, you finally fixed critical errors, the plugin looks stable.

    However, will you improve the AI placement and navigation ?
    Emerald AI movement is super basic: NavAgent go to player.

    When units are behind other they are just stuck unable to find random side or backward free positions around the player. Ranged AI are waiting because melee AI is blocking their line of sight, while they could move around.


    It's good for stupid Zombie and hack n slash.
    But new options to get smarter AI able to navigate to free places around the player would make the plugin lot better.

    At least a new option to get AI check if they can move on their sides with a raycast :rolleyes:


    I agree it's a needed feature.
     
    Last edited: Feb 3, 2018
  31. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Oh wow hi! I have the free version but I haven't delved into it yet to understand it as I've been focusing on finishing a demo.

    Most of my suggestions are very geared toward my gameplan but I'd definitely run some ideas by you guys just to see how they could integrate with the features and functionality of both systems. I'm working on the design docs for it in the background and will let you know when I've solidified the concepts
     
    TonyLi likes this.
  32. ChillyMcChill

    ChillyMcChill

    Joined:
    Nov 17, 2016
    Posts:
    57
    I get lag in the los scene after following the UFPS integration tut

    The lag starts after I first attack my AI

    It stops a few seconds after it dies : (

    On 2017.3.0f3 with the latest version of Emerald 2.0
     
  33. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214
    Hey there! I am using emerald currently (great asset), with VR (the steamvr pack available on the asset store)

    I noticed on the description Emerald supports VR, is there a tutorial for it? I am, for instance using the bow and arrow that comes with SteamVR and would love to be able to damage AI with the arrow, and also take damage from a hostile AI.

    Thanks.

    Here is the script that is on the arrow projectile item :

    Code (CSharp):
    1. //======= Copyright (c) Valve Corporation, All rights reserved. ===============
    2. //
    3. // Purpose: The arrow for the longbow
    4. //
    5. //=============================================================================
    6.  
    7. using UnityEngine;
    8. using System.Collections;
    9.  
    10. namespace Valve.VR.InteractionSystem
    11. {
    12.     //-------------------------------------------------------------------------
    13.     public class Arrow : MonoBehaviour
    14.     {
    15.         public ParticleSystem glintParticle;
    16.         public Rigidbody arrowHeadRB;
    17.         public Rigidbody shaftRB;
    18.  
    19.         public PhysicMaterial targetPhysMaterial;
    20.  
    21.         private Vector3 prevPosition;
    22.         private Quaternion prevRotation;
    23.         private Vector3 prevVelocity;
    24.         private Vector3 prevHeadPosition;
    25.  
    26.         public SoundPlayOneshot fireReleaseSound;
    27.         public SoundPlayOneshot airReleaseSound;
    28.         public SoundPlayOneshot hitTargetSound;
    29.  
    30.         public PlaySound hitGroundSound;
    31.  
    32.         private bool inFlight;
    33.         private bool released;
    34.         private bool hasSpreadFire = false;
    35.  
    36.         private int travelledFrames = 0;
    37.  
    38.         private GameObject scaleParentObject = null;
    39.  
    40.  
    41.         //-------------------------------------------------
    42.         void Start()
    43.         {
    44.             Physics.IgnoreCollision( shaftRB.GetComponent<Collider>(), Player.instance.headCollider );
    45.         }
    46.  
    47.  
    48.         //-------------------------------------------------
    49.         void FixedUpdate()
    50.         {
    51.             if ( released && inFlight )
    52.             {
    53.                 prevPosition = transform.position;
    54.                 prevRotation = transform.rotation;
    55.                 prevVelocity = GetComponent<Rigidbody>().velocity;
    56.                 prevHeadPosition = arrowHeadRB.transform.position;
    57.                 travelledFrames++;
    58.             }
    59.         }
    60.  
    61.  
    62.         //-------------------------------------------------
    63.         public void ArrowReleased( float inputVelocity )
    64.         {
    65.             inFlight = true;
    66.             released = true;
    67.  
    68.             airReleaseSound.Play();
    69.  
    70.             if ( glintParticle != null )
    71.             {
    72.                 glintParticle.Play();
    73.             }
    74.  
    75.             if ( gameObject.GetComponentInChildren<FireSource>().isBurning )
    76.             {
    77.                 fireReleaseSound.Play();
    78.             }
    79.  
    80.             // Check if arrow is shot inside or too close to an object
    81.             RaycastHit[] hits = Physics.SphereCastAll( transform.position, 0.01f, transform.forward, 0.80f, Physics.DefaultRaycastLayers, QueryTriggerInteraction.Ignore );
    82.             foreach ( RaycastHit hit in hits )
    83.             {
    84.                 if ( hit.collider.gameObject != gameObject && hit.collider.gameObject != arrowHeadRB.gameObject && hit.collider != Player.instance.headCollider )
    85.                 {
    86.                     Destroy( gameObject );
    87.                     return;
    88.                 }
    89.             }
    90.  
    91.             travelledFrames = 0;
    92.             prevPosition = transform.position;
    93.             prevRotation = transform.rotation;
    94.             prevHeadPosition = arrowHeadRB.transform.position;
    95.             prevVelocity = GetComponent<Rigidbody>().velocity;
    96.  
    97.             Destroy( gameObject, 30 );
    98.         }
    99.  
    100.  
    101.         //-------------------------------------------------
    102.         void OnCollisionEnter( Collision collision )
    103.         {
    104.             if ( inFlight )
    105.             {
    106.                 Rigidbody rb = GetComponent<Rigidbody>();
    107.                 float rbSpeed = rb.velocity.sqrMagnitude;
    108.                 bool canStick = ( targetPhysMaterial != null && collision.collider.sharedMaterial == targetPhysMaterial && rbSpeed > 0.2f );
    109.                 bool hitBalloon = collision.collider.gameObject.GetComponent<Balloon>() != null;
    110.  
    111.                 if ( travelledFrames < 2 && !canStick )
    112.                 {
    113.                     // Reset transform but halve your velocity
    114.                     transform.position = prevPosition - prevVelocity * Time.deltaTime;
    115.                     transform.rotation = prevRotation;
    116.  
    117.                     Vector3 reflfectDir = Vector3.Reflect( arrowHeadRB.velocity, collision.contacts[0].normal );
    118.                     arrowHeadRB.velocity = reflfectDir * 0.25f;
    119.                     shaftRB.velocity = reflfectDir * 0.25f;
    120.  
    121.                     travelledFrames = 0;
    122.                     return;
    123.                 }
    124.  
    125.                 if ( glintParticle != null )
    126.                 {
    127.                     glintParticle.Stop( true );
    128.                 }
    129.  
    130.                 // Only play hit sounds if we're moving quickly
    131.                 if ( rbSpeed > 0.1f )
    132.                 {
    133.                     hitGroundSound.Play();
    134.                 }
    135.  
    136.                 FireSource arrowFire = gameObject.GetComponentInChildren<FireSource>();
    137.                 FireSource fireSourceOnTarget = collision.collider.GetComponentInParent<FireSource>();
    138.  
    139.                 if ( arrowFire != null && arrowFire.isBurning && ( fireSourceOnTarget != null ) )
    140.                 {
    141.                     if ( !hasSpreadFire )
    142.                     {
    143.                         collision.collider.gameObject.SendMessageUpwards( "FireExposure", gameObject, SendMessageOptions.DontRequireReceiver );
    144.                         hasSpreadFire = true;
    145.                     }
    146.                 }
    147.                 else
    148.                 {
    149.                     // Only count collisions with good speed so that arrows on the ground can't deal damage
    150.                     // always pop balloons
    151.                     if ( rbSpeed > 0.1f || hitBalloon )
    152.                     {
    153.                         collision.collider.gameObject.SendMessageUpwards( "ApplyDamage", SendMessageOptions.DontRequireReceiver );
    154.                         gameObject.SendMessage( "HasAppliedDamage", SendMessageOptions.DontRequireReceiver );
    155.                     }
    156.                 }
    157.  
    158.                 if ( hitBalloon )
    159.                 {
    160.                     // Revert my physics properties cause I don't want balloons to influence my travel
    161.                     transform.position = prevPosition;
    162.                     transform.rotation = prevRotation;
    163.                     arrowHeadRB.velocity = prevVelocity;
    164.                     Physics.IgnoreCollision( arrowHeadRB.GetComponent<Collider>(), collision.collider );
    165.                     Physics.IgnoreCollision( shaftRB.GetComponent<Collider>(), collision.collider );
    166.                 }
    167.  
    168.                 if ( canStick )
    169.                 {
    170.                     StickInTarget( collision, travelledFrames < 2 );
    171.                 }
    172.  
    173.                 // Player Collision Check (self hit)
    174.                 if ( Player.instance && collision.collider == Player.instance.headCollider )
    175.                 {
    176.                     Player.instance.PlayerShotSelf();
    177.                 }
    178.             }
    179.         }
    180.  
    181.  
    182.         //-------------------------------------------------
    183.         private void StickInTarget( Collision collision, bool bSkipRayCast )
    184.         {
    185.             Vector3 prevForward = prevRotation * Vector3.forward;
    186.  
    187.             // Only stick in target if the collider is front of the arrow head
    188.             if ( !bSkipRayCast )
    189.             {
    190.                 RaycastHit[] hitInfo;
    191.                 hitInfo = Physics.RaycastAll( prevHeadPosition - prevVelocity * Time.deltaTime, prevForward, prevVelocity.magnitude * Time.deltaTime * 2.0f );
    192.                 bool properHit = false;
    193.                 for ( int i = 0; i < hitInfo.Length; ++i )
    194.                 {
    195.                     RaycastHit hit = hitInfo[i];
    196.  
    197.                     if ( hit.collider == collision.collider )
    198.                     {
    199.                         properHit = true;
    200.                         break;
    201.                     }
    202.                 }
    203.  
    204.                 if ( !properHit )
    205.                 {
    206.                     return;
    207.                 }
    208.             }
    209.  
    210.             Destroy( glintParticle );
    211.  
    212.             inFlight = false;
    213.  
    214.             shaftRB.velocity = Vector3.zero;
    215.             shaftRB.angularVelocity = Vector3.zero;
    216.             shaftRB.isKinematic = true;
    217.             shaftRB.useGravity = false;
    218.             shaftRB.transform.GetComponent<BoxCollider>().enabled = false;
    219.  
    220.             arrowHeadRB.velocity = Vector3.zero;
    221.             arrowHeadRB.angularVelocity = Vector3.zero;
    222.             arrowHeadRB.isKinematic = true;
    223.             arrowHeadRB.useGravity = false;
    224.             arrowHeadRB.transform.GetComponent<BoxCollider>().enabled = false;
    225.  
    226.             hitTargetSound.Play();
    227.  
    228.  
    229.             // If the hit item has a parent, dock an empty object to that
    230.             // this fixes an issue with scaling hierarchy. I suspect this is not sustainable for a large object / scaling hierarchy.
    231.             scaleParentObject = new GameObject( "Arrow Scale Parent" );
    232.             Transform parentTransform = collision.collider.transform;
    233.  
    234.             // Don't do this for weebles because of how it has a fixed joint
    235.             ExplosionWobble wobble = collision.collider.gameObject.GetComponent<ExplosionWobble>();
    236.             if ( !wobble )
    237.             {
    238.                 if ( parentTransform.parent )
    239.                 {
    240.                     parentTransform = parentTransform.parent;
    241.                 }
    242.             }
    243.  
    244.             scaleParentObject.transform.parent = parentTransform;
    245.  
    246.             // Move the arrow to the place on the target collider we were expecting to hit prior to the impact itself knocking it around
    247.             transform.parent = scaleParentObject.transform;
    248.             transform.rotation = prevRotation;
    249.             transform.position = prevPosition;
    250.             transform.position = collision.contacts[0].point - transform.forward * ( 0.75f - ( Util.RemapNumberClamped( prevVelocity.magnitude, 0f, 10f, 0.0f, 0.1f ) + Random.Range( 0.0f, 0.05f ) ) );
    251.         }
    252.  
    253.  
    254.         //-------------------------------------------------
    255.         void OnDestroy()
    256.         {
    257.             if ( scaleParentObject != null )
    258.             {
    259.                 Destroy( scaleParentObject );
    260.             }
    261.         }
    262.     }
    263. }
    264.  
     
    Last edited: Feb 3, 2018
  34. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    One other quick feature... When do you expect to have more than 3 attacks for a humanoid NPC and have animals AI behaviors available?
     
  35. LightMiner

    LightMiner

    Joined:
    Nov 2, 2013
    Posts:
    7
    Hello, In the "PlayerWeapon3rdPerson" script, I noticed that the "hitOtherEffect" is using the parent root position..

    Code (CSharp):
    1. GameObject SpawnedEffect = EmeraldObjectPool.Spawn(hitOtherEffect, hit.point, Quaternion.LookRotation(hit.normal));
    2.                         SpawnedEffect.transform.parent = transform.root;
    How can I set it to be using its own rotation transform rather than using its parent transform?
     
  36. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    @TonyLi I managed to get a page up on my website, I'll probably regret posting it here due to spambots but here is a link to the first page which discusses the faction system. It might seem a bit strange as it refers to the virtue system that I don't have a page up about yet, but it can give you an idea of where I am looking at taking the AI's feelings toward each other on a larger scale. I'll try and take some time tomorrow to write up the virtue system and post that. Also please note the website is accessible but is still mostly the template I was building off, so probably best not to click around the menus outside of "encardia game" :D
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @uberwiggett - Encardia's Faction System sounds like a perfect fit for Love/Hate, with Emerald AI and Quest Machine providing the content that will bump faction values up and down. You could also manage the Virtue System in Love/Hate unless you have a different implementation in mind for it. If you'd like to discuss factions or virtues, I suggest bringing this to the Love/Hate forum thread so we don't take over Will's thread here. And if you want to discuss how quests will impact factions and virtues, you can also post there or the Quest Machine forum thread.

    Love/Hate, Quest Machine, (and the Dialogue System) are all integrated, so it's just a matter of finishing the Emerald AI integrations so Love/Hate factions can take note when the player interacts with Emerald AI entities (e.g., attacks them), and Quest Machine can procedurally generate quests based on the attributes of Emerald AI entities.
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I will work on getting a guide up on the documentation on how this was accomplished. However, it's fairly simple. You can refer to the Destination Example included with Emerald for a crude example. I can briefly explain how it was done for the time being.

    1) Define an AI's Destination point using the Emerald editor then set its Wander Type to Stationary. The AI stays stationary until the player has started the quest.
    2) Once the player stars the quest, you switch the AI's Wander Type to Destination. This can be done with an external script. An AI's Wander Type, and even its Behavior Type, can be changed during runtime.
    3) The AI that is attempting to move to its destination will attacking any AI within the proper opposing faction.
    4) Once the AI has arrived at its destination, its AIReachedDestination variable is set to true. An external script can watch for this and set the next part of the quest or complete the quest once this has happened. An AI's destination can also be changed during runtime making it easy to make additional steps to quests.

    I hope this helps!


    Hey there!

    AI have the ability to either attack or flee from Non-AI Objects. Whether they flee or attack depends on their Behavior Type. So, an Aggressive AI won't flee where a Cautious Cowardly AI will. See the Tag Options and set the Non-AI Tag to the object you would like the AI to detect. In the near future, I will be adding the option for AI to independently avoid certain tags regardless of the AI's Behavior Type.


    Hey there!

    This is something I will be adding soon. However, there is a limit to the amount of AI that can attack one object, even AAA games have this issue. I have Emerald AI 2.0.3 that will be submitted very soon that will bring more improvements. I'm trying to do each update in increments so users don't have to go too long without updates. Thanks for your suggestions.


    Hey there!

    It sounds like you might be having an error. The guide works great so there may have been a mistake made while following the tutorial. If you are having an error, could you please tell me it so I can try to figure out what's happening?


    Hey there!

    It's a little tough to say because I don't know how the mechanics work with your arrow script. But, if I had to guess, I'd say try adding this within your OnCollisionEnter function right above the line: collision.collider.gameObject.SendMessageUpwards( "ApplyDamage", SendMessageOptions.DontRequireReceiver );

    Code (CSharp):
    1. collision.GetComponent<Emerald_AI>().Damage(YourDamageAmount, Emerald_AI.TargetType.Player);

    I'm hoping to have this added with the 2.1 update, which is the update that will also have the breeding and herd features.


    Hey there!

    I think this may work:

    Code (CSharp):
    1. GameObject SpawnedEffect = EmeraldObjectPool.Spawn(hitOtherEffect, hit.point, Quaternion.LookRotation(transform.position));
     
  39. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214


    thanks man, going to try this in a few mins. As far as I can tell, the bow just adds velocity to the arrow game object once you pull back and release. Very simple. Sticks into any object that has the correct physics material. So this should work I'm thinking. Ill post results.

    SteamVR is free also.
     
  40. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214
    how much damage will that apply? Say I want to test an arrow that is a one shot kill on an AI.....
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome and sounds good!


    It depends on how much health your AI has. To be safe, you could try a value of 1,000.
     
  42. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214

    for the AI's health?


    and also, so in the arrow script there is already a similar apply damage line, but when I hit an AI with an arrow, it is not affected whatsoever.

    Code (CSharp):
    1. // Only count collisions with good speed so that arrows on the ground can't deal damage
    2.                     // always pop balloons
    3.                     if ( rbSpeed > 0.1f || hitBalloon )
    4.                     {
    5.                         collision.collider.gameObject.SendMessageUpwards( "ApplyDamage", SendMessageOptions.DontRequireReceiver );
    6.                         gameObject.SendMessage( "HasAppliedDamage", SendMessageOptions.DontRequireReceiver );
    7.                     }
     
  43. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @BHS ,

    Can AI navigate over stairs, different floors and through doors, even locks and keys?

    Also, can the AI cover say regular daily routines, eating, drinking, crafting, harvesting, visiting, trading, sleeping etc? Also can support AI characters know to heal or attack from range or select appropriate spells etc? Could Emerald AI support party tanks, damage dealers, rogues etc?
     
  44. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214
    ah I think it's because of || hitbaloon . believe I can just remove that part so it's not checking if it hits a balloon.
     
  45. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214
    I can confirm the AI in emerald will walk up and down stairs.
     
  46. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214

    Doesn't work, even if I remove || hitbaloon . AI continues to walk around after being shot.
     
  47. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538

    Performance will not be impact the actual script.
    It's the same as actual ranged AI checking some line of sight, but instead it checks sides for movement.

    When distant AI is in wait mode with no line of sight to player you can repeat those checks :
    - after 0.3 seconds check left with raycast , if free space do some movement
    - after 0.3 seconds check right with raycast , if free space do some movement
    - after 0.3 seconds check again line of sight to player
    And repeat that.

    It's nothing complex, performance is the same and ranged AI will only do one raycast check each time interval, while ranged AI should be lot more dynamic in many situations.
     
    Last edited: Feb 4, 2018
  48. Sadanand626

    Sadanand626

    Joined:
    Oct 6, 2017
    Posts:
    2
    For some reason my enemy AI characters set up with Emerald AI are not playing their hit animations when they're struck with melee attacks. I'm using the invector third person controller and Unity 2017.1.0f3. They take damage but they don't play the hit animations. All the other animations work fine. Any idea why this is happening? Thanks.
     
  49. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Do you know when that you will have 2.1 out form public consumption?
     
  50. Demonoid74

    Demonoid74

    Joined:
    Jan 20, 2017
    Posts:
    16
    Hey thanks , that was the problem , was trying to test on an aggressive AI...
    Definitely looking forward to an option to have AI avoid certain tags . That will definitely help out with some ideas I was messing with
     
    uberwiggett likes this.