Jump to content
The Dark Mod Forums

Summoning mildly alert AI


Springheel

Recommended Posts

I have a scenario that I'd like to arrange in the mission I'm working on, but I'm not sure of the best way to do it.

 

Say I had an AI who was guarding a horse. This AI is in the next room, so he can't see the horse, but he is within earshot. The player is supposed to steal something that is inside the horse's stall.

 

What I would like to have happen is that if the horse sees the player, he will whinney, and the AI will come to see what is going on. I don't want the AI to run in with his sword out, though, as the horse could be reacting to a rat or something else. He wants to check and make sure nothing is wrong, but he has no reason based on the horse whinnying to assume there is a thief. Ideally I'd like the AI to be at a low level alert...walk in, stand there, look around, and leave if nothing is visible.

 

I'm pretty sure if I set the horse to an enemy team, and he sees the player, he will "shout" an alert that will cause AI to come running and draw their swords. I haven't looked at propogated sounds for a while, and I can't remember if it's the volume of the shout that determines the alert level.

 

Any ideas on how to accomplish something like this?

Link to comment
Share on other sites

Hm. A script or a conversation?

 

You could have a conversation "horse and the guard." The horse should be blind and deaf.

 

When the player walks too close to the horse, a trigger starts the conversation.

Horse: *whinney*

Guard: "WTF is going on there?"

*walks to the horse*

*looks around using conversation waypoints and animations*

Guard: "Everything seems to be in order... back to the barn door. <sigh>"

*end conversation, AI returns to original place.*

 

The trigger could be trigger_multi to make it work several times, remember to adjust the delay time so that it will not retrigger immediately when the conversation is running.

 

This approach has the bonus that you could use custom lines to make the guard say something interesting or funny.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The trigger could be trigger_multi to make it work several times, remember to adjust the delay time so that it will not retrigger immediately when the conversation is running.

 

Heh. Now this is thinking outside the box!

 

The converstion can turn off the trigger when it starts, and turn it back on at the end. Then you won't have the player re-triggering the conversation.

 

You could even set up a few different conversation entities, and vary what the guard says.

 

First time: "What?"

 

Second time: "Ok, what's eating you?"

 

Third time: "WHAT?"

 

Fourth time: Totally ignore the frackin' horse.

Link to comment
Share on other sites

Only problem in that case is that the player can't avoid the trigger. I want the player to be able to get away with it as long as he doesn't alert the horse (or he KO's the horse with a gas arrow). Can conversations be triggered by AI reaching a certain alert level?

Link to comment
Share on other sites

Only problem in that case is that the player can't avoid the trigger. I want the player to be able to get away with it as long as he doesn't alert the horse (or he KO's the horse with a gas arrow). Can conversations be triggered by AI reaching a certain alert level?

 

I think, if AI is alerted, the conversation will not work.

 

Howsabout a hidden objective "Don't ALERT the frickin' horse!"

When that is failed, the objective triggers the guard conversation that brings him in. You could recycle the objective back to original state after the conversation.

 

In this scenario the guard should not be able the hear the panicing horse. I don't know anything about how the horse AI works. Are they alarmed the same way as the guards?

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

An objective might just work. I can make sure the AI doesn't hear the horse and get alerted.

 

The only downside is that if the AI is already alerted by something else, he won't go check the horse when it makes noise, which is precisely what he should do.

 

I'll run a few tests tonight and see how this works.

Link to comment
Share on other sites

The only downside is that if the AI is already alerted by something else, he won't go check the horse when it makes noise, which is precisely what he should do.

 

I wonder if the horse alarm objective could activate a little script that simply checks if the guard AI is alarmed.

If he is alarmed, you could trigger an alarm entity in the horse barn to make the alarmed AI to go there and investigate. I do not think that kind of script would be longer than just a few lines...

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Howsabout a hidden objective "Don't ALERT the frickin' horse!"

When that is failed, the objective triggers the guard conversation that brings him in. You could recycle the objective back to original state after the conversation.

Wouldn't this lead to the same problem as

he will "shout" an alert that will cause AI to come running and draw their swords.

???

 

You could use a response to player on the horse for examble (don't know if that works). The response would than be triggering the conversation. The player response reacts only to the player if he is seen (not sure if to hearing, but that would the guard do IMO so we don't need it).

Well, this way you can bypass the alert system.

Edited by Obsttorte

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Actually, I've found that the system _almost_ works out of the box. If I put a horse on one side of a wall and an AI on the other, the AI reacts to the horse's pain bark ("Huh? What's that noise?") If there are enough sounds (or presumably if it were louder) he would come to investigate. So presumably, I could tailor the volume of the sound to be enough to bring the guard in without fully alerting him. This has the benefit of the guard remembering the alert and perhaps getting more agitated if it happens again (and it works if he's already alert).

 

One problem though. It appears that non humanoid AI do not make any noise when spotting the player. I tried with horses and with spiders, and although both had a "snd_sight" spawnarg, neither made any noise. I would have sworn that spiders DID make a noise when they charged you, but maybe I was thinking back to Thief.

 

This seems like either a bug or an oversight. Default D3 monsters make their snd_sight noise when spotting the player, and ours should as well.

Link to comment
Share on other sites

Is seems to be a bug in the code (the sound isn't played), not in the setup. There are some definitions in the def files (but some look a bit strange, like "snd_sight1" but no "snd_sight" on the horse), but the code mentions snd_sight only here:

 

game/SecurityCamera.cpp
386:							StartSound( "snd_sight", SND_CHANNEL_BODY, 0, false, NULL );

 

Presumable earlier this sound was handled by the scripting code, and it was forgotten to be moved over to the SDK. Or removed accidentily from the SDK code.

 

A tracker entry would be in order :)

 

Edit: Not as easy to add, because there are multiple cases where a player can be spotted, when alert, when in combat, when idle etc. Also, there is already code that emits barks when a player with a body is spotted etc. Grayman seems to be the man to handle this and all the nec. testing and special cases.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

When humanoid AI see the player, they use either their combat or flee barks, depending on whether they are a civilian or not. I don't know why monster AI don't do the same thing, but giving them a vocal_def doesn't seem to do anything.

Link to comment
Share on other sites

The code definitely never mentions "snd_sight", so all these defined on animals and monsters won't be emitted - that at least should be fixed. As for not using their combat or flee barks, not sure about this.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Well, snd_sight is just leftover from D3. We just need monsters/animals to react to the player (if hostile), but it doesn't matter if we use snd_sight or our own vocal system. Problem is that neither one seems to do anything atm. Although I'm sure it works for zombies....

Link to comment
Share on other sites

Yeah, I was just mentioning that the fix should either use snd_sight, or we should remove the spawnargs as they then just confuse.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
×
×
  • Create New...