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

Apex Utility AI

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

  1. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @donov

    Good points - I will make sure we make a complete FAQ on this.

    Btw, if you have use cases we do not support for e.g licensing, let us know. I tried to make the license as non-intrusive as possible, but there might be inconveniences we have overlooked.

    Best Regards,

    Jakob
     
  2. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @nasos_333

    The Utility AI plays together with the other products.

    We are outlining the use cases for the integration demo projects as we speak. So if you have specific requirements, such as e.g. breaking and reforming formations with Apex Steer, let us know.

    Best Regards,

    Jakob
     
  3. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
  4. Fera_KM

    Fera_KM

    Joined:
    Nov 7, 2013
    Posts:
    307
    Hi!

    I originally intended to ask if there were any plan on Playmaker integration for this?
    Based on a very quick look at it, it would be very handy to get and set variables to/from playmaker.


    But I also wanted to give a quick comment about licensing and subscriptions, since I feel a lot (too many) of providers are considering going down this path.

    I use Unity on a hobby basis, and am pooling a lot of personal resources into 3rd party software without any profit being made. Subscriptions are, and will stay, as a no go for me. I've been burnt on this previously, as hobby projects tend to last ~forever, and doesn't have a closure in scope.
    And I think, actually am pretty sure, there is a lot of hobbyist like me, which have the capital to purchase but not for never ending subscription.

    My work provides for me, adobe, 3dsmax, nuke license etc. But if I was a hobbyist in this field, I would pirate like every other hobbyist does.
     
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,286
    Thanks
     
  6. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Kemonono

    We are planning a Playmaker integration. We are still considering how this is best done. If you have other specific requirements please let us know.

    Thanks for the comment about subscription. It's really hard to make a fair price discrimination strategy that at the same time makes it worthwhile for the asset developers to keep making great assets. Indie developers - such as you - are very close to our hearts, so we are trying out different ideas to get the best of both worlds. Ideally, we could like a model that is based on value, and not too hard to enforce.

    Best Regards,

    Jakob
     
    Fera_KM likes this.
  7. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    300
    Are all these planned add-ons/additional example scenes/procedural animations/integrations going to be paid updates? Similar to Apex path + steer + dynamic obstacle? If so will an upgrade price be offered?
     
  8. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I bought 65$ option
     
  9. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @giraffe1

    The demos will be free and we plan to have them contain several behaviors for popular genres; first ones are likely RTS/TPS and SIMS. We even plan the demos to be playable.

    We are planning some full-scale game templates later, these will be paid add-ons.

    I would be relevant for us to have feedback on whether we should aims for Utility AI-only demos and templates first, or whether there is more demand for demos and templates with Apex Path and Apex Steer already built in alongside the Utility AI.

    Best Regards,

    Jakob
     
    EvilGremlin likes this.
  10. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Cartoon Mania

    Thank you for the support! Very much appreciated!

    Best Regards,

    Jakob
     
  11. erichkr

    erichkr

    Joined:
    Feb 2, 2016
    Posts:
    7
    Hi Jakob,
    This is a very, very interesting announcement. I am very impressed with the advantages described by you.
    Maybe it would be better if you could create a new topic dedicated to this asset (with some other videos)?
    Thanks
     
  12. Deleted User

    Deleted User

    Guest

    Is it easy to add custom funcs to use in this system? I want to add them in the visual editor.
     
  13. Ryuichi173

    Ryuichi173

    Joined:
    Apr 12, 2015
    Posts:
    141
    Hi Jakob,
    That's sounds very interesting!
    I'm planning to use your AI system, but my concern is that there are no variety of examples.

    Now, I want to know how long does it take to prepare that.

    I'm worrying that you need long time to prepare samples like you explaining, because we know that Sims-like Artificial intelligence is too complicated.
    In addition, full-scale game templates sounds like long-term project.
    Of course that is not bad idea, but I will be happy if you can shorten time to prepare template by various method.

    Best Regards,
     
  14. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Ryuichi173

    Thanks for the input.

    The challenge is not the AI. This is fairly simple to complete with Apex Utility AI. We actually have an almost finished tutorial on this subject.

    However, when we are publishing a demo project, we need to make a lot of other elements such as game code, integrating of assets etc. This code has to be as high quality as any other Apex product. Also, we need to make very thorough comments, tutorial text etc.

    So, please bear with us, as we try and make as much of the project game ready, so it can be reused in e.g. a game.

    Best Regards,

    Jakob
     
  15. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @anydayzz

    Yes - it's very easy to add custom Qualifiers, Scorers etc. There are specific tutorials on the different types, and how you make these. There are also a number that comes with the asset.

    Best Regards,

    Jakob
     
  16. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @erichkr

    Thanks for the feedback.

    Great idea - we will make a separate thread.

    Best Regards,

    Jakob
     
  17. MehO

    MehO

    Joined:
    Apr 23, 2016
    Posts:
    16
    Hello Jakob,

    Very interested in this product, as I might need some advanced bot decision-making soon.
    I intended to keep it simple at the begining, but I just can't stand this idea =)
    I think I'm gonna purchase in the upcoming month, before this summer.

    I also saw the Apex Steer, looks amazing. Really looking forward to all Apex products now !

    Keep up the good work, I hope you get success in your business,

    Best Regards
     
  18. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I am just wondering.

    This tool is just "AI Tool" or visual script tool?

    powerful is As the AI tool . but As visual script tool It lacks something.
     
  19. Deleted User

    Deleted User

    Guest

    Saw your article on Gamasutra, and I am a fan of your thinking and your approach. Great read.

    http://www.gamasutra.com/blogs/Jako...88/Are_Behavior_Trees_a_Thing_of_the_Past.php

    I saw you compare Apex Utility AI to the system used in Killzone. I know that Utility-based AI is one aspect of it, but the other aspect is planing-based AI. Killzone 2 uses a form of planning called Hierarchical Task Networks:

    https://aigamedev.com/premium/presentations/killzone2-planning/#HierarchicalTaskNetwonkHTNPlanning

    Planning-based AI is able to compare a goal to the world state, and look for the best series of actions that will transform the world state into the goal state. In a way, it's a form of pathfinding, but it's about navigating a series of actions and effects in a metaphorical "problem space", rather than a series of movements through "real" space.

    My understanding of games like Killzone use Utility-based AI to select the goal with the best utility, and then use planning-based AI to construct a path to the goal.

    Have you encountered this in your research? Is it anything you are interested in seeing with Apex?
     
  20. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @MehO

    Thanks for the nice words :)

    Let us know if you have some specific behavior you would like input on.

    Best Regards,

    Jakob
     
  21. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Cartoon Mania

    The editor is visual. However, it relies on having a library of qualifiers, scorers etc. to pick from. The current version ships with a number of qualifiers and scorers for common tasks such as target acquisition, tactical movement, selection of actions, and we will add more as we complete different use cases. The current survival shooter demo has some additional behaviors and also our RTS teaching project that's in open source on Github has additional behaviors.

    We are also working on a number of demos as you know. Once the game code is complete they will be available for download, and the behaviors that come along with them.

    We are also planning more visual upgrades in the future, such as e.g. better visualisation of utility curves for example.

    Best Regards,

    Jakob
     
  22. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @ashking

    Yes, goal oriented action planning (GOAP) is cool. We have been speaking a little with Jeff Orkin who did the F.E.A.R planner, and we have also looked at the Killzone 2 bots planner you refer to - although there are some tricks to how they e.g. pre-format the world, to make the GOAP work. We also got some comments on the article regarding this.

    You can do this - to some extend - with a Utility AI such as for high-level goal selection for example, but we are considering some more dedicated tools for this.

    There are some complexities as the GOAP does not provide the states for you. So you have to come up with your own states and provide utility functions for the planner (i.e. search algorithm). Hence, GOAP is not magic bullet - i.e. its not generative as such as it only searches within existing states.

    That said, GOAP is of course heavily used in other industries, including by e.g. NASA, navigation and robotics. Hence, why it's not more used in games is still a puzzle, as games used to be state-of-the-art in other areas such as e.g. pushing the curve on graphics and rendering. Just look at how GPUs are now the standard for training deep learning networks.

    The cool thing of course, is that you can used A* to search the state space, so it would be a natural merge between Apex Path and Apex AI.

    Best Regards,

    Jakob
     
  23. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    470
    I was half way through your gamasutra article and thinking to myself, it looks cool but I wish there was something on the asset store haha. Good job!
     
  24. Deleted User

    Deleted User

    Guest

    I hope you continue to investigate. I know I've tried to tinker with it on my own, but needless to say it would great to buy an existing solution, let alone one as visual and debugged as Apex.

    Why isn't GOAP used more in games? My impression is that they've found that *some* hierarchical organization improves performance drastically, rather than the purely open system of GOAP.

    From this article --

    The many issues with STRIPS are well documented, in particular that it requires you to add unnecessary variables to the world representation just to make it understand simple concepts, and that the only other way you really have to control the behavior is using weights & heuristics which also affect performance tremendously. I call this "baby-sitting" the planner, and it's a tricky balancing job to say the least.

    Academia has long discarded such planners in favor of hierarchical ones, particularly when performance matters. Obviously for games it does too, but you can also control hierarchical planners much better thanks to their top-down task decomposition mechanisms. If you're thinking to yourself, Guerrilla Games saw this coming and were a step ahead with KILLZONE 2, then you're absolutely right (see this panel discussion at the Paris Game/AI Conference 2009).

    Anyway. I'd be thrilled to see GOAP or HTN or any other planning framework, especially if it were integrated cleanly with a utility system like you've developed.
     
  25. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Hey,
    So i want to use apex utility Ai to create some soccer ai for my game Footbrawl (http://pixelpizza.de/footbrawl.html). its for a 5vs5 Soccer Game where you can also beat up other people. So to say a Soccer Beat em up.

    Do you think that would be a good idea to use apex utility Ai for this? and if yes, do you have any best practice how to achieve a good soccer ai using apex utility Ai? something i have to take care of or any useful hint is welcome :)

    So the difficulties regarding the Soccer Ai is in my opinion that not everybody chasing the ball. So that some players know when they have to defend and when they have to offend. also a smart prediction about what is happening next and so called release (running to the front when they see the chance of a goal). and on top of that comes the beat em up behavior. so that some players attacking other players but not chasing them all the time and leave them alone at some point to go back to the soccer game.
    so a good balance between trying to score a goal, trying to defend a goal and just beaten up other player. also some randomness since the game is not serious at all :D
     
  26. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Der_Kevin

    A Soccer beat-em-up - that's sounds awesome.

    I think it's a very good idea indeed to use a utility-based AI for this.

    Some of the use cases - exactly as you say - would be e.g. scoring different options based on the state of the game, and then picking the option that has the highest utility for the team, for each player, and perhaps each logical section, such as defense, offensive, midfield etc.

    The different options could be weighted based on the exact state of the football player, the state of the team (for e.g. coordination with other players), and also based on memory and recent events to ensure you have varied actions.

    Possibly you would combine several AIs running in parallel for each player, proposing e.g. move targets, shoot targets, beat-em-up targets etc, and then evaluating different options. You can also control the formation of the teams - including the place of players, in this way, by scoring different positions based on priorities for the team as well the role of individual players. Furthermore, you can then break down actual actions into long shot, short pass, high kick, low punch etc. and do the same utility-based evaluation here for the exact action by the player.

    It might also be an advantage to have a goal-AI for each players - i.e. a AI setting the current goal of the player, such as advance, defend, be aggressive, move into position, block opponent, go for the ball etc. And then a controlling team AI setting the overall goals which then affect the goal setting of each player.

    You can also build in different personalities in each player, by adjusting scores or setting some hyperparameters that can affect when AIs are invoked, such as an aggressiveness score, defender bias etc. This could be managed by e.g. utility curves.

    There are opportunities here for making a very cool game with a very cool AI, and we would be happy to help you with ideas and design guidelines.

    Best Regards,

    Jakob
     
  27. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
  28. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @ashking

    I think you are right in asking why GOAPs are not used more in games than they are. They have been around in games for the last 10-15 years, and the reception of these games' AI has been excellent.

    Perhaps GOAP is difficult to explain and complex to understand or perhaps it's just seen as old hat now.

    However, we took up the idea and have started speaking with some of the developers of the games that have successfully implemented GOAP-based AIs. So we if it makes sense, we will start working on a package for this.

    Let me know if you would like to part of e.g. beta-testing etc.

    Best Regards,

    Jakob
     
    Deleted User and one_one like this.
  29. Deleted User

    Deleted User

    Guest

    That's amazing. I hope that your conversations are enlightening, and it's very helpful to learn from your predecessors. I would be interested if you talked to High Moon Studios (the team behind Transformers: ... Cybertron), and ask them about their experience moving away from GOAP towards HTN. The Killzone team seemed to evaluate the pros and cons and move towards HTN too.

    http://aiandgames.com/ai-of-transformers/

    I'd be interested in beta-testing for sure. I'm sure a lot of people would be.
     
  30. MehO

    MehO

    Joined:
    Apr 23, 2016
    Posts:
    16
    Sure, I'll ask if I'm stuck on specific topics.

    Just to let you know, from a global perspective I'd say I'm more interested in RTS AI.

    I'm going for a self-governing spaceships battle. This means it will be more of a visualisation of a simulation rather than a fully interactive RTS game. This might evolve in the future, but for now there will be little to no player input. So the decision-making design must be very robust, provide enough shifts in behaviour in order to result in a fun and not repetitive experience (as much as possible). Later, I also intend to add RPG elements (character personality) to better ensure that last point. Anyway, I'll stop talking so much about that.

    I discovered Utility AI from you, and now I have a strong confidence this is a better way than state machines and behaviour trees to operate complex AIs. At least regarding my project.

    For now I'm still designing high-level concepts, but I'm so looking forward to implement them with APEX Utility AI, that I'm going to purchase it next week (just waiting for a customer payment and I'll be good to go)

    A question pops into my mind. I know all APEX tools can work together, but my question is more related to APEX Path and APEX Steer, so apologizes if I'm off-topic : can they handle 3D movement ? I mean real 6DOF navigation, not stucked on a 2d plane and only going a little vertical sometimes. I guess it's a yes for pathfinding, but I don't know for APEX Steer...
    I can do my own pathfinding and steering logic, but like everyone says, it's useless to reivent the wheel :) The entire APEX Tool suite could save me a lot of time !

    Best Regards Jakob, and congrats to all the team.
     
  31. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I want to know your plan

    in fact .. It is important to notify your the plan. That's marketing skill

    I know you are making playable web demo.. I look forward to sims like ai demo

    When it will be able to see it?

    I hope you give us a rough time schedule.

    and your company homepage


    In addition to the genre-specific frameworks, specific add-ons are planned, including:

    Dynamic dialogue module
    Dynamic missions module
    Personality module
    Tactical reasoning



    Dialogues
    Instead of the standard scripted dialogues, the Apex Utility AI can support meaningful conversations created dynamically based on the game context. NPCs (Non-Player Characters) can evaluate what to say on the basis of their current situation, and select from sentences given the utility functions. Parts of the sentences can be replaced by words that express their state of mind, reaction, or specific offers based on the options available and the underlying utility scoring.


    I know that you are very busy. The above functions are so excited.
    When are you going to release planned specific add-ons?

    Don't be stress. I just want to know your schedule.
     
  32. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @MehO

    We are currently putting the finishing touches on a first version of an RTS demo. We are currently making the game code, and then we need to strike a deal with an artist or asset store art package developer to get some nice units into it. Otherwise, we have to make some ourselves, but that would delay the project.

    There is a lot to AI in RTS, so the first version is designing around showcases unit AI and some squad-based tactics. Subsequently, we will add additional AI modules.

    The demo are taking longer to develop than if you do your a game, as we need to solve the general case, where in a game, you can be more specific.

    Best Regards,

    Jakob
     
  33. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @MehO

    We are currently doing some prototypes on a 3D navigation system.

    Apex Path and Apex Steer is designed for ground movement of units, and is optimizes around e.g. height maps etc. However, you can extend Apex Steer with 3D avoidance behaviors, but it requires you to program your own behaviors. Apex Steer is easily extensible so that is definitely feasible.

    Now, for the 3D navigation system there are some technical challenges that are not trivial.

    For example, for memory reasons you normally don't want to break space into a grid, unless it's a rather small or a heavily congested space. Hence, you need some smarter structures to partition space. When avoiding objects in space, it is often very different avoidance behavior you want than in e.g. simulating pedestrians on a sidewalk. You might also need to better incorporate physics, momentum, gravity etc. into e.g. space-based navigation. Hence, there are some additional performance, memory and functionality requirements for 3D navigation. But we have found some very nice ways to handle this.

    So, please let us know if there is support for this, then we will prioritize it.

    Best Regards,

    Jakob
     
    Korindian likes this.
  34. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @ashking

    So we have done investigation on the planner aspect, and it seems the debate is ongoing on whether GOAP planners or HTNs are the right technology to go with if you want to go for planners.

    GOAPs seem more relevant for dynamic and emergent AI.

    HTNs seem more relevant for games where you want to scripts and or control AI behavior.

    Latest postmortems seem to shift the favor back to GOAPs.

    However, there is definitely a need for utility-based reasoning, as it seems planners won't do it alone.

    Hence, it's one the list for add-ons to the Utility AI.

    Again, let me know support for this, so we can prioritize it.

    Best Regards,

    Jakob
     
    Deleted User likes this.
  35. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    any plans on a thight integration with opsives TPC and behavior designer, playmaker
    or other popular assets?
     
  36. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Arganth

    Yes - integrations are on their way.

    Best Regards,

    Jakob
     
    JamesArndt likes this.
  37. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Cartoon Mania

    Yes - we will make a roadmap with dates. It's a very good point.

    Stay tuned for that.

    Best Regards,

    Jakob
     
  38. Deleted User

    Deleted User

    Guest

    It sounds like you're doing good research. My understanding is that GOAP is a little more robust, but eats up more processing power, and requires more "babysitting" to make things work. HTN is supposed to be more efficient and clean. But I'm sure different developers are trying to find ways to improve both systems. Allow me to voice my support for whichever system you pick. I know for a fact that I've seen other threads about planning-based AI on and off the unity forums, and there would be real demand for something like this.
     
  39. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I think it'd be best to get more people on board before implementing new AI designs. The game examples you're cooking up are probably your best bet there. So if you've got resources to spare on developing other techniques, that's great, otherwise I think it'd be best to put the focus on showing people what it can actually do for them. Maybe even create a (relatively simple) AI with both behavior trees and utility AI that specifically highlights the benefits of the system. But that's just my 0.02$.
     
  40. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @ashking

    The performance differences you are mentioning are also the understanding we get. Which makes sense, as the hierarchical part in HTNs should narrow the search space.

    However, it also seems that HTN requires more pre-existing knowledge, whereas GOAPs are more general purpose. Looking at the post-mortems and descriptions of the F.E.A.R. AI, is seems very flexible regarding design. But the general purpose advantages also create the performance implications you mention.

    HTNs are being mentioned as being better as managing scripted instructions / constraints, and is apparently part of the reason they have been popular with AAA productions with semi-scripted storylines and missions.

    Best Regards,

    Jakob
     
    Deleted User likes this.
  41. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @christoph_r

    Absolutely - we have a number of demos and additional tutorials for the Utility AI that are coming out as we speak.

    Best Regards,

    Jakob
     
  42. Deleted User

    Deleted User

    Guest

    Performance vs Flexibility is definitely a tricky tradeoff. But the last dimension is programming and ease of use. This quote I read makes me nervous about GOAP compared to HTN:

    http://aigamedev.com/open/editorial/2010-retrospective/

    After reaching a peak of adoption a few years after Jeff Orkin's seminal talk at GDC 2006, more studios than ever have switched away from the STRIPS-style GOAP that the original F.E.A.R. used.... The many issues with STRIPS are well documented, in particular that it requires you to add unnecessary variables to the world representation just to make it understand simple concepts, and that the only other way you really have to control the behavior is using weights & heuristics which also affect performance tremendously. I call this "baby-sitting" the planner, and it's a tricky balancing job to say the least.
    So organizing things into a flexible hierarchy might be a more elegant solution compared to a mess of variables. Mind you, that's from 6 years ago already, and maybe the situation has evolved. Hope that this is helpful. Needless to say, I support whichever planning architecture you decide to go with, because it seems like you are a thoughtful person who is doing careful research on what will work best.
     
  43. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    hmm after watching your tutorial videos i just bought it ^^
    :)
     
  44. MehO

    MehO

    Joined:
    Apr 23, 2016
    Posts:
    16
    Totally understand, I have the same concerns in my everyday job ;)

    I sneaked a peek at your ApexTeaching RTS demo, hosted on Gitub. Useful stuff, this alone already teach some ways to handle Utility AI.
    Was it used in an event like a conference ? If so, does it come with slides or maybe a recorded replay ?
     
  45. MehO

    MehO

    Joined:
    Apr 23, 2016
    Posts:
    16
    Ok I understand it might not be viable out-of-the-box, and requires some tweaking to work in 3D. I still have to decide if I expand your system or if I go for my own basic implementation.

    I have my own way of thinking when it comes to pathfinding.
    I hate algorithms like A*, they're too smart in my opinion. With one click you tell your unit to go all the way across the entire level, and it instantly knows it should take this path or that bridge to avoid obstacles, even though it doesn't have sight on them. Of course you could assume there's a shared intel of the map for every unit, because that's easier to implement and faster to execute, but that's a design shortcut I really don't like, and UtilityAI can handle this case very well :D.
    So I may introduce dumber behaviours, where units don't share the same knowledge of the world (multiple contexts, each unit have its own), only have memory of their immediate surroundings, then have first to bump in front of an obstacle before finding a better way. A local (range capped) pathfinding, in sum. I hope it will reduce the positions to sample, because like you said, sampling all available positions in 3D space is huge.
    Still about the space grid you're talking about, I have long considered the question, even a turn-based game to help reduce computations on each frame, but I finally conclude the same thing as you, and searching for other ways to handle this =)

    Another note, I'm new to UtilityAI pattern and still learning, so sometimes it's a bit frustrating because I erase a bunch of parts I'm designing when I realize I'm trying to implement systems the UtilityAI already handles... but I love it anyway, that's a fun way to work and solve problems =)
    Soon I'll have to stop drawing diagrams and start implementing to check performances...

    Sorry I really write too much text, I'll stop here. Have a nice day everyone !
     
  46. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @ashking

    Yeah - I came across similar statements. However, there are some articles on Gamasutra from 2014 where GOAP seems to be back in the vogue. Especially for more general planners - i.e. where the world is so complex that you need to search through more general state space, and cannot use the implicit heuristics of higher-level, pre-defined tasks in the HTNs. HTNs in a way lock the AI down to only thinking in states made available to it, and thus provides a somewhat predictable behavior - GOAPs do something similar, but if the actions are abstract enough, you can have complex behavior as they recombine. Of course, if you add enough tasks on each level in the HTN is approaches the complexity - and likely the same performance challenges - of a GOAP.

    The heuristics part of the GOAP-model, however, is a bit oversold in the early implementations. In A*, the heuristic is a function that minimizes search, but having bias towards nodes that are closer to e.g. the direct path to the destination. But it the GOAP model the heuristics seems to be constant values attached to each action, such as attacking is better than moving, or loading is better than moving, to ensure that you load before you move. But when a smart AI, it needs to evaluate that on the fly and based on context. I.e. of you are under fire, you might want to move before you reload, but if you are going to move in for an attack, you might want to reload before you move, in the case you need to shoot while moving towards your target. Here utility-based reasoning could be of the essence. Depending on the situation, different actions would be scored according to their utility given that particular context.

    There are a number of inherent challenges here, though. I will most likely make a Gamasutra article or similar to explain this in more detail. But depending on the quality of the search you need, the search can be very expensive. However, having few, but very good searches, could be better than having frequent bad searches in state space. Also, the backward searches by GOAPs such as the one in F.E.A.R are not always smart. Imagine doing that in a chess game. The first action here would be something like "AttackKing", and then you pretty much had to look at all permutations going back from there. That's even beyond the capabilities of Deep Blue. So sometimes, you might want to do a forward search, to judge different plans, and then select the best plan given a certain search depth.

    The state-variables is interesting. I did read about problem about run-time calculation of prerequisites. In the Utility AI we implemented the Context model to take care of that. I.e. act as a repository for everything concerned with memory and well as world state, sensory data, access to black boards and other efficient memory repositories. A good model for caching frequently needed, but expensive calculations, are of the essence here. However, the implementation of what to cache and when is game-dependent and hard to generalize.

    Best Regards,

    Jakob
     
  47. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @Arganth

    Thank you!

    Let us know what you think - and also, if you have specific questions regarding behaviors etc. let me know.

    Best Regards,

    Jakob
     
    Arganth likes this.
  48. Deleted User

    Deleted User

    Guest

    Thanks for the thorough reply and explanation. It's true that I've seen HTN discussions talk about an "optimal" number of defined tasks. So maybe defining too many HTN tasks will hit performance, not to mention take more time to implement. Which leads us back to the same problems as GOAP.

    It sounds to me like there might be a good synergy between a utility system and a planning AI, and that it might even solve the problems in maintaining a GOAP search space. The utility AI picks the goal, which substantially narrows the search space when it's time to start planning.

    Once again, I defer to your research and judgment, and look forward to what you come up with. (And any articles you write in the meantime.)
     
    Last edited by a moderator: May 4, 2016
  49. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    @meoh

    The ApexTeaching demo is used in our courses. We recently did courses on Universities in Copenhagen, on Nordic Game Jam in Copenhagen, and on A-Maze in Berlin.

    http://apexgametools.com/2016/03/nordic-game-jam-game-ai-masterclass/?v=dd65ef9a5579

    The project is MIT licensed so you are free to use it, and if you improvements to it you can push them to Rami from ApexGameTools who maintains the project.

    https://github.com/RamiAhmed/ApexTeaching

    The new RTS demo will be more advanced, but the ApexTeaching project is still a good starting point.

    There are lecture slides for all the sessions (five in all), but there are no lecture notes, so they might be difficult to get something out of.

    However, we are planning to make a series of online courses, both live and recorded. So please help us drum up support if this is something we should prioritize.

    Best Regards,

    Jakob
     
    Arganth likes this.
  50. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    1/

    Concerning the A* algorithm - it's true that if you give e.g. the player or AI access to click anywhere on the map and allow the pathfinder to also traverse invisible nodes, then it will find the best path disregarding whether the player can see it. But that's the whole purpose A*. However, one way of avoiding this is to ensure that the algorithm can only use e.g. nodes the player can see or only plan for shorter paths. The other way is to only allow the player or AI to select nodes within a certain range or with certain properties, such as whether they have been visited. The A* / pathfinder should be there to give you the best path between two points, and to guarantee to find a path, if such exists. However you decide the destination, and that can be tweaked to the create the behavior you want.

    Before we created Apex Path, we tried many different algorithms, but except for some very special cases, nothing beats A* for single-agent navigation. Implementing the A* algorithm is easy, but getting it to perform inside a game environment is not trivial. Hence, I would be careful to start developing my own pathfinder, as the time needed to develop it far outweigh the cost of an off-the-shelve product like Apex Path.

    2/

    The Utility AI is a pretty cool framework. We chose that as our first decision-making / high-level framework, over many other technologies we prototyped, including FSMs, BTs, Planners, Neural Networks, etc. You can actually use it to create behavior such as what you are describing above. For example, you can select nodes in the vicinity of the AI, and then use Apex Path to move to these nodes.

    In one tactical Utility AI we implemented, we used the same logic as the tactical positioning Utility AI in the Survival Shooter to estimate places whether enemies could / would hide. We then used these as positions that a squad would suppress and sweep. The idea was quite simple. You sample e.g. 40 or 100 points in the vicinity of the AI, e.g. the squad leader. You then remove / early out points that are not next to a door or a wall - i.e. that are not half covers. You then iterate through each half cover and assign it a point value based on e.g. proximity, ideal distance for shooting etc. I.e. a list of Scorers that each point receives a total sum from. You then pick the highest scoring position and add this to the list of threats / threat positions, and rerun until you have e.g. 5 or 6 points. But for each time you run the algorithm, you also remove points that are too close to points that have already been taken, so you don't get e.g. 2 points next to each other. This gives you a very nice distribution of points to move to / sweep / suppress etc. and you will have short-distance staggered movement just as your are looking for.

    As the Utility AI is to good at spatial reasoning, you can use it for so many variations of picking destinations that give the AI a staggered or shorter movement than just moving to the other end of the map. You can use to move in formation, move from cover to cover, or search nearby covers for the player etc.

    3/

    One design tip: For many Utility AIs I have designed, I start by mapping them out in the editor. I.e. I just add Selectors, add Qualifiers to each Selector, and give them the names of the actions or evaluations I want them to do. If the Qualifiers need Scorers, I just add some default Scorers and then change their names. As you can change the names of all nodes in the Editor, you can more or less draw up the entire AI before writing code. That can sometimes speed up production a lot. We have implemented upwards of ten (10) Utility AIs in one workday during some scenarios in this fashion. It makes AI development very fast, almost as fast as you can add nodes and change their names. As you can also quickly get a complete overview over the AI, this also reduces bugs or discover early on fundamental design flaws that can be so expensive to edit later when using other AI frameworks.

    Hopes this inspires you.

    Best Regards,

    Jakob
     
    Last edited: May 5, 2016