Search Unity

Apex Utility AI

Discussion in 'Assets and Asset Store' started by Apex Game Tools, Dec 22, 2015.

  1. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Sounds to me as though you have a meta mismatch. The product comes with meta files for all dlls, if these have somehow been altered (which can happen if you move stuff around and forget the metas) then you will have issues.
    Check you source control after importing the new version. If any metas are listed as changed, then you will need to undo that change to keep using you own metas.
     
    henkjan likes this.
  2. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    Thanks! I managed to fix it by importing the plugin in a new Unity project and than copying the files to the project I'm working on. (for anyone with the same problem :) )
     
  3. GreatVV

    GreatVV

    Joined:
    Feb 6, 2014
    Posts:
    5
    Hi
    I have a problem with ÅI Editor window.
    I have this error any time I try to add a new custom contextual scorer.

    Code (CSharp):
    1.  
    2. ArgumentException: An element with the same key already exists in the dictionary.
    3. System.Collections.Generic.Dictionary`2[System.String,Apex.AI.Editor.Reflection.IEditorField].Add (System.String key, IEditorField value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    4. System.Linq.Enumerable.ToDictionary[IEditorField,String,IEditorField] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector, IEqualityComparer`1 comparer)
    5. System.Linq.Enumerable.ToDictionary[IEditorField,String] (IEnumerable`1 source, System.Func`2 keySelector, IEqualityComparer`1 comparer)
    6. System.Linq.Enumerable.ToDictionary[IEditorField,String] (IEnumerable`1 source, System.Func`2 keySelector)
    7. Apex.AI.Editor.Reflection.ReflectMaster.GetSerializedMembers (System.Type t, System.Object item, Apex.AI.Editor.Reflection.DependencyChecker& dependencyChecker) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/Reflection/ReflectMaster.cs:91)
    8. Apex.AI.Editor.Reflection.ReflectMaster.Reflect (System.Object item) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/Reflection/ReflectMaster.cs:29)
    9. Apex.AI.Editor.Reflection.ListFieldBase+<>c__DisplayClassb.<AddNew>b__a (System.Type[] selectedTypes) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/Reflection/ListFieldBase.cs:379)
    10. Apex.AI.Editor.AIEntitySelectorWindow.OnSelect (.NamedType[] items) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/AIEntitySelectorWindow.cs:71)
    11. Apex.Editor.ListView`1[Apex.AI.Editor.Reflection.AIBuildingBlocks+NamedType].DoSelect () (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/ListView.cs:345)
    12. Apex.Editor.ListView`1[Apex.AI.Editor.Reflection.AIBuildingBlocks+NamedType].Render (Rect rect, IEnumerable`1 itemList, Single elementHeight, Single elementPadding) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/ListView.cs:261)
    13. Apex.Editor.ListView`1[Apex.AI.Editor.Reflection.AIBuildingBlocks+NamedType].Render (IEnumerable`1 itemList, Single elementHeight, Single elementPadding) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/ListView.cs:117)
    14. Apex.Editor.SelectorWindow`1[T].OnGUI () (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/SelectorWindow.cs:80)
    15. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    16. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    17. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    18. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    19. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    20. UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    21. UnityEditor.HostView.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:107)
    22. UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:182)
    23.  
    Step to reproduce.
    1. Create any custom contextual scorer;
    2. Open AI Editor window.
    3. Try to add new scorer to any qualifier
    It happens in my project 99% percent of time.
    The funny fact. If you see the asset it shows that scorerer has been added:
    Code (csharp):
    1.  
    2. `%YAML 1.1
    3. %TAG !u! tag:unity3d.com,2011:
    4. --- !u!114 &11400000
    5. MonoBehaviour:
    6.   m_ObjectHideFlags: 0
    7.   m_PrefabParentObject: {fileID: 0}
    8.   m_PrefabInternal: {fileID: 0}
    9.   m_GameObject: {fileID: 0}
    10.   m_Enabled: 1
    11.   m_EditorHideFlags: 0
    12.   m_Script: {fileID: 1719459976, guid: 6012f3241c1c1f7409c44769fc0a1db7, type: 3}
    13.   m_Name: Basic
    14.   m_EditorClassIdentifier:
    15.   description:
    16.   version: 16779010
    17.   aiId: 9ebbad22-6dfe-49e9-9126-1ea528455609
    18.   configuration: '{"@type":"Apex.AI.UtilityAI, ApexAI","_rootSelectorId":b9b54e4014064eb2a1c118471c0cb5fc,"_id":9ebbad226dfe49e991261ea528455609,"_selectors":[{"@type":"Apex.AI.ScoreSelector,
    19.    ApexAI","_id":b9b54e4014064eb2a1c118471c0cb5fc,"_qualifiers":[{"@type":"Apex.AI.CompositeAllOrNothingQualifier,
    20.    ApexAI","action":{"@type":"Apex.AI.SelectorAction, ApexAI","_selectorId":d71d157029c34d3ba5b32dea5427d956},"_scorers":[]}],"_defaultQualifier":{"@type":"Apex.AI.DefaultQualifier,
    21.    ApexAI","action":{"@type":"Gameplay.Model.Bot.Sophisticated.Actions.NoCardAction,
    22.    Assembly-CSharp"}}},{"@type":"Apex.AI.PrioritySelector, ApexAI","_id":d71d157029c34d3ba5b32dea5427d956,"_qualifiers":[{"@type":"Apex.AI.CompositeAllOrNothingQualifier,
    23.    ApexAI","action":{"@type":"Gameplay.Model.Bot.Sophisticated.Actions.NoCardAction,
    24.    Assembly-CSharp"},"_scorers":[{"@type":"Gameplay.Model.Bot.Sophisticated.Scorers.HasSpell,
    25.    Assembly-CSharp","score":0},{"@type":"Gameplay.Model.Bot.Sophisticated.Scorers.HasSpell,
    26.    Assembly-CSharp","score":0}]}],"_defaultQualifier":{"@type":"Apex.AI.DefaultQualifier,
    27.    ApexAI"}}]}'
    28.   editorConfiguration: '{"offset":{"@x":0,"@y":0},"zoom":1,"SelectorView":{"ViewArea":{"[USER=15753]@left[/USER]":100,"[USER=165072]@Top[/USER]":100,"@width":200,"[USER=756315]@height[/USER]":160},"QualifierView":{"Name":"Has
    29.    Attack Spell Card","ActionView":{"@connectorType":"Selector"}},"DefaultQualifier":{"Name":"If
    30.    No Spell Card","ActionView":{}}},"SelectorView":{"ViewArea":{"[USER=15753]@left[/USER]":400,"[USER=165072]@Top[/USER]":120,"@width":200,"[USER=756315]@height[/USER]":160},"QualifierView":{"ActionView":{}},"DefaultQualifier":{}}}'`
    31.  
    In above example custom scorerer is named: "Gameplay.Model.Bot.Sophisticated.Scorers.HasSpell"
     
  4. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Any plans to incorporate ECS and the jobs system?
     
    blitzvb likes this.
  5. Rami_Ahmed

    Rami_Ahmed

    Joined:
    Apr 14, 2016
    Posts:
    25
    Hi @GreatVV

    Could you share an image of your AI Editor Asset or the code that the Scorer has? The exception you are getting is seemingly caused by two serialized fields resolving to use the same shown name, e.g. due to inheritance usage of private variables or the FriendlyNameAttribute.

    Ensure that two fields don't resolve to using the same name. If you cannot figure out what the issue is or a name clash does not seem to be the case, you can post on our forums or send us an email: support@apexgametools.com.

    Hi @christoph_r

    We currently have no plans to utilize ECS or the Jobs system when they are out of beta.
     
  6. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    That is unfortunate but understandable to an extent. Well, guess I better start looking into some open source frameworks then.
     
  7. GreatVV

    GreatVV

    Joined:
    Feb 6, 2014
    Posts:
    5
    Thanks for answer but it was my fault - in Inherited class I created a field "score" - and it is the same name in the base class. And you literally can't fix this easily ) I think the only way you can make it better - change the error message with the name of incorrect field.
     
  8. Rami_Ahmed

    Rami_Ahmed

    Joined:
    Apr 14, 2016
    Posts:
    25
    Glad to hear you resolved it @GreatVV - I have logged your suggestion to improve the error message, but I cannot say when or even if it will be included in an update, at this time.

    @christoph_r I'm not exactly sure why it would be a requirement. You can make your own equivalent to the UtilityAIComponent that is based on ECS, and the Utility AI framework itself is very high performant. I cannot see a reason why it should not be usable together with a game that is based on the Jobs system and using ECS.
     
  9. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Since jobs (and at least philosophically the ECS, too) strongly rely on native arrays and custom structs. As the source is closed, I don't see how it could be nicely jobified. Another issue is that if I don't want to do run the AI on the main thread/use your load balancer, synching up the ECS and the AI is also a potential source of headaches.

    Creating a system that works alongside the ECS is feasible, sure, but one that integrates nicely with it and at the same time allows to leverage at least some of the ECS and jobs performance benefits seems hard to me. Or am I missing something here?
     
  10. Rami_Ahmed

    Rami_Ahmed

    Joined:
    Apr 14, 2016
    Posts:
    25
    No, you're right @christoph_r - what I meant was exactly that the Utility AI could relatively easily run alongside the ECS. If everything in the game has to live inside these new systems, then Apex Utility AI may not be the right choice for your project.
     
  11. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Did the Xbox One support end up happening? Second question, did you guys end up creating any other demos other than the RTS and the Survival Shooter...something a bit more complex perhaps?

    I did happen upon this recent trailer on YouTube and its showcasing you guy's AI system. Looks pretty wild and cool! (not my game, just as a disclaimer).

     
  12. Rami_Ahmed

    Rami_Ahmed

    Joined:
    Apr 14, 2016
    Posts:
    25
    Thanks for posting @JamesArndt

    The situation in regards to Xbox One support has not changed.

    We do not have any other demos ready or near release for the Utility AI. The Survival Shooter and RTS demos should get most users up and running with semi-complex scenarios though, and our forums are open for support requests or AI discussions within reason.

    Unleash is a commercial Tower Wars game that we are actually developing ourselves for Steam Early Access release, as the Teaser trailer also states. I'm happy to see that you found it and find it interesting! You can find out much more about the game through our website at: http://UnleashGame.com. And yes, we are utilizing our own Apex Utility AI for all AI bots in the game.
     
    JamesArndt likes this.
  13. blackdheart

    blackdheart

    Joined:
    Jan 5, 2017
    Posts:
    3
    Hi! I can't seem to find Apex Survival Shooter Example in the Asset Store anymore, where is it now? It was the only good example project for Utility AI.
     
  14. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Yes Unity removed it since it contains js code (their own), however have a look at this thread.
     
    blackdheart likes this.
  15. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Can it be run from own thread?
     
  16. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Sure you can run it in a separate thread, just instantiate and configure the UtilityAIClient manually.
     
    Roni92pl likes this.
  17. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    614
    is this planned to be supported long term still?
     
  18. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Well that would depend on the definition of 'long term'.
    We have stopped all active development on all Asset Store products, but have retained minimal support for the Utility AI.
    We have no immediate plans to shut down support entirely, but I also cannot guarantee that it won't happen.
     
  19. TheFunnySide

    TheFunnySide

    Joined:
    Nov 17, 2018
    Posts:
    200
    In the survival shooter tutorial they chose to move and then chose the position that is optimal.
    What if i wanted the best position my character can move to, transformed into a score for the decision to move?
    What is the apex way of doing that? Instead of hardcoding it directly.
     
  20. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    There is no particular way of doing that, it all depends on what you are trying to achieve.
    You need to answer the question: How does the potential move position influence the decision to move?
    And then translate that into a score using whatever algorithm that makes sense to you.
    For instance it could be some function of the distance.
     
  21. TheFunnySide

    TheFunnySide

    Joined:
    Nov 17, 2018
    Posts:
    200
    Ok i have decieded to add the qualifiers at runtime. One for each position my character can move to. I can afford the computations because my game is turnbased and has a finite number of tiles.
     
  22. Spiral-Organ

    Spiral-Organ

    Joined:
    Aug 20, 2015
    Posts:
    26
    Does Apex Utility AI have built-in actions for moving a mecanim root-motion character, i.e, using NavMeshPath and calculating speed and angle? I see Apex Path has been deprecated and was wondering if the functions have been moved into the Utility AI
     
  23. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Apex Utility AI is purely a tool/framework for creating and configuring AIs, there is no built-in functionality such as path finding or steering.
     
  24. Artanic

    Artanic

    Joined:
    Nov 26, 2012
    Posts:
    9
    If you do stop. Will people who purchased be able to get the source files? I use utility AI for my games but I'm reluctant to continue if at some random point in the future it becomes unusable with no way to fixing it.
     
  25. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    That is fully understandable. We will make the Utility AI source accessible at least to customers who bought it.
     
  26. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I was reconsidering giving this product a try.
    But since it looks like it is a subscription based product I decided not to.

    Just wanted to give you a feedback.
     
  27. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    Your webpage is not working well for me. All tutorial videos are throwing this type error:

    Sorry, there was a YouTube API error: Project 695190334619 has been scheduled for deletion and cannot be used for API calls. Visit https://console.developers.google.com/iam-admin/projects?pendingDeletion=true to undelete the project. Please make sure you performed the steps in this video to create and save a proper server API key.

    and the link to the support forum in the asset store gives a 404.

    Bummer you guys are closing up on this project, but that's hows it goes sometimes.
     
  28. Spiral-Organ

    Spiral-Organ

    Joined:
    Aug 20, 2015
    Posts:
    26
    After experimenting with this AI system, I can safely say this is by far the best implementation in the Unity Asset Store.

    It would be an extreme shame if this project was dropped.

    The learning curve is far from being steep. In fact, it makes AI decision and scoring so much easier to visualize and manage. Whether it be a simple activate reflection probe when player is within a certain distance to an area or an MMO style world boss with fancy attack patterns, with enough clever scoring arrangements, the flow charts for both look more or less the same. You have no idea how much easier this implementation of Utility AI is compared to others with graphs or intersecting curves. I can't for the life of me imagine what a scoring curve for attack patterns would even look like! But I can abstract the priorities and scoring in my head as value ranges, and so far only this product allows me to do that. I know not too many people gave this product a good review, but those of us who managed to wield its full potential might have kept silent to keep it a secret.

    The learning curve is not steep. This is infinitely better than a messy behavior tree. Advanced decision-making logic flow is child's play with this product. I believe this product would work wonders on other platforms like Nintendo Switch. ECS and Job System would work very well for the load balancer as well I would imagine. If you guys at Apex Team decided this product was not profitable or unsustainable, then maybe alot of us were wrong for keeping this under wraps. This product should be spammed everywhere like wildfire. I don't know if I should be saying this, but while it's nice you're giving the source code to those of us who bought it, I have to say I'm not particularly thrilled at the prospect of porting the load-balancer and presumably native C++ code in the dlls to the ECS and job system... (I mean it's fine I suppose... I'll just have to live with being confined to the PC platform and object-oriented code... this DOTS system seems like a really big deal but then again I might just be chasing a moving target again. Who knows.)
     
    nirvanajie likes this.
  29. Spiral-Organ

    Spiral-Organ

    Joined:
    Aug 20, 2015
    Posts:
    26
    P.S. For those of you who think a curve editor is better for parameters like hunger or energy levels throughout a day for example, I have to point out that you can simply write a scorer as an equation. Take the input of time and yield a resulting score. It's still just as simple. This AI is the one thing in the world that will make you LIKE doing math again.
     
  30. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    I think it's just a broken link for the tutorials in Apex website. You can find the tutorials here
     
  31. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    I see this went open source. It's a shame it was made GPL, since that makes it unusable for any commercial game. GPL is an infectious license which requires any 'larger work' that uses GPL code to also be released under GPL. The larger work is your game. So if you use this, you'd have to publish the full source code to your game. Not cool. :(
     
  32. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    You are right, that was not the intention, it was meant to be released under the LGPL not GPL.
    I will get that sorted right away.
     
    Zoey_O and ceebeee like this.
  33. Sanginius

    Sanginius

    Joined:
    Apr 21, 2013
    Posts:
    14
    I just want to say thanks for this awesome site tool. It’s exactly what I needed and both tutorials (RTS and Shooter) are amazing to get in to it.

    I was wondering though if the apex team is working on something new as well? Because the website, announcements and news seem pretty left lonely.

    In any case it works great with the latest unity release.
     
  34. Qianfulong

    Qianfulong

    Joined:
    Mar 15, 2017
    Posts:
    7
    Hi,
    since the Apex Homesite is gone, where would i get the Survival Shooter Demo project now? The tutorials on youtube are nice but they do not show all of the implementation specifics, so i really would like to have a go at the survival shooter project. If there is no official place to get it any longer, would someone who already downloaded it be so kind as to upload it somewhere and post a link here? Thx in advance!
     
  35. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    Try it here (tested).
     
  36. Qianfulong

    Qianfulong

    Joined:
    Mar 15, 2017
    Posts:
    7
    Unfortunately it doesnt work. It brings me to the archived forum post, but then the links in that will not work. Any oterh idea?
     
  37. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    @guidkal69
    Shooter example :
    Apex Path
    Code (csharp):
    1.  
    2. https://drive.google.com/uc?export=download&id=1eATPL5C2N03-geIMJJgJXn0liw7MQ5vh
    3.  
    Unity Navmesh
    Code (csharp):
    1.  
    2. https://drive.google.com/uc?export=download&id=1u-R2uep9lNlBBLGE8HbbRNFJksKoUA3c
    3.  
     
  38. Qianfulong

    Qianfulong

    Joined:
    Mar 15, 2017
    Posts:
    7
    It worked, thank you so much @vortexilation
    Thank you for answering that quick and taking the time!
     
    siliwangi likes this.
  39. Glowing_Slab

    Glowing_Slab

    Joined:
    Jun 19, 2015
    Posts:
    43
    Hi, I'm seeing a hard to pin down issue with Apex Path's GridComponent.cs in Unity 2018.4.11f (LTS). Some projects run fine but in others GridComponent shows up in the Editor as a file with an issue (missing MonoBehaviour). Some kind of meta data issue I'm guessing. If I copy the entire Unity Project folder the working project is okay, if I just copy the Assets and Project Settings folders GridComponent doesn't compile. I also notice that it doesn't show the BakedData field for the GridComponent either when it has an error. Has anyone else seen this?
     
  40. ThePilgrim

    ThePilgrim

    Joined:
    Apr 25, 2013
    Posts:
    17
    I'm getting an error after upgrading from Unity version 2019.3.7 to 2019.3.9. When I try to open an AI asset I am asked if I want to use the repair tool, and I get the error below. Then I get another error if I try to repair.

    Failed to load AI: Object reference not set to an instance of an object
    UnityEngine.Debug:LogWarning(Object)
    Apex.AI.Editor.AIUI:LoadFrom(AIStorage, Boolean) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/AIUI.cs:1249)
    Apex.AI.Editor.AIUI:Load(AIStorage, Boolean) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/AIUI.cs:206)
    Apex.AI.Editor.AIUI:Load(String, Boolean) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/AIUI.cs:198)
    Apex.AI.Editor.AIEditorWindow:Load(String, Boolean) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/AIEditorWindow.cs:311)
    Apex.AI.Editor.AIEditorWindow:Open(String) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/AIEditorWindow.cs:233)
    Apex.AI.Editor.<>cDisplayClasse:<ExecuteCommand>b7() (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/UnityEventListener.cs:129)
    Apex.AI.Editor.UnityEventListener:<ExecuteCommand>b__b() (at c:/Development/Apex Applications/ApexGameTools/Source/ApexAI/ApexAIEditor/UnityEventListener.cs:187)
    Apex.Editor.EditorAsyncTask:poll() (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/EditorAsync.cs:140)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()