Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

B.R.A.I.N.S: Behavior Tree AI Plugin powered by Kismet

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Recently discovered that Kismet provides an interface that hooks extended Classes of SeqAct_Latent to a AIController. This took a bit to figure out as wasn't obvious. In BRAINS, Condition and Action Nodes are extended from Class of SeqAct_Latent to handle True Latent Functions (animation, navigation) which must be defined in State code, and Latent Functionality such as networking|polling. Thus, the BrainsAgentController contains a Handler (hook) and Coroutine (state-based function) to manage this. We can not get away from using UnrealScript States, but, why and how we use them is very different. I refer to these as Coroutines to distinguish these specialized States between a States used for FSM.

    All of this is achieved with a Labeling Convention:
    Kismet: %SeqAct_Functionname
    AIController: OnFunctionname(%SeqAct_Functionname Action)
    Coroutine(State-based Function): Functionname

    Kismet Sequence Hook/Controller Handler for SeqAct_Latent Classes. Required by SeqAct_Latent Classes, otherwise 'BrainsAgentController_0 has no handler for %SeqAct_Functionname Warnings'

    Predefined Kismet Sequence Hook/Controller Handlers:

    Controller.uc
    OnTeleport(SeqAct_Teleport Action)
    OnAttachToActor(SeqAct_AttachToActor Action)
    OnToggleGodMode(SeqAct_ToggleGodMode inAction)
    OnSetPhysics(SeqAct_SetPhysics Action)
    OnSetVelocity( SeqAct_SetVelocity Action )
    OnModifyHealth(SeqAct_ModifyHealth Action)
    OnToggleHidden(SeqAct_ToggleHidden Action)

    AIController.uc
    OnAIMoveToActor(SeqAct_AIMoveToActor Action)

    UTBot.uc (omited from Brains)
    OnAIStartFireAt(UTSeqAct_AIStartFireAt FireAction)
    OnAIStopFire(UTSeqAct_AIStopFire FireAction)
    OnAIFreeze(UTSeqAct_AIFreeze FreezeAction)

    Latent Functions
    Sleep (float Seconds)
    FinishAnim ( )
    FinishInterpolation ( )
    MoveTo (vector NewDestination, optional float speed)
    MoveToward (Actor (UT) NewTarget, optional float speed)
    StrafeTo (vector NewDestination, vector NewFocus)
    StrafeFacing (vector NewDestination, Actor (UT) NewTarget)
    TurnTo (vector NewFocus)
    TurnToward (Actor (UT) NewTarget)

    Comment


      #32
      Hi...

      I am interested in the this AI... So will I able to download it
      and use some of them (or change it a liitle) in my project?
      And if this possible, then when can I download it?
      (I saw post that April 30th is the unofficial release date?!)

      Thanks in advance,
      Peter

      Comment


        #33
        Originally posted by RPetya View Post
        Hi...

        I am interested in the this AI... So will I able to download it
        and use some of them (or change it a liitle) in my project?
        And if this possible, then when can I download it?
        (I saw post that April 30th is the unofficial release date?!)

        Thanks in advance,
        Peter
        Hi Peter, Thanks for your interest. Unfortunately, I wont make my release date, however, I'm getting close. The pre-alpha release will be done so with intention of getting feedback and hopefully garner some additional programming expertise from the community.

        Comment


          #34
          If you're interested in BRAINS please post your questions, intentions for use, and feature requests here. Frankly speaking, I would like to see more input from the community and could use the feedback for motivation. Thank YOU sincerely

          Comment


            #35
            For those who maybe haven't been following this thread or got lost, can you tell us in practical simple terms what brains is, what it can do today, and how easily it can be integrated into games? In addition someone recently posted a Masters / Ph.D dissertation on Bot AI, did anyone check it out?

            My own background is general tech and film. I'm interested in the idea of emotioneering in video games, and right now specifically the idea of a HumBot, and Bot that exhibits human traits, like fear, or courage or cowardice or recklessness and can switch modes.

            For example if three bots are chasing you in a game they will probably behave much bolder and run at you at full speed guns blazing. But if you manage to kill two of the bots then the last one will lack courage and become more cagey, more sneaky, fire, run away and crouch and hide, and even use strategy or distraction to corner you i.e. start up a vehicle but jump out or send up an empty elector etc. This is just a simple example, and obviously exhibiting human emotions in AI is a monster size challenge...

            1. Does Brains have any behavior or personality capabilities or can it be integrated in some way?
            2. How well does Brains perform in 'space' genre games, i.e. zero-g or a tweaked PV / GV for Bot pathing and Bot operated vehicles?

            Comment


              #36
              2. How well does Brains perform in 'space' genre games, i.e. zero-g or a tweaked PV / GV for Bot pathing and Bot operated vehicles?
              I'm also interested in hearing the answer to this question!
              Would be very useful in current projects!

              Cool thread TechLord, I'll be following it too!

              Comment


                #37
                I'm definitely interested in seeing where this will be going. This system looks like it has a lot of potential. I'm in the process of refining my game's AI systems, so the topic isn't far from my mind at the moment. If you need any help or more input, I'll do what I can.

                Comment


                  #38
                  I started to see other Behavior Topologies form working with B.R.A.I.N.S. in Kismet. I now refer to Behavioral Trees as Behavioral Network Topology (BNTs) Tree Topology. BNTs are only particular to how the Kismet activation mechanism works, which in itself is operates like a system of simple synapses. I believe BNTs are suitable for a variety of applications, as they can scale upwards or downwards with relative ease, both functionally and visually. For reference, I consider Friend/Enemy Bot AI in the middle-of-the-scale application of BNTs. A low scale application of BNTs could be using them to manage Weapon behaviors and other Interactive Entities that can make use of traditional FSM. A large scale application of BNTs could be the application of Behavior Networks to manage Procedural Level Construction and Dynamic Quest Behavior (Quest Branching).

                  Comment


                    #39
                    Originally posted by frankit View Post
                    For those who maybe haven't been following this thread or got lost, can you tell us in practical simple terms what brains is, what it can do today, and how easily it can be integrated into games?
                    Hi frankit. Thanks for your interest. B.R.A.I.N.S is a Behavioral Tree AI that leverages existing UDK AI & Navigation, Unrealscript JSON import/export for Behavior Network Topologies, and Kismet as a Visual Editor.

                    Originally posted by frankit View Post
                    My own background is general tech and film. I'm interested in the idea of emotioneering in video games, and right now specifically the idea of a HumBot, and Bot that exhibits human traits, like fear, or courage or cowardice or recklessness and can switch modes.

                    For example if three bots are chasing you in a game they will probably behave much bolder and run at you at full speed guns blazing. But if you manage to kill two of the bots then the last one will lack courage and become more cagey, more sneaky, fire, run away and crouch and hide, and even use strategy or distraction to corner you i.e. start up a vehicle but jump out or send up an empty elector etc. This is just a simple example, and obviously exhibiting human emotions in AI is a monster size challenge...
                    BRAINS can do all of what you desire, if you build the topology too do it. AI can be narrowed down to Conditions (evaluation of variables/data and collision checks) and Actions ( Navigation/Path-finding and Animation). Traditionally, Conditions and Actions are selected under the context of a specified State (ie: Roaming, Evading, Hunting, Attacking, etc). This is known as Finite State Machine (FSM) technique. Unrealscript supports the concept of States natively within its syntax. Behavior Trees is a hierarchical node-based technique of selecting Conditions and Actions and the Tree itself can represent a particular State or State composite.

                    Originally posted by frankit View Post
                    1. Does Brains have any behavior or personality capabilities or can it be integrated in some way?
                    Yes. The Behavior is defined in the organization of the Tree's Composites (Selection Nodes) and Conditions and Actions (Leaf Nodes). The Personality would be the emergent result of the Actions that mimic human behavior (ie: Gesture Animations, Announcements, etc). I'll furnish a few example Behavior Tree Templates, but, you'll have to extend or build your own BTs in Kismet, Animations, Audio, etc to meet your needs. In a entertainment simulation, it is the illusion of intelligence we're aiming for.

                    Originally posted by frankit View Post
                    2. How well does Brains perform in 'space' genre games, i.e. zero-g or a tweaked PV / GV for Bot pathing and Bot operated vehicles?
                    BRAINS uses the navigation systems available in UDK: NavMesh (automatic) and Pathnodes (manual). At the minimum, these systems will move an actor from point A to point B, applying the specified animation if needed, and avoid going through static obstacles. These methods easily solve traversing small level maps and architecture as the UTGame maps demonstrate. With custom unrealscript, the same methods can can solve traversal of large landscapes/open 3D space. Custom unrealscript is required for dynamic obstacle avoidance. There are plans for this type of navigation in B.R.A.I.N.S.

                    Comment


                      #40
                      Originally posted by LiKeMiKeS View Post
                      I'm also interested in hearing the answer to this question!
                      Would be very useful in current projects!

                      Cool thread TechLord, I'll be following it too!
                      Originally posted by isathar View Post
                      I'm definitely interested in seeing where this will be going. This system looks like it has a lot of potential. I'm in the process of refining my game's AI systems, so the topic isn't far from my mind at the moment. If you need any help or more input, I'll do what I can.
                      Hi LiKeMiKeS & isathar,

                      I appreciate your interest. Community assistance would super-charge the B.R.A.I.N.S development rate and catapult the project towards becoming The Ultimate AI Plugin for UDK. One can quickly jump into this project with a little background knowledge in: UDK Source Control Integration, UnrealEd Kismet, UnrealScript, UDK AI & Navigation, Behavior Trees. If you don't have this background, no problem. Hop into this project and you will gain it! Youll will find this information useful whether or not you use BRAINS.

                      I have foundation code that's ready to be opened to the public. The project is currently under Source Control via Perforce:
                      Server: electric-lizard.servegame.com:1666
                      Client/Workspace: UDK

                      I'll promptly add interested parties to the P4 Access List with a PM, Title containing desired username/password (8 character minimum).
                      Example: Give Me BRAINS P4 Access isathar/1$@thar1

                      Comment


                        #41
                        Downloadable Snapshots of the current Brains Source and Content (Rev #336, Date: 2014/05/14) are now available in the Top Post!

                        Comment


                          #42


                          Currently, there is ZERO official documentation for BRAINS (one of a bazillion tasks I need to accomplish). I will answer any questions and build up a F.A.Q. along the way. I'm encoding comments with information that be exported to html documentation with tools like UnCodeX. Herein, I will attempt to explain the design and implementation.

                          BRAINS is functionally divided into 3 systems: Planner, Motor, and Sensor. The Planner is the Decision Making System, The Motor is Navigation/Audio/Animation, and Sensor is Data Evaluation/Collision Checks. BRAINS has a working implementation of common Behavior Tree Nodes:

                          • (Planner) Composite Nodes: Selector, Sequence, Parallel
                          • (Planner) Decorator Node
                          • (Motor) Leaf Node: Action
                          • (Sensor) Leaf Node: Condition


                          My implementation of a Blackboard is based on my concept of GiveTake Registry, essentially a list of values used in sequential evaluation to produce a TRUE result if all conditions are met, FALSE upon the first failure. This is the basis of a simplified rule-based expert machine. The Registry also serves as an area to share information between nodes. Data used in AI Agent Condition Evaluation is stored in the Registry for use by Condition Node.

                          Detailed Explanation

                          Ideally, when the BRAINS Plugin is complete, UDK Game Devs will be able to build complex AI behavior topologies entirely in UnrealEd Kismet that are easy-to-read and manage. A entry point for the BRAINS Unrealscript code-base is getting familiar with the Kismet Wrapper Classes. These classes contain *SeqAct* in the name, which create the Kismet Nodes that can be Drag-n-Drop, connected in UnrealEd. Kismet Classes and Function Names appear to be a magical binding mechanism between Unrealscript to UDK inner-workings. This mechanism isn't clearly documented, but, we make use of this hidden feature within BRAINS.

                          All of the BT Composite and Decorator Nodes extend from BrainsPlannerSeqAct_BaseNode.uc which are derivatives of the Kismet SeqAction Class. These classes extend from the Object and do not update per cycle nor have State support. To provide this functionality, we create a instance and reference to the BrainsPlannerNodeTask. This class extends from the Actor class and its sole purpose to execute node selection and check the result of child nodes per cycle at run-time. The BrainsPlannerNodeTask is manage with States.

                          SeqAct_Latent have Hooks into the Controller Class which execute Latent Functions that can only run in State code. The derivatives of this class are updated per cycle during run-time with a update() function. All Leaf Nodes (Conditions and Actions) extend from a derivative of SeqAct_Latent.

                          to be continue

                          Comment


                            #43
                            Hello TechLord, I´m experimenting consecutive crashes whenever I try to open the provided example maps for B.R.A.I.N.S. I´ve tried with MArch 2012 build and 2013 builds. Could you please acknowledge with which build it´s successfully working with.

                            Thanks very much n´congrats on your generosity for sharing this.

                            Comment

                            Working...
                            X