Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Assets [WIP] RVSmartAI - the ultimate utility AI solution

Discussion in 'Works In Progress' started by Roni92pl, Apr 14, 2019.

  1. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254






    >>RV Smart AI<<

    RV Smart AI is an utility AI implementation with visual node-based editor.
    If you’re not familiar with utility AI concept I highly recommend this article - https://www.gamasutra.com/blogs/Jak...88/Are_Behavior_Trees_a_Thing_of_the_Past.php

    With RVSmartAI you’ll be able to visually model complex AI behaviours for your game with ease.
    One of the biggest advantages of utilityAI concept over FSMs or behaviour trees is that it’s much more scalable in terms of complexity while remaining simple and easy to maintain, understand decision process and debug.
    You can think of it like behaviour tree, but with more complex decision making process - instead of doing simple hardcoded <if> to decide to which node system goes next, system evaluates situation using scorers, and decision with highest score wins, moving to appropriate node and/or doing some task.

    If you’re new with utilityAI concept or don’t fully understand it - no worries, you can still use this system basically just like behaviour trees, and learn to use utility concept while developing your AI.

    RV Smart AI is not just utility AI framework! It consist of many independent modules that work together seamlessly and greatly enhance your AI developing process.

    Included modules
    • RV Smart AI
      main module responsible for AI, node based editor

    • RV Load Balancing
      spreads work for multiple AI agents over many frames so you won’t have those nasty spikes in profiler

    • RV Logger
      simple tool to easily control debugging levels in your classes

    • RV Utilities
      general utilities/helper classes
    Note that all these modules are independent from main RV Smart AI module so they’re very useful for other stuff too, even not related to AI!
    There are also many ready to use AI examples wrote with flexibility in mind using interfaces, so you’ll be able to easily use them as base for your game and modify them.

    Example behaviours provided
    • patrol
    • follow
    • wander
    • guard area
    • flee
    Features
    • Visual node graph editor - write your AI behaviours in C# and play with them like legos
    • As easy to use as behaviour trees while being much more scalable in terms of complexity
    • Ready to use AI behaviours written with interfaces
    • Runtime graph modifications - see changes in your AI behaviours in realtime and saves you a lot of time tweaking values
    • Lot of script templates and base classes for common usages
    • Many indepentent modules included in package
    • User friendly and easy to use
    • High performance
    • Load balanced
    • Threading - ready
    • Zero runtime allocations (after initialization)
    • Easy runtime visual debugging
    • C# source for all modules!
    • Well written and commented code
    • Make use of assembly definition files
    • Written with flexibility and scalability in mind, as separate modules
    • Writing behaviours as isolated classes encourages good coding patterns, reausable code and modular design
    • No subscription, no seats limits, buy once and use freely
    Any feedback is welcome ;)


    Thanks for reading
    Ronis Vision
     
    Last edited: May 16, 2019 at 3:14 AM
    Darkfire16 likes this.
  2. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    296
    It's like a really cool asset. The utility ai became famous for its use in The Sims. Do you have any idea how to create an example like The Sims?
     
    Roni92pl likes this.
  3. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    Hi, must admit you pulled quite big guns with this one :D The sims AI is one of the most complex AI in games I can think of, but sure, utilityAI is rather obvious choice for such scenarios.
    I could prepare some simplistic needs-based example grah that would work around similar idea - with say sleep, hunger and entertainment needs with every need having one action that could satisfy that need.
    Would example like that help you?
     
  4. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    296
    yeah great! but please support animation.

    Frankly, the Asset Store has many AI-related assets. It is not easy to compete with them. There are many combat AI assets in particular. There were, of course, some products that provided utility AI. Unfortunately, the products were not very successful. This is what I think. Battle AI is by far the most popular asset. But to compete, I think it's also important to provide AI like Sims.
     
  5. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    Unfortunately there will be no such example, at least not in the first release.

    [TL DR]
    there will be separate package with ready to use AI built on RVSmartAI.

    But we took your advice and I wanted to update on our release strategy:
    RVSmartAI from beginning was designed as framework for AI, not ready to use, aka plug and play AI solution, but after some consideration we made some changes to our release plans.

    The problem with ready to use AI is that it's something very specific for game/genre, so no matter how flexible examples/base we develop they won't be usable in wide range of projects.
    Solution came up pretty quickly: RVSmartAI will be framework package with some nice examples, but it's still mostly framework, so this part stays as planned, and is targeted for programmers/developers.

    Then, on top of RVSmartAI framework we'll develop AI packages dedicated to specific game genres, that will feature animation system, relationship system, group behaviours, prefabs etc, basically ready to use AI for specific game genre. And because it's all will be based on solid framework it'll still be very flexible and customizable.

    This way more advanced users and programmers will be able to build their own AI using our framework without paying for pre-made stuff, and game designers or just developers who don't want to spend much time on AI will be able to drag and drop few prefabs, quickly configure it and enjoy working AI. Win-win.

    First package after RVSmartAI release will be RPG pack, as we decided it's probably the most common use case. Soon I'll start a new thread for it, as it will be separate asset.

    Cheers.
     
    Last edited: Apr 23, 2019
  6. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,009
    Hi,

    this sounds interesting. Does it work without Navmesh etc. for a procedural generated 3D Environment with only Collider data available?

    Will there be Prefabs or Presets for animals / npc? with the abouve told "Example behaviours provided"?
    Do they use Rigidbodies?

    I would be very interested in testing :)

    Thanks.
     
    Roni92pl likes this.
  7. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    Hello,
    Sorry for such delay in reply, I was very busy with development of new SmartAI feature, that wasn't mentioned earlier, and it'll be quite unique as I don't believe there is any AI asset currently oferring it, more info on that later ;)

    Yes, it's definitely not tied to any specific movement type. Examples use Unity navmesh, but they support dynamic generation so no problem here. Main framework is completely agnostic in terms of how you move your agents.

    Yes, RPG package will definitely feature some ready to use, configured NPCs, and they will have the same or similar movement system like in SmartAI examples, so standard Unity NavMeshAgent(without rigidbody).
    We'll also possibly provide other movement systems as integrations with other assets, but it's too early to talk about anything specific yet.
     
    Last edited: May 1, 2019
    Firlefanz73 likes this.
  8. Firlefanz73

    Firlefanz73

    Joined:
    Apr 2, 2015
    Posts:
    1,009
    Sounds very interesting. :)
     
  9. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    New feature!
    Runtime graphs editing - all vital operations that you do on graphs in edit mode(removing, moving, reordering, disabling and even adding new graph elements) you will also be able to do them at runtime, and observe your agents change behaviour literally in real-time.

    This is very helpful for debugging and coming with right numbers/configurations to achieve the exact behaviour you're after - instead of runing your tests/game from the beginning after every change or small tweak this allows you super fast iteration and in the end saves a lot of time.
    Updated first post.
     
    Firlefanz73 likes this.
  10. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    Here's short presentation of system performance in simple crowd simulation scenario with over 500 agents.
    This AI moves agents by Unity NavAgent, so there's pathfinding, local avoidance and also spatial awareness implemented via environment scanner, so agents won't try to go into obstacles and they also 'reserve' their destination spot, so two agents will never try to move to one spot.


    (sorry for stuttering it's caused by CPU being overloaded by video recording)

    UPDATE ON PERFORMANCE:

    Turns out there was redundant MB Update method on every agent that took most of the time.
    Here is screenshot showing actual performance - about 0.35ms for 1000 wandering agents.

    You can clearly see how stable performance is in profiler thanks to load balancer spreading work over time;
    also AI graphs updating overhead is minimal. If you need even more performance it's possible to run AIs on your own threads.

    And this is graph used to make such AI behaviour.
    One utility to check if agent is at destination, and one task assigned to it, that scans for random positions and set destination for NavAgent. Takes about five minutes to design including testing :)

     
    Last edited: May 16, 2019 at 3:01 AM
  11. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    47
    Can't wait for it to arrive. Will you add the ability to alter utility score/curves directly in the visual editor? Also are there any plans on a free limited version to get a feel for the work flow?
     
    DrOcto and Roni92pl like this.
  12. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    Yes, you can tweak score that utility will return, this is how utility inspector looks like:


    And code for this utility:


    As you can see you can add custom data for every utility and task by adding 'SmartAiExposeField' attribute to field you want to expose;
    In this instance custom data is bool field 'not'.

    As for second question - there are no plans for free version, but we'll release video presentations/tutorials, so you can see full workflow from creating graphs to working ai agents in scene.
     
    Last edited: May 19, 2019 at 5:48 PM
  13. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    47
    Thanks for the info! I know this asset is wip, so I assume on release it will also feature animation curves to create custom utility evaluations?
     
  14. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
    Something like this?


    It's not something that will be very often useful (remapping returning score via curve), but we figured it's good to have for some complex scenarios, so here you go :)
     
    betaFlux and DrOcto like this.
  15. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    254
  16. betaFlux

    betaFlux

    Joined:
    Jan 7, 2013
    Posts:
    47
    Very nice! Though I was under the impression that curves would be the heart of any UAI implementation. I've watched most of Dave Mark's lectures and he actually talks about them non-stop. I'm just curious and eager to learn about this stuff. :)
    Anyway, I'm glad curves are on the feature list!