Previous Blog Next Blog
Prev/Next Blog
by date

A real simple AI pack example

A real simple AI pack example
Name:Gary Haussmann
Date Posted:Feb 10, 2006
Rating:Not Rated
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Gary Haussmann

Blog post
If you've read some of Phil's posts about his AI Pack, one of the key concepts he mentions in
this post is that a person should be able to setup a lot of situations by simply placing a few objects and setting a few data fields. They should not be required to hack up a bunch of script functions and C++ code, although scripting may be required for a funky or unusual type of AI behavior. In this vein, I've been getting the basic triggers to work and itegrating them into the editor for (hopefully) easy use.

Here I present the simplest possible example, and the one that will probably be used in many places: if the player enters a specific area, NPC baddies spawn. Again, you should be able to do this without writing up additional script code or modifying script files.

So we start by slapping down two trigger objects. One is the volume trigger, that goes off when it is entered, exited, or occupied. Here we have the volume trigger "spawntest" setup right on top of the firepit, which will activate its target "spawnhere" when entered.



The second trigger objects is "spawnhere" which will spawn AIPlayers. When triggered, "spawnhere" will spawn three AI NPCs with a interval of 5 seconds between each spawn, indicated by the "MaxActivation" and "TriggerDelay" fields. You can also see other fields like "monsterType" and "brainFactory" which let you select which AIPlayer datablock and AIBrain to use.



After you enter the volume trigger, the spawner will spew forth three AI DefaultMonsters. At this point the spawner has hit its max activation and so no more orcs will spawn.



Lets say the spawner didn't work quite right and you wanted to tweak the timing or activation values. If we wanted to be annoying we could force you to save and restart the mission to try out your new settings, but luckily there is a reset button in the AI menu that will reset the triggers. After resetting you can walk on the firepit and three more DefaultMonsters will spawn.



So there you can see that the most basic triggers are working. There are a lot of bits that need polishing; for example, some sort of visual animation or feedback indicating when a trigger goes off would be extremely helpful methinks. But at this point I figured I had enough screenshots to justify a blog post :P

Recent Blog Posts
List:03/24/06 - More AI Pack Trigger Examples
02/10/06 - A real simple AI pack example
01/02/06 - An Approach to Making Random Dungeons
10/31/05 - Plan for Gary Haussmann
09/26/05 - Plan for Gary Haussmann
03/07/05 - Plan for Gary Haussmann
01/30/05 - Plan for Gary Haussmann
01/04/05 - Plan for Gary Haussmann

Submit ResourceSubmit your own resources!

Timothy Aste   (Feb 10, 2006 at 23:17 GMT)
Whoa!

Chris \"C2\" Byars   (Feb 10, 2006 at 23:36 GMT)
x2!

Nick Zafiris   (Feb 11, 2006 at 00:03 GMT)
Sounds great! Can't wait to give this a shot...

fireVein   (Feb 11, 2006 at 03:15 GMT)
Awsome!

-Jase

Lee-Orr Orbach   (Feb 11, 2006 at 16:50 GMT)
Getting my money....

Toby W. Allen   (Feb 11, 2006 at 18:58 GMT)
How did you get the Icon in the mission editor bit?

You must be a member and be logged in to either append comments or rate this resource.