 |
|
It is currently Mon May 20, 2013 5:11 am
|
View unanswered posts | View active topics
NPCs not responding properly to certain stimuli
| Author |
Message |
|
G-Flex
MJ12
Joined: Mon Jul 11, 2011 10:16 pm Posts: 495
|
 NPCs not responding properly to certain stimuli
Well, this sure is strange.
I noticed that some of the Hong Kong military police don't care to react much to certain things.
For example: Brandishing a weapon in front of the two Canal Road guards doesn't do anything even though they both have bHateWeapon set to True.
For a better example: The military policeman near the alarm in the Wan Chai Market map (in the corner near the tea house) reacts to you wielding a weapon: His agitation level is increased, he goes hostile, and runs off to get the alarm. However, the other one, next to the stairs of the tea house, does not react the same despite having what seem to be the exact same AI/alliance/other parameters.
I can't really seem to figure this out at all. HandleWeapon() isn't even being called for the guards that aren't responding properly. I don't think it's an issue of them being able to see me, either. Does anyone have any idea what could possibly be doing this?
Note: They do still seem to respond to weapons being fired. That's something, I guess, but why the discrepancy?
EDIT: Yeah, the ones affected aren't responding to carcasses either. You can shoot one of the canal guards in front of the other and he won't care about anything except that initial shot itself, and will thus remain friendly.
EDIT 2: Okay, if I swap the positions of a "reacting" and "nonreacting" market guards in UnrealEd, the nonreacting one starts reacting and the reacting one stops reacting. For some reason, location matters here. What the hell.
|
| Mon Apr 02, 2012 5:34 am |
|
 |
|
Neveos
X-51
Joined: Wed Mar 03, 2010 1:29 am Posts: 834
|
 Re: NPCs not responding properly to certain stimuli
I'm running into the same problem with my guards. I think it may be something about HumanMilitary.
Basically it boils down to this:
bHateWeapon turns NPC hostile if weapon is fired.
In HumanCivilian this happens with the first shot. In HumanMilitary this happens after 3 or so shots. (I don't know why)
bFearWeapon distresses NPC if player is holding a weapon.
In HumanCivilian this happens the moment it is shown. In HumanMilitary this never happens. (again, I don't know why)
So the only work around is to set TNM's AIEventTrigger to WeaponDrawn and have it trigger a couple alliance trigger which will turn the gaurd's hostile. However, as you'll see, this is shoddy because it will be difficult to make this look realistic.
_________________ http://www.youtube.com/watch?v=e3FfPUKuGsQ&t=8m0s
|
| Fri Apr 06, 2012 6:01 pm |
|
 |
|
DDL
Traditional Evil Scientist
Joined: Mon Oct 17, 2005 10:03 am Posts: 3639
|
 Re: NPCs not responding properly to certain stimuli
Probably down to the differences between hate and fear: fear is pretty much "omg run", whereas hate goes via increaseagitation (potentially on a 1.5sec cooldown), which then goes via maxprovocations and agitationlevel, so you might need several events to push it into proper "hate" mode. Default is maxprovocations = 1, which means two instances of the stimulus are needed, and if you're on a 1.5 sec cooldown between increments, it could easily require 3 shots before you go into full hate-mode.
|
| Fri Apr 06, 2012 8:13 pm |
|
 |
|
Neveos
X-51
Joined: Wed Mar 03, 2010 1:29 am Posts: 834
|
 Re: NPCs not responding properly to certain stimuli
I'm interested in the logistics of that. Is it possible to set maxprovocations to a lower value to get the npc to react as soon as I pull it out?
_________________ http://www.youtube.com/watch?v=e3FfPUKuGsQ&t=8m0s
|
| Fri Apr 06, 2012 8:17 pm |
|
 |
|
DDL
Traditional Evil Scientist
Joined: Mon Oct 17, 2005 10:03 am Posts: 3639
|
 Re: NPCs not responding properly to certain stimuli
Yep, it's a variable you can adjust. Under AI, I think. Set it to zero. Animals have it at zero by default, for instance.
|
| Fri Apr 06, 2012 8:23 pm |
|
 |
|
Neveos
X-51
Joined: Wed Mar 03, 2010 1:29 am Posts: 834
|
 Re: NPCs not responding properly to certain stimuli
hmm. it is at zero, but I still cannot get him to fear or hate the weapondrawn.
_________________ http://www.youtube.com/watch?v=e3FfPUKuGsQ&t=8m0s
|
| Fri Apr 06, 2012 9:03 pm |
|
 |
|
G-Flex
MJ12
Joined: Mon Jul 11, 2011 10:16 pm Posts: 495
|
 Re: NPCs not responding properly to certain stimuli
I'd like to reiterate that in the problem I'm facing, AI parameters themselves do not seem to be the culprit. The same guard will respond differently depending on where he is in the map.
Like in my Wan Chai market example: The guard by the alarm will properly react to seeing a weapon. The guard by the tea house stairs will not. If I swap their places in the editor, the one who is now by the alarm will react, and the one who is now by the stairs won't. This is in spite of the fact that they can both see me (AICanSee and CanSee return the proper values).
There's probably something very strange going on regarding how AI events, or possibly only certain ones (such as sustained events, or perhaps visual events), are propagated throughout the map.
|
| Fri Apr 06, 2012 9:58 pm |
|
 |
|
Neveos
X-51
Joined: Wed Mar 03, 2010 1:29 am Posts: 834
|
 Re: NPCs not responding properly to certain stimuli
Are you actually getting a guard to hate the weapon? I would really like to get this to work. You can tell they originally wanted the player to be unable to have a weapon drawn in Hong Kong because when you first descend the elevator into the market, you will automatically holster the weapon (and the existence of the unique "acoustic sensors"). They must have changed this later, because none of the NPCs are set to fear weapons.
_________________ http://www.youtube.com/watch?v=e3FfPUKuGsQ&t=8m0s
|
| Sat Apr 07, 2012 3:53 am |
|
 |
|
DDL
Traditional Evil Scientist
Joined: Mon Oct 17, 2005 10:03 am Posts: 3639
|
 Re: NPCs not responding properly to certain stimuli
G-flex, that basically sounds like lighting, then.
Add lights to the map where to non-responding guard is (or throw down a ton of flares), see if it changes. I don't think AICansee is terribly reliable, plus technically it's not whether they can see you, as much as they can detect the EAITYPE_Visual event being emitted by the weapon you're holding.
|
| Sat Apr 07, 2012 10:03 am |
|
 |
|
G-Flex
MJ12
Joined: Mon Jul 11, 2011 10:16 pm Posts: 495
|
 Re: NPCs not responding properly to certain stimuli
I've tried spawnmassing lightbulbs like crazy in the area. Doesn't help. Flares don't help either.
|
| Sat Apr 07, 2012 2:34 pm |
|
 |
|
Morpheus
X-51
Joined: Thu Jan 27, 2005 9:56 am Posts: 909 Location: A planet near mars
|
 Re: NPCs not responding properly to certain stimuli
Longshot, but looking at the NPCs you mentioned, they are in an area of a map that there is not much room for the player to move past them, so could that be an issue? Probably not though.
_________________ My nature videos: http://www.youtube.com/user/DynamixWarePro My whistle/flute videos (and some other videos): http://www.youtube.com/user/DXMorpheus
|
| Sat Apr 07, 2012 10:48 pm |
|
 |
|
Neveos
X-51
Joined: Wed Mar 03, 2010 1:29 am Posts: 834
|
 Re: NPCs not responding properly to certain stimuli
im interested in whether he even managed to get a guard to hate the weapondrawn, ever. if you did, we could reproduce it. because i simply can't get it to happen under very lit and open conditions.
_________________ http://www.youtube.com/watch?v=e3FfPUKuGsQ&t=8m0s
|
| Sat Apr 07, 2012 11:14 pm |
|
 |
|
G-Flex
MJ12
Joined: Mon Jul 11, 2011 10:16 pm Posts: 495
|
 Re: NPCs not responding properly to certain stimuli
I think I've made it pretty clear that I have, but to reiterate an example I gave before: Go to the Wan Chai market. Go to the corner near the tea-house. There will be a military policeman standing next to the alarm on the wall. If you have a weapon drawn in front of him, he goes hostile. I've put debug messages in the code to the effect that I know it's the weapon being drawn that bothers him (as if anything else would at that time). Same deal with carcasses, since some NPCs in that area don't seem to respond to them either, whereas in other parts of the game they clearly do.
|
| Sun Apr 08, 2012 9:46 am |
|
 |
|
DDL
Traditional Evil Scientist
Joined: Mon Oct 17, 2005 10:03 am Posts: 3639
|
 Re: NPCs not responding properly to certain stimuli
Hrmm..well I've been testing this HKmarket shenanigans at bit, as I had a tiny bit of free time, and while I'm no doubt not as thorough as you: for me, I can sneak up to the guard by the alarm and draw a weapon and it will actually make him go hostile by IFF, without actually alerting him. He simply stands there happily, red in my crosshairs, but otherwise blithely unconcerned. I did wonder if there was something in the fact that the guard in the tea house wasn't set to raisealarm_beforeattacking (raisealarm_never, instead), but changing that makes no difference. Indeed, I moved the alarmunit itself over to him and all that did was make the usual guard go hostile and then run over to press the alarm in its new location. I can replicate your observation that switching the locations makes the previously unresponsive guard responsive and vice versa (i.e. level positioning not AI settings seems to be at the root of it), so N=2 on that observation now...  Also, if I place the teahouse guard over by the alarm guard, if he's to the left of the alarmguard, he remains unconcerned by guns while the alarm guy behaves as normal, whereas if he's to the right of the alarmguard, NEITHER of them now respond to weapondrawn. It is...incredibly strange, I agree.
|
| Sun Apr 08, 2012 1:12 pm |
|
 |
|
G-Flex
MJ12
Joined: Mon Jul 11, 2011 10:16 pm Posts: 495
|
 Re: NPCs not responding properly to certain stimuli
(edit: accidental self-quote)
Last edited by G-Flex on Mon Apr 09, 2012 2:20 am, edited 1 time in total.
|
| Sun Apr 08, 2012 7:46 pm |
|
|
Who is online |
Users browsing this forum: No registered users and 1 guest |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
 |