ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
NPC vision distance

1 2 3 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  18:46:50  16 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
NPC vision distance

Given my annoyance with OGSE and how the soldiers of the southern outpost enjoyed chasing the horizon and then slaughtering the player and rookie village (they should team up with Skynet sometime, they'd be unstoppable!), and the fact that the AI switch distance is 150 metres and probably not to do with it...how do I mess with their vision distance? I now believe that they can simply see too far and go after enemies in the far distance (it would explain why my run-in with the boars near Wolf's stash resulted in an RPG hurtling all the way from the outpost itself). It can't be switch distance, and it probably isn't simply because they have RPGs (although I doubt the intelligence of any modder who thinks it's a good idea to hand NPCs RPGs - it's like handing a chimp a nuclear warhead, or letting Humans govern themselves ).

It's been a while since I've done any modding for SOC, so...anyone know if there is a setting I can modify to possibly fix the over-alert behaviour I have noticed? Of course, that is aside from not loading quicksaves right after dying...
  00:08:15  17 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
NPC vision distance

Given my annoyance with OGSE and how the soldiers of the southern outpost enjoyed chasing the horizon and then slaughtering the player and rookie village (they should team up with Skynet sometime, they'd be unstoppable!), and the fact that the AI switch distance is 150 metres and probably not to do with it...how do I mess with their vision distance? I now believe that they can simply see too far and go after enemies in the far distance (it would explain why my run-in with the boars near Wolf's stash resulted in an RPG hurtling all the way from the outpost itself). It can't be switch distance, and it probably isn't simply because they have RPGs (although I doubt the intelligence of any modder who thinks it's a good idea to hand NPCs RPGs - it's like handing a chimp a nuclear warhead, or letting Humans govern themselves ).

It's been a while since I've done any modding for SOC, so...anyone know if there is a setting I can modify to possibly fix the over-alert behaviour I have noticed? Of course, that is aside from not loading quicksaves right after dying...
---END QUOTATION---



gamedata\config\creatures\m_stalker.ltx
gamedata\config\creatures\m_army.ltx

search in both for eye_fov and eye_range.

  00:21:47  17 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Thanks. Alas, it appears that OGSE uses the vanilla m_army.ltx, and m_stalker.ltx merely adds an extra 10 to eye_fov. Le sigh...
  02:09:39  17 March 2012
profilee-mailreply Message URLTo the Top
weidrik
Senior Resident
 

 
On forum: 03/15/2009
Messages: 182
Maybe the OGSE team has made some changes to xr_camper file, like ZaGaR mentioned on the page 258 of the ZRP thread? I tried it, and NPC-s, especially the guards, are now much more active and smarter than before. Hell, it used to be safe to shoot Agroprom Spetsnaz from the roof, but now those buggers are smart enough to use ladders and come after me. http://pilt.delfi.ee/show_display.php?id=13661361&mode=0&salt=KnyIih.jpeg So I think that its worth checking out.
  13:08:58  17 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
03/17/2012 13:09:26
Messages: 1072
Thanks. I'm actually creating my own submod for Stalker, and I think I'm going to pick OGSE for it. Nothing overly major, certainly no all.spawn work this time around (I spent 8 months in 2010 modding Stalker and in the end got absolutely NOWHERE) and only a few new features I feel add to the game. In fact, I might need some help there - the ammo on the belt feature from AMK conflicts with Dunin's ammo script (ammo disappears when unloaded into the inventory, not entirely, but several bullets keep getting deducted from the total it should be).

It might be that using quicksaves and loading those after dying has sent the NPCs in my game into a spaz (luckily my changes will mean I need to restart, so I can see if that's the case).
  23:52:09  17 March 2012
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
Messages: 647
OGSE has mostly stock vanilla files with very few additions, mostly from the team itself and a bit of AMK. Probably uses an altered xr_combat.script. Several russian mods have this behaviour which I'm not able to explain.

Anyway, the only parameters that improve the situation are:

visibility_threshold=xxx - make it 300 to 500
....
luminocity_factor = xxx - make it 1.1 to 2.5 (when too high makes AI blind, ~1.2 )
transparency_threshold = xxx - make it 0.75 to 0.9, never higher than 1.0

These params apear in two sections near the begining of m_stalker.ltx, change both instances equally. Experiment a bit and good luck.
  00:08:30  18 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
03/18/2012 0:39:16
Messages: 1072
Hmmm, I'll try that then, thanks.

I don't want to go messing too much with it, but I've noticed odd behaviour just killing NPCs. I tested, and offed Sergiy Stalin (don't worry...it was just an experiment ) with the knife, and the rookies at the village didn't attack me - they went into a highly alert state, guns pointing into the distance (eastwards, not towards Sid's bunker). That can't be normal, or at least it's a first in my eyes.

EDIT: Whew, vanilla visibility_threshold is set at 150, OGSE at 30. 150 may be too high, but it's worth a try. Should be save-game compatible.

EDIT 2: Certainly going to have to change it above ~120 (if I read you correct, you really do mean 300 to 500? Just making sure). 120 doesn't fix any problems at all.

EDIT 3: 300 doesn't fix it. I took care of the boars, maybe they spooked the military patrol in the process of running away from me then coming back for some more shotgun, but a short while after, the military blokes are chasing the distance once more. One was even chasing the fence on the west side of Cordon...
  12:20:02  18 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
03/18/2012 13:44:40
Messages: 1072
In my tests, I've noticed the main problem is that when attacked by the boars, one of the soldiers generally goes off somewhere completely silly, not paying any attention to the combat at all. This is puts him into a fight with the rookie base, then all his mates come and help out...

I've noticed it with Petruha also, and mutants on the other side of the road. He was still where you first meet him in my test, but marched up the embankment and pointed his gun to the north, alert. He was alert to mutants, but certainly not pointing at them...

I haven't started any new game for these tests, using my current saves. Should be save-game compatible...

I'm sure the people who made OGSE put in a lot of effort, but I just can't get past such silly NPC behaviour. It breaks the immersion, especially if one is literally forced by the behaviour to fight the military at the start. No way is that ever going to be fun if one doesn't have the correct weapons and ammo, and even a decent suit (heck, half a day passes and they beat down on the player's butt). I don't know what other silly behaviours there are as a result of any of the changes...

EDIT: I may have made some progress on the issue now. In my latest test, although Petruha still acts too alert, the soldiers aren't all wound up by the boars. Even shooting the soldiers from a great distance doesn't cause them to spaz out (the patrol becomes alert and takes cover, naturally). At least a lone soldier hasn't yet decided to walk off in the opposite direction of his mates being attacked by boars and 'accidentally' alert his mates to the rookies.
  17:25:44  18 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
03/18/2012 17:26:10
Messages: 1072
Okay, here are my current settings in m_stalker.ltx:


[stalker_vision_free]
min_view_distance 		= 0.4				; êîýôôèöèåíò, êîòîðûé ìíîæèòñÿ íà eye_range, â çàâèñèìîñòè 

îò óãëà
max_view_distance 		= 0.8				; êîýôôèöèåíò, êîòîðûé ìíîæèòñÿ íà eye_range, â çàâèñèìîñòè 

îò óãëà
visibility_threshold	= 500 ;120 ;30 ;120.0				; çíà÷åíèå, ïðè äîñòèæåíèè ñóììîé êîòîðîãî îáúåêò 

ñ÷èòàåòñÿ âèäèìûì
always_visible_distance = 0.1
time_quant			    = 0.005
decrease_value			= 0.1				; çíà÷åíèå, íà êîòîðîå óìåíüøàåòñÿ âåñ, åñëè îáúåêò ïîïàë â 

ôðóñòóì, íî îòñ¸êñÿ ïî êàêèì-òî ïðè÷èíàì
velocity_factor		    = 0.5
luminocity_factor		= 1.1 ;0.5				; ôàêòîð îñâåùåíèÿ (òîëüêî äëÿ Àêò¸ðà)
transparency_threshold	= 0.9				; 0.75

[stalker_vision_danger]
min_view_distance   	= 0.7				; êîýôôèöèåíò, êîòîðûé ìíîæèòñÿ íà eye_range, â çàâèñèìîñòè îò óãëà
max_view_distance	 	= 1.0				; êîýôôèöèåíò, êîòîðûé ìíîæèòñÿ íà eye_range, â çàâèñèìîñòè 

îò óãëà
visibility_threshold	= 300 ;100 ;10 ;15 ;100.0				; çíà÷åíèå, ïðè äîñòèæåíèè ñóììîé êîòîðîãî 

îáúåêò ñ÷èòàåòñÿ âèäèìûì
always_visible_distance = 0.15
time_quant			    = 0.001
decrease_value			= 0.01				; çíà÷åíèå, íà êîòîðîå óìåíüøàåòñÿ âåñ, åñëè îáúåêò ïîïàë â 

ôðóñòóì, íî îòñ¸êñÿ ïî êàêèì-òî ïðè÷èíàì
velocity_factor		    = 0.5
luminocity_factor		= 1.0 ;0.4				; ôàêòîð îñâåùåíèÿ (òîëüêî äëÿ Àêò¸ðà)
transparency_threshold	= 0.8 ;0.6	



It seems to fix the problem for the most part. Some soldiers did do the wandering thing with these settings, maybe 400 is better than 300, or even 450. However after all three of the one patrol clustered in their 'dead spot' where they just stood, alert, they went back to normal.

If I were perfectly honest, OGSE looks like an excellent mod. A great base for adding a few things on, but not chock full or unstable. It's not that the AI being more active is a problem, it was this whole chasing the distance that seemed wrong (and the whole getting slaughtered so early in the game thing, too ).

Am I correct in assuming m_army.ltx is no longer used?
  21:27:38  18 March 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4287
Kaidonni: I think you should start with a different question. In many instances there is no visual perception until after there is auditory perception. And they don't programmatically see through certain level-bound structures. Why would Petruha even know about the boars south of him? They are 200 meters in the direction opposite to where he is looking!

The army will attack the rookies in vanilla if you draw their attention. But mods can have their own issues apart from that.

I'd first check for missing or invalid ogg-comment messages in your log. If you have them, there's always a good chance you will have NPCs overly-alert to dangers across the map, no matter what perception settings the mod has (except for "braindead" settings). Valid but inappropriate values in the ogg comment structure can also excite NPCs over long distances, but the usual culprit is a bad or missing comment in an ogg sound file.

I note that this info is available in several places, but maybe folks need to come up with a search engine that can read minds. Barring that, look for complaints that are worded differently from the way you speak.

Yes, m_army.ltx and related configs are not used in vanilla. Follow the config\creatures\ loading path #include references from system.ltx.

P.S. I recall that a lot of folks liked this "not a bug but a feature" aspect to some mods.

¯¯¯¯¯¯¯¯¯¯
weidrik and ZaGaR, re schemes: The Agroprom Spetsnaz are not using any of those camper or combat schemes. They will climb the inside ladder to get to the roof in vanilla. Look at their simple logic assignments in alife_l03_agroprom.ltx -- search for "name = agr_factory_spetsnaz" and check all eight of them.

I don't have any modified settings under discussion, but the NPCs and mutants are much more likely to move more intelligently that previously, ranging farther and using cover better. I think we are seeing this because we have been optimizing the code.

You can use the ZSU to interrogate the NPC as to what scheme or logic section he is using at the moment while in the game. There are instructions telling you how to print out the db.storage[] struct for the NPC of interest on the same page 258 of the ZRP thread referenced in this thread. With that, you'll see that the possible schemes will include abuse, combat ignore, danger, death, evader (if anomaly evader is enabled), heli_hunter, meet, walker, wounded, and possibly grenadier (ZaGaR and me) -- but no combat, camper or variations thereof.

(That dbstruct() function is also part of the upcoming ZRP 1.07 R3 release.)

I also used this code to access the database storage structure:

function dbs()
  local this_dude = z.this_guy()
  return (this_dude and db.storage[this_dude:id()]) or {}
end


You can use it in 1.07 XR2. First put it in z.script. (You can also put it in _g.script if you want to leave out the "z." prefix to use it, but you will still need the z.script support.)

In the game, use it with the ZSU Variable Watch function. (See the docs for details, like how to enable the ZSU.) Press Esc in game to bring up the main menu, then Z to display the ZSU dialog, followed by V to select Variable Watch (or click on it in the dialog).

Click in the edit box. Type this:

z.dbs().active_scheme

Click the Go button or press the Enter key. On the upper right of the HUD you will see the active scheme of whatever NPC is online directly in front of you. For the soldiers in question, it will be walker.

You can also use this:

z.dbs().active_section

This shows the current logic section. For the Spetsnaz, it will be walker or walker1.

Enter 0 in the Variable Watch edit box to turn off the feature.
 
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-2021 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.