-
Notifications
You must be signed in to change notification settings - Fork 24
NPC.AISetup
This makes use of the Rain AI system. This will show you how to make use of my already made AI behavior trees to setup a fully functional AI system. The animations will not work if your animator behavior tree doesn't have the correct variables setup in the correct way.
- Automatic Setup
- Install Rain AI
- Setup BasicMind
- Setup Memory
- Setup MecanimMotor
- Setup MecanimAnimator
- Setup BasicNavigator
- Setup BasicSenses
Rain AI is a Unity Package that will allow you to build AI behavior trees with a nice GUI screen. This requires little to no code experience to complete So that's really nice. Rain AI can be found on the Unity Asset Store and its free!:
https://www.assetstore.unity3d.com/en/#!/content/23569
They have a wiki to discuss basic concepts:
http://legacy.rivaltheory.com/wiki/
but advanced setup features are limited to almost no examples. To help you understand the basics of this though watch this youtube series to get you up to date:
- (Basic Start 01) https://www.youtube.com/watch?v=sQlewYFwCOU&t=1s
- (Basic Start 02) https://www.youtube.com/watch?v=Obp2_3FBSUQ&t=307s
- (Basic Start 03) https://www.youtube.com/watch?v=ZTi-SqewHYg
- (Basic Start 04) https://www.youtube.com/watch?v=K6PSHGoRSM4
Now if your interested in a bit more these will also help you:
- (Mecanim Start 01) https://www.youtube.com/watch?v=QYE6Z3AfyPI&t=587s
- (Mecanim Start 02) https://www.youtube.com/watch?v=b_4yMWWHyW0
Once you have watched these a lot of the following setup will make a lot more sense. However, I do a lot more than what is just mentioned in these videos because these are "basic" and I'm setting things up a bit more advanced.
I have provided exported xml's that you can import to automatically setup your NPC. This still requires you to go through the Install process though. Inside the Rain AI folder of this git repo there are two folder called "Behavior Trees" and "NPC Setups".
To import the NPC Setup "EnemyNPC.xml" file first setup an AI on your NPC object. Then in the gear icon select Import XML.
To Import the Behavior Tree XMLs click on "Open Behavior Editor" Under the mind settings. Then select "Create New Behavior Tree". There should be an "Import XML" button that appears. So name your behavior tree (when making it) the same as what you want to import (not required) as it keeps things consistent and less confusing.
- Download the package from the Unity asset store using the unity editor.
- Import
- This will create an "AI" and "RAIN" folders. DON'T DELETE THEM!
- It will also add a "RAIN" button on the top of the editor
- Select your NPC Object
- Open the "RAIN" tab and select Create New > AI
- This will add an "AI" to your selected NPC Object
- Select your player
- Open the "RAIN" tab and select Create New > Entity
- This will add an "Entity" object to your player
- On your NPC Object Select the "AI" game object.
- If not already selected, select the head picture.
- Select the gear icon and select Import XML
- Import all of the behavior trees included in this github repo
- Setup like the following picture:
- Select the AI object
- Select the light bulb picture
- Add the following:
- Select AI Object
- Select the feet icon
- Add the following:
- Select AI Object
- Select the running man icon
- Add the following:
Nothing is changed here. The defaults will be fine.
- Select AI Object
- Select the Eye Icon
- All all of the following (order doesn't matter):
Now you should have a complete setup AI Object.
The following is a list of github repositories that made all of this possible:
delta patches: https://github.com/OctopusDeploy/Octodiff
.net 4 implemented in Monodevelop: https://github.com/mono/mono
Tuples In Unity: https://gist.github.com/michaelbartnett/5652076
Octodiff: https://github.com/OctopusDeploy/Octodiff
Input Manager: https://github.com/daemon3000/InputManager