News › Forums › RAIN › Sample Projects, How To, and Code › [RAIN Starter Kit] Basic Behaviors
Tagged: RAIN Starter Kit
This topic contains 50 replies, has 6 voices, and was last updated by prime 7 months, 2 weeks ago.
December 3, 2022 at 7:03 pm #34518
**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!December 4, 2022 at 7:45 am #34523
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.
One way waypoint route following
How to use waypoint paths
How to path across 2 Navigation meshes
Movement using a Mecanim animated characterDecember 12, 2022 at 2:57 am #34732
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.December 12, 2022 at 6:23 am #34741December 17, 2022 at 3:45 am #34806
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.December 17, 2022 at 7:40 am #34807
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.December 18, 2022 at 11:34 am #34846
New scene and examples available in the Starter Kit
Multi Navmesh Scene:
Check it out! http://rivaltheory.com/?ddownload=34506December 19, 2022 at 2:13 am #34858
@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 moreJanuary 19, 2023 at 11:57 am #35128
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…January 20, 2023 at 3:34 am #35130
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.January 20, 2023 at 10:39 am #35135
For some reason, I can’t download the attached files.January 20, 2023 at 11:17 am #35136
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…
January 20, 2023 at 3:44 pm #35145
- This reply was modified 9 months, 2 weeks ago by BrokenHelmet.
@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.January 28, 2023 at 9:16 am #35336
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 (“,)/January 29, 2023 at 7:06 am #35354
For the general situation - you might do something like this as a piece of your BT:
— 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.
You must be logged in to reply to this topic.