by date
More AI Pack Trigger Examples
More AI Pack Trigger Examples
| Name: | Gary Haussmann | ![]() |
|---|---|---|
| Date Posted: | Mar 24, 2006 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Gary Haussmann |
Blog post
Here is a short set of examples from the "test" mission I'm using to debug and try out the various triggers for use in the "AI Pack" I'm working on with Phil and Dee. In case you haven't read my previous blog entries:
1. This stuff isn't AI at all, but will hopefully make the real AI code easier to use, by allowing you to synchronize the AI to specific events in the game.
2. The expectation is that you can get maybe 80% of the common FPS interactivity done without writing script code, although you may have to edit or copy/add datablocks.
3. No, I don't know when the AI pack will be ready.
OK, so the scenario is your typical fantasy setup, where you need to bind some evil demon dude (or whatever) and then shoot him with exploding crossbow bolts. In this scenario you simply need to light two torches and the evil dude will appear, at which point you kill him. Yay.
So first we slap some triggers at the "front" door to the castle you must enter. The overall effect here is that:
1. When you approach the door, you get a message telling you how to open it.
2. When you operate the door, the two parts of the door slide open.

How this is done: when you enter the volume near the door, the AIVolumeTrigger senses your proximity and sets off an AIEnvironmentEffect trigger. The AIEnvironmentEffect does all the various special effects; in this case, it sends an informative message to you explaining how to open the door (hit 'f').
If you hit 'f' you basically try to set off all AIOperableTrigger objects by sending a message to them. If you are close enough to the AIOperableTrigger and are on the correct team, the AIOperableTrigger will go off. In this case, the AIOperableTrigger fires two AIMovableShapeTrigger objects, which do nothing more than move a TSShape around. Thus the moving TSShapes provide for the "sliding door" effect.
Next we need to "bind" the evil dude. All that is required is to light two torches, simply by running up to them and operating them (the 'f' key again).

How this is done: really all we have is the AIOperableTrigger again, hooked up to an AIEnvironmentalEffect that creates a particle emitter. Not too exciting. However, we also hook up to an AIMultiSourceTrigger, which takes multiple triggers as input and goes off when all the inputs have fired, producing the final effect...
After both torches have been lit, the multisource goes off, creating the evil dude and using an AIEnvironmentalEffect to generate some chat text. Super scary!

Finally, I had this extra screenshot showing some triggers in the editor. The setup shown in the screenshot below is a chest that, when destroyed, explodes and spawns multiple orcs. This is done using the AIDestructableShapeTrigger. I expect the AIDestructableShapeTrigger will be used to make hundreds, nay thousands of destructable crates.

So anyway, that's the current state of the triggers. I need to clean up fields for each trigger object and work on the way trigger names are resolved. Currently, each trigger has to have a globally unique name, which is a little annoying if you need to copy/paste a dozen sliding doors. The plan is to require trigger names to be unique only within a simgroup, so that by grouping triggers appropriately you can re-use the same names over and over. Then there will be more integration with the rest of the AI pack, primarily with dynamically building different AI brains when characters spawn and enabling triggers to send messages to AI entities.
1. This stuff isn't AI at all, but will hopefully make the real AI code easier to use, by allowing you to synchronize the AI to specific events in the game.
2. The expectation is that you can get maybe 80% of the common FPS interactivity done without writing script code, although you may have to edit or copy/add datablocks.
3. No, I don't know when the AI pack will be ready.
OK, so the scenario is your typical fantasy setup, where you need to bind some evil demon dude (or whatever) and then shoot him with exploding crossbow bolts. In this scenario you simply need to light two torches and the evil dude will appear, at which point you kill him. Yay.
So first we slap some triggers at the "front" door to the castle you must enter. The overall effect here is that:
1. When you approach the door, you get a message telling you how to open it.
2. When you operate the door, the two parts of the door slide open.

How this is done: when you enter the volume near the door, the AIVolumeTrigger senses your proximity and sets off an AIEnvironmentEffect trigger. The AIEnvironmentEffect does all the various special effects; in this case, it sends an informative message to you explaining how to open the door (hit 'f').
If you hit 'f' you basically try to set off all AIOperableTrigger objects by sending a message to them. If you are close enough to the AIOperableTrigger and are on the correct team, the AIOperableTrigger will go off. In this case, the AIOperableTrigger fires two AIMovableShapeTrigger objects, which do nothing more than move a TSShape around. Thus the moving TSShapes provide for the "sliding door" effect.
Next we need to "bind" the evil dude. All that is required is to light two torches, simply by running up to them and operating them (the 'f' key again).

How this is done: really all we have is the AIOperableTrigger again, hooked up to an AIEnvironmentalEffect that creates a particle emitter. Not too exciting. However, we also hook up to an AIMultiSourceTrigger, which takes multiple triggers as input and goes off when all the inputs have fired, producing the final effect...
After both torches have been lit, the multisource goes off, creating the evil dude and using an AIEnvironmentalEffect to generate some chat text. Super scary!

Finally, I had this extra screenshot showing some triggers in the editor. The setup shown in the screenshot below is a chest that, when destroyed, explodes and spawns multiple orcs. This is done using the AIDestructableShapeTrigger. I expect the AIDestructableShapeTrigger will be used to make hundreds, nay thousands of destructable crates.

So anyway, that's the current state of the triggers. I need to clean up fields for each trigger object and work on the way trigger names are resolved. Currently, each trigger has to have a globally unique name, which is a little annoying if you need to copy/paste a dozen sliding doors. The plan is to require trigger names to be unique only within a simgroup, so that by grouping triggers appropriately you can re-use the same names over and over. Then there will be more integration with the rest of the AI pack, primarily with dynamically building different AI brains when characters spawn and enabling triggers to send messages to AI entities.
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 your own resources!| Tom Perry (Mar 24, 2006 at 14:54 GMT) |
| Gareth Fouche (Mar 24, 2006 at 15:06 GMT) |
| Matt Huston (Mar 24, 2006 at 15:42 GMT) |
| Paul /*Wedge*/ DElia (Mar 24, 2006 at 19:54 GMT) |
| Mincetro (Mar 26, 2006 at 23:37 GMT) |
| John McArthur (Mar 27, 2006 at 23:23 GMT) |
John
| Uiriam (Mar 28, 2006 at 08:07 GMT) |
Edited on Mar 31, 2006 13:39 GMT
| Fucifer (May 01, 2006 at 19:51 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



Not Rated


