ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Question about enemy vision AI

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  01:51:34  17 August 2009
profilee-mailreply Message URLTo the Top
xdiesp
(Senior)
 
On forum: 07/29/2009
Messages: 132
Question about enemy vision AI

I am trying to make an invisibility tool, but this inner working of enemy vision AI is troubling me:

1) If an attacked enemy sees you switch to his own faction, he stops attacking...

2) ...but as soon as you get back to your own faction, he is going to see your position through walls like he had a radar too.

Now I'm searching for the place where the vision AI is stored (not just m_stalker) to fix this or possibly having a purer invisibility effect.
  09:26:44  17 August 2009
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
Messages: 1418
this thread might answer some of your questions, of course, it might not either:

For those who hate night vision NPC's
[link]http://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr2&thm_id=16504&sec_id=22[/link]
  15:14:52  17 August 2009
profilee-mailreply Message URLTo the Top
xdiesp
(Senior)
 
On forum: 07/29/2009
Messages: 132
How about some code in XR_ files about npc forgetting enemies?
  11:37:21  23 March 2013
profilee-mailreply Message URLTo the Top
Max1944
(Novice)
 
On forum: 03/17/2013
 

Message edited by:
Max1944
03/23/2013 22:43:52
Messages: 1
I have identified the "radar" that makes enemies notice you throu walls.

It is in the xr_danger.script under \gamedata\scripts

It can be opend it with Notepad++, and in there is a command :

local def_ignore_distance_hit =

I think this command is responsible to alert nearby NPC's. The weird thing is if you save and reload the game dead (hidden) NPC's seem to "scream" silently, and the whole base will be alerted and they will start to chase you (even throu walls).

local def_ignore_distance_hit = 1 will fix that, and the dead NPC's stay quiet after a reloaded savegame.

---------------

With the loss of this feature the AI won't react if their neighbour get shot, because with their 110° tunnel view they often wont't see it.
To fix that, make a change in the m_stalker.ltx under gamedata\config\creatures

eye_fov = 240
  01:24:43  9 April 2013
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4181
I would have expected a reload of a save to trigger the corpse detection stuff, not the hit stuff. But I also expect the hit to be communicated to the associate before the save is made, and that should trigger him.

This is based on my test experience without any real consideration of cause. I'd already noticed that stealth is actually preserved across saves, at least until someone loses a life. As long as they are not alerted by the presence of dead bodies, other threats or your noise/visibility, NPCs won't know you are there. Even if they are put on alert by bodies/threats, they still won't know where you are. (This is the real place to put an emphasis on stealth fixes.)

In the ZRP's xr_motivator.script there's code to show your damage to NPCs. This hit_callback() is called for all local NPCs even if no damage is done, every time an NPC takes a hit that they survive. Everyone knows before the save if anyone is hit.

That code is not called if their damage is total -- i.e., if they are killed. The death_callback() function is called instead. So any one-shot kill can avoid the broadcast notification of "I'm hurt! Marked One did it!" -- there's no hit notification.

I think -- and I'm shooting from the hip here, with Marked One's accuracy -- that it's not the save that has the problem itself, but the hit perception before the save. Your tweak reduces that perception for default values.

That goes into the save even though the NPCs didn't react initially. It is then (remember, I'm guessing) recognized by the NPC before his assigned perception values/roles are fully restored. It may be that the "Danger, Will Robinson!" mechanism to override default scheme and scripted programming is wrongly applied here.

Anything is possible. The default value at 150 is still absurdly high; maybe 50 would be a more realistic initial value.

The problem is also one of balance, as you have seen already. You can get into a real mess of juggling parameters to make everything work well together. Look at the weapon mod scene as an example.

Keep in mind you're changing a fallback default value. Often there are predefined values to override defaults and scripted events with ignore_combat settings (e.g., don't shoot Nimble even though he is your genetic enemy).

What I'm thinking would work better: Remove the broadcast. Make it all audio/visual; different gasps/cries have different AI loudness perception with distance playing an important role. And if I see my buddy fall, I can alert everyone else.
  01:35:47  9 April 2013
profilee-mailreply Message URLTo the Top
Ataru Moroboshi
Senior Resident
 

 
On forum: 02/25/2004
Messages: 218

---QUOTATION---
I would have expected a reload of a save to trigger the corpse detection stuff, not the hit stuff. But I also expect the hit to be communicated to the associate before the save is made, and that should trigger him.

This is based on my test experience without any real consideration of cause. I'd already noticed that stealth is actually preserved across saves, at least until someone loses a life. As long as they are not alerted by the presence of dead bodies, other threats or your noise/visibility, NPCs won't know you are there. Even if they are put on alert by bodies/threats, they still won't know where you are. (This is the real place to put an emphasis on stealth fixes.)

In the ZRP's xr_motivator.script there's code to show your damage to NPCs. This hit_callback() is called for all local NPCs even if no damage is done, every time an NPC takes a hit that they survive. Everyone knows before the save if anyone is hit.

That code is not called if their damage is total -- i.e., if they are killed. The death_callback() function is called instead. So any one-shot kill can avoid the broadcast notification of "I'm hurt! Marked One did it!" -- there's no hit notification.

I think -- and I'm shooting from the hip here, with Marked One's accuracy -- that it's not the save that has the problem itself, but the hit perception before the save. Your tweak reduces that perception for default values.

That goes into the save even though the NPCs didn't react initially. It is then (remember, I'm guessing) recognized by the NPC before his assigned perception values/roles are fully restored. It may be that the "Danger, Will Robinson!" mechanism to override default scheme and scripted programming is wrongly applied here.

Anything is possible. The default value at 150 is still absurdly high; maybe 50 would be a more realistic initial value.

The problem is also one of balance, as you have seen already. You can get into a real mess of juggling parameters to make everything work well together. Look at the weapon mod scene as an example.

Keep in mind you're changing a fallback default value. Often there are predefined values to override defaults and scripted events with ignore_combat settings (e.g., don't shoot Nimble even though he is your genetic enemy).

What I'm thinking would work better: Remove the broadcast. Make it all audio/visual; different gasps/cries have different AI loudness perception with distance playing an important role. And if I see my buddy fall, I can alert everyone else.
---END QUOTATION---



Wow, I really hope this gets tested! Things like this can have a huge effect on the game. Would you be able to play around with the scripts and see if this works? I've got a thread devoted to nothing but AI and I think something clever like this is perfect for that thread!
  23:36:08  11 April 2013
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4181
If nothing else, I can prove/disprove the contention that it's the hit-perception persistence across saves that is affecting NPCs before all the rules/exceptions are applied.

I'll be looking into it.
  01:33:44  21 April 2013
profilee-mailreply Message URLTo the Top
Ataru Moroboshi
Senior Resident
 

 
On forum: 02/25/2004
Messages: 218

---QUOTATION---
If nothing else, I can prove/disprove the contention that it's the hit-perception persistence across saves that is affecting NPCs before all the rules/exceptions are applied.

I'll be looking into it.
---END QUOTATION---



Has anything come from this? Any new information?
  06:17:58  27 April 2013
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4181
I'm still testing and thinking about this, but here's what I have so far:

I went after a group of four Cordon replacement bandits at the autopark, starting with a test base save. While all were alive, debug info said that the only danger objects were stalker and dog_weak with the danger scheme settings shown below. I silently took down the bandit on second floor sentry duty. No one was alerted; debug info was unchanged after the takedown.

I quicksaved with a quiet knife next to the south wall of the south-most carpark building, then loaded that save. Now the bandits were on alert and actor had been added to the danger object list with a best_danger type of 0 (either danger_object.bullet_ricochet or danger_object.visual according to lua_help.script).

Danger scheme settings on a bandit at Nimble's firepit*:

active_section: kamp@esc2_st_fabric_kamp_1
active_scheme: kamp
danger:
    ignore_distance_sound: 25
    danger_inertion_time_ricochet: 30000
    danger_inertion_time_sound: 15000
    ignore_distance_corpse: 1
    danger_inertion_time_hit: 60000
    ignore_distance_grenade: 225
    ignore_types:
        corpse: true
    ignore_distance_hit: 1
    ignore_distance: 22500
    danger_inertion_time_grenade: 20000
    danger_inertion_time_corpse: 10000

These distances are the values in xr_danger.script squared for quick comparisons. The ignore distances there are ignore_distance = 150, ignore_distance_corpse = 1, ignore_distance_sound = 5 and ignore_distance_hit = 1. Note that I have even added corpse to the ignore_types list.

So even with ignore_distance_hit = 1, the two campfire bandits were on alert and I was their target.

If I lower ignore_distance enough, I can reload the save and all is as before the save was made -- no one is on alert.

This shows that 1) hit info is not directly preserved across the save, and 2) ignore_distance_hit doesn't matter.

I then loaded my test base save again. I told the two non-campfire bandits to kill themselves via macro key bound to z.kill_this_thing(). A save/reload in the same spot as before had no alerted bandits, even with a pistol recharge.

The test was repeated with default corpse settings. No change; the bodies were farther than 10 meters from the campfire guys.

At this point, you can see that it's not hit perception or corpse detection, yet the game is telling the survivors when the save is loaded that Marked One is the source of a bullet ricochet.

I noticed that a reload in this situation had my current position info in the enemy attribute of the NPC's storage, yet the NPCs were moving to the point I was standing when I one-shot the sentry in the back of the head.

Side note: That enemy attribute? Everyone's is set to you when you shoot something. It is ignored by your friends. It is selectively ignored by the enemy based on their sensitivity, but only during the current session. A save/reload later you will be enemy, after the corpse is their enemy for ten seconds.

My tentative conclusions, subject to extreme revision:

Lowering ignore_distance_hit will result in NPCs not reacting at all to being shot from beyond that distance. This is unrealistic; they need to react ("I'm being shot!") but not know where you are. I'm now thinking of increasing that distance for more realistic sniping response, while limiting the amount of usable knowledge: "It came from the west!" "I don't see anyone! Who's shooting?" etc.

The game cheats. There is no real persistence of NPC alertness status according to the debug info; the NPCs nearby are alerted on reload of a previous save by virtue of a corpse danger_object which they may or may not acknowledge based on xr_danger.script settings (and any specific overrides if they exist).

Even if they are told to ignore the corpse, after the inertia delay (default 10 seconds) the living NPCs are then notified that there is a bullet ricochet from YOU, even though you have not shot anything since the reload.

At this point they will move to the spot where you were located when you silently took down their compadre. That info is apparently stored based on the on_hit/on_death data your victim received in your previous session.

The good news of all this is that something can be done about it. The bad news is that any quick/compatible fix will be a hack -- the real fix is to persist the true state, not attempt to artificially recreate it based on cheating telepathic forensics from the Zone.

Tip: for now, don't make a save until you have moved a reasonable distance from your last point of damage delivery.

__________
*Excerpt of log data from running ZSU's Execute Script Command with z.print_table(z.dbs()) in SoC 1.0004/ZRP 1.07 R4.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2017 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.