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. Dismiss Notice

[Updated] DecisionFlex: AI toolkit for emergent and human-like decision making

Discussion in 'Assets and Asset Store' started by andrew-fray, Nov 18, 2014.

  1. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    http://www.tenpn.com/DecisionFlex.html
    http://u3d.as/content/ten-pn/decision-flex
    Have you ever found yourself writing cascading if-else statements to evaluate what your AI does next? Constantly tweaking logic and parameters to make the AI behave realistically, only to find an edge case that makes your grunt try to snipe a distant foe instead of the enemy trying to knife him?

    Enter DecisionFlex, a toolkit for adding emergent and human-like decision making to your Unity game.



    It's useful for:
    • A soldier choosing its next target, based on target range, type and the soldier’s ammo count
    • A Sims-like human choosing to eat, drink, work or exercise based on hunger, thirst, wealth and fitness
    • A bot choosing to prioritise picking up a health pack, based on the bot’s HP and distance to the nearest pack
    • Any time you find AI trying to make a decision between many actions based on multiple factors
    You simply use editor-based tools you already know, like the hierarchy and animation curves, to define a decision as a series of actions. Each action then has one or more considerations, such as enemy range, ammo count and weapon strength, informing DecisionFlex how to weigh that action against others. And that's it! Iterate, tweak and extend easily, until you have fantastic AI.

    You can find more info on DecisionFlex, including several web demos, and buy direct at http://www.tenpn.com/DecisionFlex.html. You can buy it on the asset store at http://u3d.as/content/ten-pn/decision-flex.

    Ask questions below!
     
    Last edited: Dec 15, 2014
  2. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    An early-access version of DecisionFlex is available to buy now: http://tenpn.itch.io/decisionflex

    It's feature-complete but the documentation is still in progress. Anyone buying now will get a full version from itch on release.
     
  3. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
  4. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
  5. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Hi could this also be used for relationship/faction AI as well?
     
  6. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Certainly! Without knowing your specifics, each faction would want several reasons (in DecisionFlex-speak, "considerations") of why they would like the player. Eg, number of missions completed for the faction, and time since last completed mission. You could then let DecisionFlex decide that even though someone's played a lot of missions for faction A, they have played /some/ missions more recently for faction B, so A doesn't like them too much any more. All arranged very visually in the editor, with no cascading hard-to-maintain if-else blocks in your scripts.
     
  7. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    So if I get it at your website would it be possible to get a unity voucher when it goes live so I can update it via the asset store? After providing proof of purchase, of course.
     
  8. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    I'm sorry, I'd really like to, but there's two reasons why I can't convert a purchase on my site into an asset store code:
    - unity only lets me make 12 vouchers per package per year, so I couldn't give it to all customers who had already bought through my site, let alone new purchases
    - unity's T&Cs expressly say I can't "sell vouchers or otherwise charge for them"

    However anyone who buys through my site will be able to download new versions any time there's an update. I'll be figuring out some way to keep people informed of updates as well - I have the email of customers, but don't necessarily want to spam them. I'll definitely be updating this thread.
     
  9. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Could you use this to create personalities?
     
  10. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Hey Licarell, I'll need some more info on your specific game to answer that. DecisionFlex is for choosing between multiple actions, so while you could and should implement personalities into your decisions, DecisionFlex is more like one manifestation of your AI's personality than a complete solution itself.

    For an example, let's pretend we're working on a support character that will play alongside the player. We could use DecisionFlex to choose the next target to attack, and the weapon to use - attack nearby players first, use sniper rifle against far targets, use knife if you're out of ammo, etc. A very aggressive support character could have a boost to his knife action, making melee combat more likely. Or a sniper support character could have a preference for sniping targets even if near, and running rather than resorting to a knife for near-by enemies. All of this would be set up with animation curves in the editor, and would be easy to iterate on at runtime.
     
    Last edited: Dec 8, 2014
  11. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    Ok, no problem. I went along and purchased the package. The demos look really good.
     
  12. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Well my thoughts are that you could have a follower that through spending time, quests, would build like an affection level... that a follower could fall in love, be jealous, upset if the player does something wrong, (needless killing, stealing etc.) kinda like Skyrim in the fact that they allowed marriage.
     
  13. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Ah now I understand a bit better. That's certainly possible, using DecisionFlex as one part of that system. DF is very focused on single decisions, and doesn't do state, so you'd need some tracker of current affection, and events and actions changing that affection over time. However when it comes to decide if the follower should for example marry the player now, then DecisionFlex would step in and make the decision based on the affection level, and maybe personality traits and other factors.

    DecisionFlex is very much an AI tool rather than a framework, and I think that's reflected in the $45 price. It's something you might find yourself using in many different places in your game in many different contexts.
     
  14. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    blueivy likes this.
  15. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Been thinking about this. Could a social meter be added to the human ai that would make agents want to talk to other agents.
     
  16. Alexarah

    Alexarah

    Joined:
    May 1, 2014
    Posts:
    110
    Hey Andrew a question, can Decision Flex be suitable for fighting game AI? Because the only thing on the Asset Store at the moment that can be used for fighting games is Fuzzy AI but it's only for a game toolkit called UFE. I'm very interested in Decision Flex and would like to know what kind of games can it be used best for if not a fighting game. I look forward to hearing from you Andrew. Cheers!
     
  17. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Hey Blue, I think I need more info to answer your question properly. DecisionFlex could be used to decide if an NPC was going to talk to you, or if an NPC should choose "talk" out of many possible actions. But it is most suited to situations where there are many factors ("considerations" in DFlex-speak) informing each choice. If the social meter was combined with say, time since last talked and distance to other NPCs, DecisionFlex would work very well indeed.
     
  18. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    By itself, I think DecisionFlex would work ok for fighting game AI. You might want to combine it with a simple state machine or behaviour tree as well for added flexibility.

    Let's break down an example and see how it could work! DecisionFlex is a tool for deciding between one of many actions, based on multiple considerations. In our case those actions could be block, punch high, kick low, etc. DecisionFlex asks each action for a score, and makes a selection based on those scores. Some games might want to always pick the highest-scoring action, while others might want to pick randomly but biased towards the high-scoring actions. This latter approach makes things seem a bit more human at the cost of an ocassional mistake, so let's use it for our fighting game.

    Considerations are parented to individual actions. The action scores itself by asking each consideration for an individual score, and multiplying them all together. Punch High might have a NearOpponent consideration that scores high when the opponent is near and StandingOpponent that scores high when the opponent is standing. So if you're standing near an opponent, punching gets a really good score and therefore a good chance of executing. As you move away, the score drops until beyond some distance it reaches zero.

    Block might have a AttackingOpponent consideration that scores highly when the opponent is attacking and another NearOpponent similar to before. It could also have an AggressiveStyle consideration that scores low when the AI character is an aggressive one. Since consideration scores are multiplied together for the action score, a low AggressiveStyle consideration will make blocking less likely, letting other actions happen more.

    This post is getting a bit epic, but let's look at some examples:

    Code (JavaScript):
    1.               Ex1     Ex2  
    2. Punch      
    3. - NearOpp      0.8    0.8  
    4. - StandingOpp  0      1    
    5.              = 0      0.8  
    6. Block
    7. - NearOpp      0.8    0.8  
    8. - AttackingOpp 0.7    0.9  
    9. - Aggressive   0.5    0.5  
    10.              = 0.28   0.36  

    In the first example, the player isn't standing, so the punch action knows it doesn't want to execute. Block is allowed because an attack is happening. In the second example, the player is standing and attacking. Block's Aggressive consideration brings the score right down, so punch is much more likely to execute than block.

    You can find these kind of decisions - between multiple actions, based on multiple considerations - in almost every game, and DecisionFlex can help you make those decisions more human and interesting to the player.
     
    Last edited: Jan 2, 2015
  19. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    ikemen_blueD and Ghosthowl like this.
  20. DrBlort

    DrBlort

    Joined:
    Nov 14, 2012
    Posts:
    72
    @andrew fray

    Hello! I'm interested in using DF for my game AI, and I have some questions. I confess to being a newcomer into utility based AI, so for all of them, a general question would be "does it depends on DF or my game code?" :)


    Multiple Simultaneous Actions
    Is it possible to arrive to more than one simultaneous decision?
    Example: the character is under attack, so the desired result would be that it has to shoot, and also move towards cover because it has low health.

    Is it feasible or I have to make three actions? (shoot / move / shoot and move) That would seem to defeat the purpose, though.


    Re-utilizing considerations
    Can agents share a consideration made by another? Mostly to avoid calculating several times the same or similar thing.
    Example: having one soldier in a group detecting an enemy which evaluates to be close enough and a big threat level, make the rest of the soldiers of the group use that same threat value (instead of individually calculating distances again) as input for their individual decision making.


    Multiple utilities
    I'm thinking about an example in the book "Behavioral mathematics for game AI", which you probably have read :)
    Specifically (figure 9.1 for reference) where it shows that it factors multiple utilities to arrive to a single value, and then evaluate that value with another (which also was calculated from multiple utilities), and only then arriving at a decision.
    Basically, N levels of considerations before choosing an action.

    Is that's possible to do with DF? I imagine using a hierarchy of considerations, where the input is the result from the previous considerations.

    Example: The one I can think right now it's related to the previous question, where I'd want to take one of the utility results from the first level to be re-utilized for another action, without having to be recalculated for everybody, but not from the second and third levels.


    Replacement for GOAP

    You mentioned that DF can be used together with other systems (as a matter of fact, my original idea when I started researching Utility Based AI, was to use DF to decide the WHAT to do, and my current GOAP implementation for the HOW to do it), but I'm wondering how applicable would be DF to replace GOAP by making those decisions on the fly.


    Cheers!
     
  21. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Hello @DrBlort! Great questions!

    > Is it possible to arrive to more than one simultaneous decision?

    No, DecisionFlex is all about reaching 1 decision given multiple options and considerations. But this is fine, because the canonical way to implement your specific example of moving-and-shooting is to have two very loosely connected AIs, one running the legs and one aiming and firing the gun. They would most likely share knowledge, so the legs would know if they were under fire and choose cover accordingly, and the gun AI would know it was moving and so not select targets that need a steady sniper shot, or whatever. DFlex is capable of running both those AIs.

    > Can agents share a consideration made by another?

    Almost all the expensive calculations should be in your context factory script. There you have the freedom to share values across units and optimise -- although what you're talking about here sounds like an influence or threat map that you could update and later read in your context factory.

    The considerations themselves just read a value from a dictionary and push it through an animation curve, which is pretty cheap, so I wouldn't worry about having many in your scene even if they're repeating work. However if you _do_ start to get into perf issues, there are timeslicing tools in DecisionFlex that will let you spread unity updates over several frames to keep the frametime predictable.

    > Multiple utilities?

    Unfortunately not right now, but you're the second person to ask for that feature inside a week, so I'm going to start thinking more about it. It wouldn't be hard to bodge something, but it depends on how nice the editor experience should be. I've found in my experience that I haven't really needed that structure too much, so you may find in practice it's not needed.

    > Replacing GOAP?

    Great question. DFlex by itself can only ever be reactive; so while you can use it as a component of a GOAP implementation, it's not a planner. In layman's terms this means it's never going to make long-term plans like "move across towards that tank so I can man the gun and take out the APC between me and more ammo", but in the heat of the moment it's going to make good decisions. I guess it all depends on the problem you're trying to solve, and the fidelity of the AI you need, as to if you use DFlex by itself or as a component.

    Cheers!
     
  22. DrBlort

    DrBlort

    Joined:
    Nov 14, 2012
    Posts:
    72
    Hey @andrew fray !

    Thanks for the quick response!

    I see now that for my first two questions I was thinking of a single system that handled everything (a master brain of sorts). It actually does more sense to have smaller specialized subsystems.

    About the multiple utilities, I do see the issue on the editor experience. It'll probably require at least an editor script to put a dropdown to select the input type (curve or another consideration) and change the rest accordingly.
    At any rate, if you haven't found that needed in practice, it probably isn't. My question was more "academically" inspired than practical (as I mentioned, I'm still learning and haven't implemented an utility based AI by myself). So I'd wait until I have a real need to ask for something like that :)

    About using DF as GOAP replacement, I understand what you say about being reactive. I guess I'll have to try and see what works.

    Thanks again! I've just bought it, I'll play with it and see how it goes :)
     
  23. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    > I've just bought it

    Like a baws. Thank you!
     
    DrBlort likes this.
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    I'm looking at this as a possible asset to buy, but I'm very much in the dark as to the full extent of what this does or how it would integrate. I see all kinds of information on AI decision making and the online demo shows how decisions are made based on various parameters (hungry, thirsty, etc.), but how does this all translate to the 3D character in the game actually doing the actions? From what I'm reading it seems like all the actual work by the AI entity must be coded separately. So what kind of interface is provided for the programmer to implement the results of AI decisions? Or am I completely missing something?
     
  25. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Hey @magique,

    You're absolutely right that DecisionFlex is agnostic about your codebase. It cares about one thing, which is making decisions, and leaves everything else to you. To that end it's very easy to integrate with an existing codebase - you only need to provide inputs and process outputs.

    In fact, the source for the demos you find on the website, including the DFlex interface code, is open source here: https://github.com/tenpn/DecisionFlexDemos/. This folder https://github.com/tenpn/DecisionFlexDemos/tree/master/iPerson/Scripts/DecisionFlex contains all the interface code between DFlex and the iPerson demo engine, which you can see, after all the usual C# bookkeeping, is only about 10 lines of actual code.

    The DFlex input in the iPerson demo is all in this file: https://github.com/tenpn/DecisionFl...ripts/DecisionFlex/AttributeContextFactory.cs. To make a decision, DFlex needs to know the person's hunger, thirst, etc. The thing that provides this data is called a "context factory" in DFlex parlance. Because it creates (like a factory) the "context" in which the decision is made. Any script can do this - it's only one function you need to provide that returns a dictionary mapping string names to floats.

    You have a few ways to capture the output. The easiest way is to create Action scripts. These each have a single function that's called when that action is selected. In a real-life sims game, these would be the scripts that walk the character to the fridge to get a sandwich, or whatever.

    You don't have to write one script per possible action, as long as you have a general case. For instance, the iPerson has many possible actions - Eat, Sleep, Work, Drink - but only two Action scripts, because it can use inspector parameters to change how each instance works. Here's the code behind one: https://github.com/tenpn/DecisionFl...erson/Scripts/DecisionFlex/ModifyAttribute.cs.

    The other way to act on actions is to call DecisionFlex.PerformAction() on the DFlex instance itself, which will make the calculation then return you the output. You can then parse the output and execute as appropriate. See the public docs at http://www.tenpn.com/df-v1.1/class_...n_flex.html#aa7ee4f654dcaab349f2ea9dfaa5cbfe9 for more info!

    Hope this helped. Let me know if you'd like more info.
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    @Andrew, thanks for the details. I currently have Behavior Designer and ICE Creature Controller and was looking for other possibilities.
     
  27. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,927
    Same here. But I like the sound of this. I guess what I would like to see is a short little demo showing how it works with animations and all that jazz. I am not a coder but will have to report to my programmers about this and I think if it requires a lot of work on their part, they might throw something at me. :)
     
  28. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    @Teila have your programmers email me at andrew@tenpn.com and we can talk about it. I believe the integration is quick and easy, but if you want a package that handles NPC animations then DecisionFlex isn't it.

    I don't want to give the impression this is the kind of package that provides a full character control suite or a complete AI solution. It's a scalpel, designed to dive in and solve one problem really really well: designer driven decision-making. Anywhere that someone may be writing a tangled mess of nested if-else statements, DFlex can step in and make it simple, human and usable. The price reflects that.
     
  29. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,927
    Nope, don't expect it to handle animations at all. Just would like an example with a real world 3d game environment to get some idea of how to set it up. The demos are great and maybe they will be enough.
     
    andrew-fray likes this.
  30. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Teila likes this.
  31. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,927
    Excellent idea. It would be a great example for those who need a wee bit of help. I imagine my programmers would figure this out, but a lot of folks are more like me. lol

    Also, how well would this play with something like Love/Hate by TonyLi or another relationship/faction type asset? They seem to do very different things.
     
  32. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    @telia
    > Also, how well would this play with something like Love/Hate by TonyLi or another relationship/faction type asset? They seem to do very different things.

    I don't know that asset, so all I can do is say what I've said before; that it's super easy to integrate.

    I know some people are already using DecisionFlex to do relationships and factions. In fact it's exactly the kind of decision that DFlex is designed to model - lots of tweakable things to consider, few discrete options. You can imagine a First Order faction changing their opinion of you based on how many imperials you've fought, how many rebel bounties you've completed, your force skills, etc. You could even write that as a chain of if-else statements, but with DFlex it can be data driven and much much more flexible.
     
  33. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    I'm not really sure of the etiquette of this, but GDC is coming up, so here's a free voucher code for DecisionFlex:

    > A?V-R?RY-?HM7-V967-QPRE-4JNF

    The ???s spell a popular handheld videogame console, in reverse.

    EDIT: Gone! Congratulations to whoever nabbed it, and have fun flexing.
     
    Last edited: Mar 11, 2016
  34. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    A new version of DecisionFlex, v1.2, is out!

    * Added MakeDecisionOnEnable, which fires a decision every time you enable the gameobject.

    * Added SelectTournament, which is a slightly lower maintanence version of WeightedRandom. However it can sometimes come up with less ideal suggestions. That's the trade-off! Thanks to Johnicholas Hines for contributing this.

    * Fixed line rendering in the iPerson demo's graph

    If you use DecisionFlex, and you're happy with it, please leave us a review on the asset store!

    Remember, if you want to make great human-like decisions in a maintainable way, and don't fancy the idea of an ongoing subscription, DecisionFlex is the way to go!
     
    Ghosthowl likes this.
  35. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    :p:D:p

    how easy is decision flex to integrate with opsives behavior designer or third person controller?
    or other assets like playmaker?

    oh and of course a* pathfinding project
     
  36. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    @Arganth this question has been answered above, but to briefly cover it you need to pipe in some information like distance-to-enemy, for DFlex to work with, and to catch the resulting decision, probably in a script implementing IAction.

    One design pillar of the package is that it's trivial to hook up. You can see the entirety of the integration between the iPerson demo simulation and DFlex itself here. The information is piped in in AttributeContextFactory, by returning a dictionary from SingleContext, and there are two action scripts that do stuff as soon as DFlex decides to call their Perform() function. Beyond the usual C# boilerplate, it's barely 10 lines of code. It should be super simple to connect to playmaker or something similar.
     
  37. Tedeor

    Tedeor

    Joined:
    Jun 8, 2016
    Posts:
    1
    Hey,
    Let say I got two space fleets. Some of them are capitals, some fighters and bombers. Two sides of conflict.

    Fighters and bombers usually have forward weapon (guns or/and torpedos). Ships from 10 to 50 m long.
    Capitals have anti fighter weapons (fast shooting and low dam) and anti capital (slow shooting high dam). Weapons are on turrets. Ships from 100 to 5000m long.

    Combat range is from point blank to 150km (speed of weapon is from 0.3km/s up to 3km/s)
    Player can set priority list of targets for each ship and each kind of weapon(class or specific target)

    I was wondering if your AI can do decision for every turret and gunpoint based on:
    -size of target - so the chance of hit
    -priority list
    -type of weapon
    -based on fact if weapon damage can penetrate energy shield and armor
    -to avoid more than 2 fighters attacking any other fighter?
     
  38. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    @Tedeor yes! This is what DecisionFlex excels at: one decision (which target) based on several considerations (priority, target size, weapon suitability, target distance, etc). One of the three demo scenes specifically demonstrates this. In fact it does more: pairing one of a soldier's several weapons against one of several targets - switching to the shotgun for near targets, and sniping far ones.

    If you have any trouble setting this up I'd be more than happy to help via support email (or DMs).
     
  39. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Great to see that the asset store has featured DecisionFlex this month!

     
    laurentlavigne likes this.
  40. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,591
    Is there any demo or video of this working in an FPS? Im using UFPS and this looks good but Id like to know how well it can work.
     
  41. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    @radiantboy the demos include a solider selecting weapons based on enemy distance and local ammo count. You can see the client integration code for that on github. It's pretty concise, consisting of the Context pushing data into the system, and the Action performing based on the result.
     
  42. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    DecisionFlex has an update, improving the integration with unity events and simplifying the tutorial code. AND! it has a new low low price of $25! u3d.as/atp
     
    Cartoon-Mania and DrBlort like this.
  43. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    There is a recent comment on the asset store which says: "it's not possible (without rewriting a lot of stuff) to have several context hierarchies."

    Is that an accurate statement? I have a game with a strategic layer and a tactical layer. It's almost two games in one. Each would require very different contexts to process their decision-making utility functions.
     
  44. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    @MV10 no, I don't think that's an accurate review. In fact one of the demos has multiple objects each with their own decision hierarchy. Each hierarchy is entirely self-contained so you can have as many as you want in the scene. It even has timeslicing support, so you can budget how many of your decisions to fire in any one frame.

    That comment maybe refers to having one decision nested inside another - I think you can do that easily enough by having your action just call decision.PerformAction() on another decision object. I don't agree it needs "rewriting a lot of stuff" to do that.

    I don't know why they didn't receive a support reply. My uservoice dashboard says I replied. I will chase it up with them - thanks for bringing it up.
     
    MV10 and Alexarah like this.
  45. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    That was the feeling I had from skimming the docs. Buying it now. It would be nice if the documentation focused on the library only (excluding all those demo classes). I like the index-view docs, but unlike the tree-view, it isn't possible to filter out the demo content. I'm also mildly concerned about using Action as a class name, since that is also a (very useful) .NET Framework class name, but of course, that could be disambiguated by namespace.

    Have you seen Dave Mark's latest GDC presentation from 2015? I think it's the best utility AI talk I have ever seen (including in comparison to his earlier talks). There are some intriguing concepts in this one, such as adding/removing sets of behaviors at runtime:

    http://www.gdcvault.com/play/1021848/Building-a-Better-Centaur-AI
     
  46. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    I know this question is old, but I feel Dave Mark's talks present simple yet compelling examples.

    It seems to me there would "only" be three changes required to do this and only one extra step for the game developer to use it. DecisionFlex initialization would have to recursively identify the child considerations, and of course, the processing loop would have to iterate over them (inside-out). Finally, you'd need to expose the scores in a way that allowed the Consideration to retrieve them by keyed on the Action GameObject names. The various examples I've seen generally involve a custom calculation to mix the results (as shown below), so the game dev would provide a new game-specific class derived from your Consideration class, overriding MakeConsideration with their custom calculation.

    Edit: I guess another, possibly easier approach would be to nest an entire decision, perhaps making the context something that passes down to the child decision automatically. It might simplify things by getting rid of the recursion -- each decision would only have to know about any child decisions, and the child decisions would just have to expose the action scores to their parents.

    Either way, I'm liking what I'm seeing so far now that I've spent a couple hours digging into the implementation.
     
    Last edited: Oct 6, 2017
  47. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Thanks for the kind words! I know Dave very well, and I was in the front row for that talk, but I feel his full implementation is beyond the scope of a 3-year-old $25 plugin. I'm going to be doing an update this week and will take your feedback into consideration (fnarr) but it's probably won't include full-on nested considerations. If you have any (reasonably-scoped) changes that would make your life easier, let me know here or andrew@tenpn.com.
     
    MV10 likes this.
  48. MV10

    MV10

    Joined:
    Nov 6, 2015
    Posts:
    1,889
    No, nothing reasonable. :)

    I knew your name sounded familiar. Funny coincidence, literally while you were posting this yesterday, I was reading your Context Steering chapter in Game AI Pro 2 over my morning coffee. That approach is a pretty good fit for a problem I've been pondering. (WIP thread).
     
  49. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    Woah small world! The game looks great, good luck.
     
  50. andrew-fray

    andrew-fray

    Joined:
    Jul 19, 2012
    Posts:
    149
    DecisionFlex 1.4 is out, featuring:

    - proper support for unity 2017.1, alongside existing 5.2 support
    - create a DecisionFlex object with no ticker, without getting spurious warnings
    - chain decisions using the NestedDecisionAction
    - ...demonstrated in a new iPerson demo scene

    The $25 promotion has now ended, but I've decided to put it back to $35 instead of the original $45!
     
    Last edited: Oct 10, 2017
    DrBlort likes this.