News Forums RAIN Sample Projects, How To, and Code [RAIN Starter Kit] Basic Behaviors

This topic contains 50 replies, has 6 voices, and was last updated by  prime 7 months, 2 weeks ago.

Viewing 15 posts - 1 through 15 (of 51 total)
  • Author
    Posts
  • #34518

    Jester
    Keymaster

    **Updated with every release of RAIN**

    Introducing the RAIN AI Starter Kit. This Starter Kit is designed to get you up and running with RAIN in a few mins.

    In this project we provide examples that demonstrate movement, waypoints, navmeshes, and sensing using RAIN. Patrol, Wander, and Follow behaviors are also included.

    We encourage you to share this project!

    http://rivaltheory.com/community/tutorials/

    #34523

    prime
    Keymaster

    If there’s a behavior that you’d like to see demonstrated in the Starter Kit, just ask. We’re looking for suggestions and will be making frequent updates to the project based on your requests.

    Coming next:
    One way waypoint route following
    How to use waypoint paths
    How to path across 2 Navigation meshes
    Movement using a Mecanim animated character

    #34732

    GinKevin
    Participant

    I’ve been trying to download the RAIN starter kit but keep getting redirected to an invalid page. I’ve tried both with Chrome and Explorer. Is there a mirror online anywhere?

    Kind Regards.

    #34741

    prime
    Keymaster
    #34806

    BrokenHelmet
    Participant

    Hey guys. This is a really awesome topic, and I am really looking forward to future updates. I want to follow it very closely.

    I’ve been working with RAIN for a while now, and based on the videos and tutorials, I have gotten pretty adept in using it, however I kind of reached my limit. That said, I had been waiting and watching for updates, and the wait is finally over \:D/

    So, I have been trying to create a reusable behaviour tree for the NPCs in my game (some townie types), however I got stuck. Long story short, there is a bit of coding required, but there are not too many topics on the RAIN API and so on (unless I am missing something). I wanted to know if you guys would be willing to also give some light introduction to writing scripts and making use of API and so on.

    I’ll mention that my NPCs use mecanim, so I may be jumping the gun on this topic, but I figured I should put it out there; no point in making another topic if all I have to do is wait a while.

    To sum it up, I was interested in making behaviours that cover:

    1. Detecting the player (or a character of interest) and reacting e.g. a wave or something (basically executing a function), but doesn’t repeat for a while.

    2. Interacting with the environment, especially correctly facing an item e.g. walking up and taking a seat (without IK)

    3. Making use of a Waypoint network (more of the coding aspect and manipulating the character using it)

    Now, these may be a bit advanced for someone starting out with RAIN, so I’m willing to wait, and participate with my own experiences, when(if?) we should reach this point of the topic.

    Please let me know if this cool. Kind regards.

    #34807

    prime
    Keymaster

    Thanks for the comments. We’ll see what we can do to demonstrate some of the behaviors you mention in an upcoming update to the Starter Kit, with a focus on some of the more advanced coding bits.

    Some of the behaviors are already demonstrated in the Starter Kit today. For example, the Patrol scene shows an AI that detects an enemy, computes a spot to run away to (in a small amount of code) and then runs for a short while. The same scene also shows an AI that detects points of interest during a patrol, moves to them, and faces them.

    More to come. Thanks.

    #34846

    Jester
    Keymaster

    New scene and examples available in the Starter Kit

    Multi Navmesh Scene:

    Check it out! http://rivaltheory.com/?ddownload=34506

    #34858

    BrokenHelmet
    Participant

    @Prime: Alright, I will pick at the Starter Kit code and move on from there.

    @Jester: Thanks for the the update (y). Looking forward to more :)

    #35128

    BrokenHelmet
    Participant

    Hey guys, I officially started (got back to) AI design for my NPC townies.

    First things first, I have to reacquaint myself with RAIN. It has been updating itself for a while now so there are a couple of things that may not be the same.

    Just wanted to know if the debugging feature for the behaviour tree still exists? To clarify, like in Mecanim, during runtime, it shows what’s happening in the Animator window. As for RAIN, it would show the processes in the Behaviour Tree editor. Does that still exist? I cannot for the life of me remember how to get it to work…

    #35130

    BrokenHelmet
    Participant

    Just wanted to know if the debugging feature for the behaviour tree still exists? To clarify, like in Mecanim, during runtime, it shows what’s happening in the Animator window. As for RAIN, it would show the processes in the Behaviour Tree editor. Does that still exist? I cannot for the life of me remember how to get it to work…

    Seems that I just needed to restart Unity.

    #35135

    Shirkit
    Participant

    For some reason, I can’t download the attached files.

    #35136

    BrokenHelmet
    Participant

    For some reason, I can’t download the attached files.

    Are you using the link @Jester provided a couple of posts up? This one: http://rivaltheory.com/?ddownload=34506

    It should be the latest version of the kit.

    EDIT: Just tried the link (on my phone) to be sure, and it downloaded OK…

    • This reply was modified 9 months, 2 weeks ago by  BrokenHelmet.
    #35145

    Jester
    Keymaster

    @brokenhelmet Yes we still have that feature, let me know if you need anything.

    @shirkit are you still having issues downloading the kit? Try a different browser. Post here if you’re still having any issues, I will be happy send it to you directly.

    #35336

    BrokenHelmet
    Participant

    Hey everyone. I have been chasing my tail around trying to figure out this little bit of code, which then turned into a “not so little” code. Let me break them down.

    (I’m not certain if I should be using a RAINAction script or a CustomAIElement script, so any advice on that is welcome)
    (It is a bit sad I don’t even have a script as a reference point, but please bear with me. Any findings will be put up)

    Note if I say NPC or Townie, I mean “the character” :p

    1. Getting the NPC’s current position, in terms of a Vector3 variable (stored to a RAIN readable variable if that makes sense).
    2. While using a BehaviourTree, a check if the NPC has reached a certain (read specific) navigation target (it would be cool if there could be a bool/success return).
    3. Still in the BehaviourTree, how to make use of “success” or “failure” returns to use in a “Constraint” node (which in hindsight should have come before).
    4. (A bit like #1) Getting a specific named navigation target, that is WITHIN a navigation route.

    So an example situation, so as to give a kind of idea on the result(s) needed, would be; if I wanted to know whether the NPC is moving (using a “move” action), then it would/can trigger an animation for example. And should the player stop moving (having successfully reached the intended target or whatever), it moves to a stop/idle animation and of course returns a “Failure” or “isMoving = false” bool.

    I hope this sort of makes sense. Please let me know where you may need me to clarify. Also, we can take this bit by bit, so as to leave a nice trail for any other user to follow.

    (No issue with the animations, just the results via code and/or BT are what are needed)

    Thanks in advance (“,)/

    #35354

    prime
    Keymaster

    For the general situation - you might do something like this as a piece of your BT:

    SEQUENCER
    — EXPRESSION isMoving = true
    — PARALLEL (succeed any)
    — — SEQUENCER
    — — — MOVE (to target)
    — — — EXPRESSION isMoving = false
    — — ANIMATE (MOVING) (repeat forever)

    On the other hand, I don’t normally keep state information like that. I usually structure the tree so that you “know” you are moving because you are in the part of the tree that deals with moving.

Viewing 15 posts - 1 through 15 (of 51 total)

You must be logged in to reply to this topic.