Game Development Community

dev|Pro Game Development Curriculum

New Behaviors!

by Twisted Jenius · 06/14/2010 (3:33 pm) · 12 comments

The Universal AI Starter Kit update 1.4 is out right now and has 2 brand new behaviors; pet and critter. Anyone who's familiar with RPGs will probably understand the basic idea behind these two behaviors.

Pet
This is a bot that is "leashed" to the player and follows the player around. It stays within a certain distance of the player and can assist the player in attacking enemies. The difference between the pet and teammate behaviors is that the pet always stays in proximity of the player and never strays too far away or chases anything too far during combat. Protecting the player takes precedence over attacking enemies.

Critter
The critter behavior is for bots who you wish to act like prey animals. They are set to killable and they don't attack, but instead simply wander around the game world and run when they are touched. They are free roaming. You can also make them non-killable and thus they simply add to the ambiance of the game and make the environment much more life like. The critter behavior is also very streamlined and efficient, allowing you to have many critters in your game without serious performance problems.

I have also made heavy improvements to the leashed, teammate and escort behaviors. The leashed behavior is more consistent now and is able to move within its leashed area more fluidly. The bots in leashed mode are better at sensing enemies outside of their leashed area and reacting to them by moving to the edge of that area.

The teammate mode has also been improvement and now has better synchronicity between the bot and player. I have also made substantial improvements to the escort mode. Now as the bot who is being escorted by the player moves, it is much better at avoiding obstacles. It also doesn't stick quite as uncomfortably close to the player, thus making it easier for the player to defend the escort bot during combat. The escort bot isn't as likely to get in the way and take damage by keeping a little more distance between itself and the player during combat.

Now the behavior system has much greater opportunities for customization due to the fact that it has been reworked to feature traits within the behaviors which one can choose. By selecting different traits, you are able to modify behaviors for your specific game's needs. This also allows you to change traits dynamically during gameplay. By using the trait system, you are able to set up your bot's behaviors so that they can change as the game progresses. This new trait system also allows you to easily create new behaviors from scratch and is designed to lend itself to that level of customization. In addition to being able to create your own custom behaviors, The Universal AI Starter Kit also comes with ten stock behavior modes right out of the box.

Here is a list of the stock behaviors which are included in the kit.

All aggressive bot behaviors target, attack, and move in the same way. Here are the major differences between each behavior.

- Chase: After the bot has lost sight of or killed its target, the bot will stay around the area where it last saw its target alive.

- Guard: After the bot has lost sight of or killed its target, the bot will attempt to go back to its spawn marker or path.

- Turret: This is for stationary attackers. The bot will not move from its original spawn location, but will turn around on that spot.

- Leashed: The bot cannot move farther than a certain amount from its spawn marker and will return to its spawn point.

- Teammate: When not in combat, the bot will try to go back towards a player on its team. Bots do not need to use the Teammate behavior to be on the same team as players or other bots.

- Pet: When not in combat, the bot will try to go back towards a player on its team. The bot cannot move farther than a certain amount from the player.

Non-aggressive bot behaviors can have scripted actions (such as dialogue). While in these behaviors, bots will not attack anything at all.

- NPC: The bot cannot be killed.

- KillableNPC: The bot can be killed.

- Escort: The bot can be killed and will follow the player around.

- Critter: The bot can be killed and runs from the player when touched.


img9.imageshack.us/img9/9808/uaiskscreen2halfsize.png

Update Blog #1 - Huge Update!
Update Blog #2 - New Behaviors!
Update Blog #3 - AI to the Rescue!
Update Blog #4 - AI Documentation

About the author

Developer of The Universal AI Starter Kit and Twisty's Asylum Escapades.


#1
06/14/2010 (3:40 pm)
Can pets be applied to other NPCs? I've always loved the idea of characters with pets or familiars.

...also, it totally looks like I'm blog-stalking you ;P.
#2
06/14/2010 (4:08 pm)
Not by default, but you can change just one line of code and leash one bot to another.
#3
06/16/2010 (12:24 pm)
Just had 40 minuts to port your kit from the old to the new version in my game. Your new update is awesome. I will do more tests, but im pretty sure all works fine. great work !
#4
06/16/2010 (1:11 pm)
I try to minimize incompatibilities between versions of The UAISK as much as possible, but due to the size of this update, a few got in there anyway. Still, 40 minutes isn't too bad at all.

It’s nice to hear that the new version is working for you.
#5
06/16/2010 (11:55 pm)
Loving this pack.. what attracted me to the pack was the behaviors. Keep them coming... if you can add any more? Can't really think of any more you could add but I'll definately provide some input.
#6
06/17/2010 (2:34 am)
If you, or any other kit owners, think of anything you'd like me to add in; go ahead and post it in the feature request thread.
#7
06/18/2010 (1:30 pm)
hmm this kit now looks like something i might be able to use with little changes ty for this update i might think about getting it now. :P
#8
06/18/2010 (2:26 pm)
@ Brandon

What kind of project are you working on right now? If you tell me what your needs for the kit are, I could tell you if you'd need many changes or not and let you know whether this would be a good fit for your project. Let me know.
#9
06/19/2010 (5:53 am)
How i told before, I was doing more tests on the kit. Don't find any thing not works. Just had to rework each path, i did in the old version. This kit and your support is great. TY and im rally happy i bought it, this save me a lot time of work:)
#10
06/24/2010 (5:04 am)
I am doing a RPG.

I need npcs to basically start out in a formation to the enemy once in range they scatter or they are given a order to scatter or to defend someone or something.

Can't stay to much about that game, but this is basically what I need for npcs.

The defending is the easy thing to find the hard thing is following and formations as you have pets follow well that takes care of that only its not pets. :P Only thing I don't know if formations, but I going to have to do that anyway. No one has formations besides 1 company that cost to much to buy.
#11
06/24/2010 (6:39 am)
I think you can do formations by setting each bot on a path with the proper starting position for the AI spawn marker. In the very beginning of my first video (embedded below) you can see something similar to this. You can also do much more complex formations than what are shown.

In addition to the "pet" behavior, the "teammate" behavior also follows the player.

#12
06/25/2010 (12:50 pm)
Ya but they exit the formation once they are active thats just starting formation. I want them to stay in the formaion wile going to attack untill they reach a switch or untill they are told to do something by the player. Though it might be easy to get that working so they stay in the formations still if the code is there to work off of.

Thanks for your reply.