Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[30% off] - Los Pro - Line of sight & hearing system

Discussion in 'Assets and Asset Store' started by jorisshh, Dec 23, 2015.

  1. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
  2. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Tinjaw likes this.
  3. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    i played all the day with it and really love it, however there is few things that would maybe require some change:

    • when we destroy targets it make an error:
    I think this should not be treated as an error and the target should be just removed from the list.

    • "Targeting Group Mask" on observer: i want target type "Guard" to be able to target "Monster" and "Animals" but i want "Monster" to only target "Guards" so it would really help an editor where we can select some groups like a layer system but without using unity layers, maybe using a bitmask: http://answers.unity3d.com/questions/254661/c-enummaskfield-usage.html

    Using ObserverAggroBehaviour i made this script to decide in my AI if we have a target or not:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using System.Linq;
    5. using UnityEngine.Assertions;
    6. using Devdog.LosPro;
    7.  
    8.  
    9. public class NpcSightLogic : MonoBehaviour,IObserverCallbacks
    10. {
    11.     public ObserverAggroBehaviour obs;
    12.  
    13.     public GameObject currentTarget;
    14.  
    15.     public void OnTargetCameIntoRange(SightTargetInfo info)
    16.     { }
    17.     public void OnTargetWentOutOfRange(SightTargetInfo info)
    18.     {
    19.         if (obs.GetTargetWithHighestAggro () != null)
    20.             currentTarget = obs.GetTargetWithHighestAggro ().target.gameObject;
    21.         else
    22.         currentTarget = null;
    23.     }
    24.     public void OnTargetDestroyed(SightTargetInfo info)
    25.     {
    26.         if (obs.GetTargetWithHighestAggro () != null)
    27.             currentTarget = obs.GetTargetWithHighestAggro ().target.gameObject;
    28.         else
    29.             currentTarget = null;
    30.     }
    31.     public void OnTryingToDetectTarget(SightTargetInfo info) {}
    32.     public void OnDetectingTarget(SightTargetInfo info) {}
    33.  
    34.     public void OnDetectedTarget(SightTargetInfo info)
    35.     {
    36.         currentTarget = obs.GetTargetWithHighestAggro ().target.gameObject;
    37.         //memoryDict[info.target] = LosUtility.time;
    38.     }
    39.     public void OnStopDetectingTarget(SightTargetInfo info)
    40.     {
    41.         if (obs.GetTargetWithHighestAggro () != null)
    42.             currentTarget = obs.GetTargetWithHighestAggro ().target.gameObject;
    43.         else
    44.             currentTarget = null;
    45.     }
    46.     public void OnUnDetectedTarget(SightTargetInfo info)
    47.     {
    48.         if (obs.GetTargetWithHighestAggro () != null)
    49.             currentTarget = obs.GetTargetWithHighestAggro ().target.gameObject;
    50.         else
    51.             currentTarget = null;
    52.     }
    53.  
    54. }
    i had to add a return null in case we had no target:
    Code (CSharp):
    1. public SightTargetAggroInfo GetTargetWithHighestAggro()
    2.         {
    3.             if (aggroDict.Count == 0)
    4.                 return null;
    5.  
    6.             KeyValuePair<ISightTarget, SightTargetAggroInfo> highest = new KeyValuePair<ISightTarget, SightTargetAggroInfo>();
    7.             foreach (var cur in aggroDict)
    8.             {
    9.                 if (highest.Value == null || cur.Value.finalValue > highest.Value.finalValue)
    10.                 {
    11.                     highest = cur;
    12.                 }
    13.             }
    14.  
    15.             return highest.Value;
    16.         }
    • IObserverCallbacks: what would be good is an event "OnAggroListOrderChange" which would be called when we got a new target, a target is removed or the list order is changed because xx target had more aggro than the first one
    • Aggro modules change: I made a script that allow increase aggro bonus each time a target use a skill but i am not able to reduce the aggro bonus over time, the value is not used in modules.
    • Document all component: its actually hard to know what "helper" is doing what, how to use the memory component? does it change something on observer behaviour or on ObserverAggroBehaviour?
     
    Last edited: May 22, 2016
  4. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Thanks for the great feedback, here's what I changed :)

    "when we destroy targets it make an error:"
    Fixed

    "Targeting Group Mask" on observer
    I've added a categories editor. Targets can now have a category and observers have a bitmask. Note that it's not a hardcoded enum, but a dynamic editor using ints :)

    OnAggroListOrderChange

    Added the OnTargetWithHighestAggroChanged callback, as we discussed. Which is only called when a new target is picked.

    Aggro modules change
    The ObserverAggro component now has some extra methods to control the aggro values, as well as forget a target. (in case you want to reset the world).
    The ForgetTarget (reset) is also added to the Observers

    Aggro modules change
    Renamed the AddAggro to ChangeAggro, which handles negative values (ChangeAggro(-10));

    Document all component
    The Memory component has been removed and replaced by SightTargetInfo.lastSeenAt. I'll document the new categories and remainder of the components :)
     
    hopeful likes this.
  5. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    just perfect !
     
  6. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    A patch / cleanup release coming up:


    New:

    • All settings are moved to the new LosSettings object + an editor to edit these settings.
    • Moved run-time extrapolation information to Extrapolation Debugger component (which also makes it work with the 2D variant)
    • Renamed categoryBitflagID to category , as it's not a bitflag
    • Editor improvements
    • Renamed minInvisibleTime to startAfterInvisibleSeconds on aggro component

    Fixes:

    • Targets with no category are always considered for detection + Audio +
    • Updated version number
    • IObserverCallbacks firing properly
    • Fixed ChangeAggro values -> Now adds the correct value
    • Handling destroyed objects properly in ObserverAggroBehaviour (callbacks now fire properly)
    • Updated links to devdog.io
    • If emitter is destroyed aggro module doesn't fail
     
    Tinjaw and hopeful like this.
  7. keepthachange

    keepthachange

    Joined:
    Oct 15, 2014
    Posts:
    87
    Just Bought, Can't wait to test it out.
     
  8. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Nice, let me know what you think of it :)
     
  9. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    Could it be that it is not yet compatible with inventory pro or the scifi skin?
    getting missing windowui messages on import

    would really like to use scifi skins with quest system pro and basically all your other assets together :D
     
  10. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    All devdog assets now use the global library; And I've added a live update tool. So, if you now go to Tools > Devdog > Check for updates it will auto download the newest update and import it into your package :)

    (not all assets are live in the store yet, slowly pushing these to support the general library)
     
    Tiny-Tree likes this.
  11. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Version 0.4 of Los Pro is currently awaiting approval by Unity.
    What changed?

    New
    • Updated demo scenes
    • Updated aggro module -> Calling ChangeAggroForTarget will now add the target to the list if it wasn't already and set the value directly.
    • Made some classes sealed, this allows for some internal optimization by Unity + cleans up code
    • Component paths are now constant variables to allow more flexibility / avoid typos
    • Updated links and documentation to point to new devdog.io website documentation
    • The ObserverTriggerHelperBehaviour has been moved to the _Col (trigger) of the observer. Previously it was attached to the observer itself, however this caused issues with the physics; When a trigger enters a collider the OnTriggerEnter() action is still called, even though that collider is not a trigger (this is consistent between 2D and 3D physics, so it's not a bug, but likely by Unity's design). To avoid other colliders and triggers interfering the helpers were moved to the _Col's object, this way other parent triggers and or colliders cannot interfere.
    Fixes
    • Fixed observer aggro behaviour, didn't forget target when entered and exited trigger to quickly
     
    hopeful likes this.
  12. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    thanks !
     
  13. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    We've now got 5 assets for sale on the Unity Asset store, and to celebrate the launch of Scene Cleaner Pro and the awesome feedback you keep giving us on our assets, we're going to give away all of our assets for free!

    Yep, that's right. $189 worth of assets for free to one lucky winner (plus a special bonus to the 5 people with the most entries in the contest! More about that on the contest page).

    Participate right away:
    http://vyper.io/c/31
     
  14. Steel-Grin

    Steel-Grin

    Joined:
    Aug 28, 2013
    Posts:
    16
    Hi,

    Is there a chance that NodeCanvas will be supported eventually as well?

    Thanks
     
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yeah that might make for a nice addition; I'll consider an integration with NodeCanvas for the next version :)
     
  16. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    There have been some concerns about paid updates and upgrades, so I decided to clear the air a bit.

    After some consideration, I've decided that Inventory Pro, Quest System Pro, The Sci-Fi UI Design, and Los Pro will get free updates and upgrades for life. So no more paid upgrades :)

    Cheers,
    Joris
     
  17. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Los Pro V1.0 is here! And we're having a sale :D - For a limited time only $10! (Full price $25).

    What's new in LOS Pro 1.0?
    With our Line of Sight and Hearing system, you can detect and hear targets in your Unity game world all by attaching a single component to your objects.

    And for this update, we squished out any last minor bugs and errors as well as:
    • Added predicate lists to ISight to allow custom conditions for detection
    • Updated the ModuleList, which is used by both UIWindow and Trigger
    • Updated the Devdog.General library
     
  18. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
  19. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    290
    Can an observer also be a target? Like AI from 3 different factions being able to target anyone depending on the reputation?
     
    jorisshh likes this.
  20. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Sure thing; An observer can also be a target, and you can specify categories in the editor and assign which categories an observer can detect for things like faction usage.
     
  21. SuneT

    SuneT

    Joined:
    Feb 29, 2016
    Posts:
    41
    Quick update: You can win our newest asset; Odin Inspector & Serializer for free in a giveaway we just launched to celebrate that Odin is soon ready for release! :)

    Join here: http://vyper.io/c/1059
     
  22. SuneT

    SuneT

    Joined:
    Feb 29, 2016
    Posts:
    41
    A bit of news
    We've decided to turn our own forums at forum.devdog.io to "read-only" and instead switch to our own Discord server.

    The Discord server will allow for faster support and quicker messaging back and forth! ;)

    So if you're experiencing any issues, have feedback, or just want to show-off whatever you've made using any of our tools and hang out with us, come join: https://discord.gg/zjNj5zZ
     
    Last edited: Sep 9, 2017
    ElectroMantis likes this.
  23. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522

    Ho ho ho

    Tis the season of Christmas surprises, and we have an awesome one for you!

    Sponsored by all your favorite Unity Asset Store developers, Nordic Game Jam, Pocket Gamer Connects, and co-hosted by Game Analytics, we (Joris and I – Devdog) are launching the second edition of our yearly Christmas Giveaway Calendar for all Unity game developers!

    You can already now sign up right here.


    So what’s this all about?
    For the past weeks, we’ve been collecting sponsored gifts related to Unity (asset vouchers, product keys, conference tickets etc.), and throughout each day of December leading up to Christmas Day on the 25th, we will be sending out these sponsored gifts as early gamedev Christmas presents via e-mail to hundreds of lucky winners.

    The total prize pool is at $35,000, with over 1200 presents donated by the awesome sponsors!


    Merry Christmas from Devdog, and every single one of the sponsors.