Full concept MODIFICATION of S.T.A.L.K.E.R. Call of Pripyat that touches every game aspect including textures, sfx, music, weapons, A.I., items, weather, mutants, difficulty and much much more!

Forum Thread
  Posts  
[FIX / TWEAK] NPC detection ranges (Games : S.T.A.L.K.E.R.: Call of Pripyat : Mods : MISERY : Forum : General subjects : [FIX / TWEAK] NPC detection ranges) Post Reply
Thread Options 1 2 3
trojanuch
trojanuch Gameplay lead
Mar 27 2014 Anchor

Ok guys - so its a good point to admiting that NPC capabilities to detect things at distance might have been pushed a little bit on the high side :)

EXPLANATION:

Reasons for this are multiple - but the most important one comes from technical reasons - its basically very easy to make NPCs unreactive at all at certain distance, which then allows exploits of shooting NPC from beyond this distance with no retaliation from their side.

This in turn makes all long distance / sniper rifles much more effective than any other weapon type.

So for the sake of above (and consistent difficulty), we have opted (after discussions) for making sure that NPCs absolutely always react, no matter from how far away they are shot at.

Proper solution would of course be to make them always react but slow down those reaction appropriately if the distance between them and target is large. This however is somewhat problematic to achieve due to engine limitations so its much more of a 1 / 0 situation. Also note that it is not really possible to diversificate behaviour of NPC having scoped weapons and un-scoped ones - vision settings are common.

---

PROPOSITION:

All above said, we would like to propose a mutual tweaking effort to reach the value which suits the mod the most. Alternatively, we are going to make the distance combat setting another optional, selectable during the installation process - as the switch_distance currently is.

---

SETTINGS TO TWEAK (basic):

file:
gamedata\configs\creatures\m_stalker.ltx

line:
eye_range = 350

Please tweak above line to your liking - I would however propose to change by a constant - like 25 (325 >> 300 >> 275) and testing in-game afterwards.

Please don't change any other vision settings in m_stalker.ltx - it will have no effect as all other setting are diversified between NPC ranks and have to be tweaked elsewhere (see the advanced section below) - however the eye_range is purposely common so it can be tweaked in this singular place.

At some point lowering the above value you'll notice the NPC are becomming gradually more unreactive at distance. Please post your best settings in this thread - taking into account above points of NPC becomming unreactive and thus opening possibility of distance fire exploits.

---

SETTINGS TO TWEAK (advanced):

(please follow this part only if you like to play with numbers / tweak stuff)

files:
gamedata\configs\creatures\profiles:

m_stalker_novice.ltx
m_stalker_regular.ltx
m_stalker_experienced.ltx
m_stalker_veteran.ltx
m_stalker_master.ltx
m_stalker_master_exo.ltx

lines:

1. go down each file until reaching:

[fire_queue_params_xxxxxxx] (where xxxxxxx is the rank name)

2. values like:

pstl_min_queue_interval_close
pstl_max_queue_interval_close

indicate the additional delay (in ms) that NPC holding a specific weapon at certain distance from target suffers, before being able to shoot.

So the 'end reaction' time has two steps: visibility check (of varied lengh depended on conditions) >>> fire_queue delay >>> NPC fires

Using above it is possible to apply additional delay for NPC fire at for example long range. Note however - that delay set for specific weapon type at specific distance is arbitral - in a sense that it no longer is depended on any conditions like for example actor being in the dark / bush / moving - its a value selected each time between the min / max which prevents NPC from taking a shot before it passes.

(please check how these values are tweaked for the Rookie mode and you'll have the picture)

This can lead to a situation in which - if delays are long - we can see that NPC has noticed us and aims at us but will not fire until the delay timers ends, even though we are standing in the open and are otherwise extremely exposed.

---

Ok that's all.

Please tweak above stuff to your liking and post the results here - I think that the 'basic' section is more than enough to remedy 99% of problems connected with NPC reactivity at distance. However you also have the 'advanced' section to perhaps go deeper, should you like to.

In the end I'd like to thank Phate for opening my eyes properly to the issue in this episode of his extremely cool 'Let's play':
Youtube.com

Also - @kcs123 sorry for disregarding your feedback - I think we should have taken more effort towards balancing this thing prior to release - but you know how it is - there's never enough time.

Ok then - happy tweaking guys.

Trojanuch
Gameplay lead
Misery Development Team

Edited by: trojanuch

Mar 27 2014 Anchor

Thanks, i needed that. I would like to return to the previous (beta) range distance, what was the value for that ?

Cheers

Nyayr
Nyayr Reconnaissance Beta
Mar 27 2014 Anchor

I'd like to know too, I think it might be closer to 150x2 instead of 350x2 :P

As the movie clip said it might be more logical that enemies that can't see you start making directional fire or when they can't spot the enemy that they go in hiding position behind cover etc... I don't know if the engine can handle that, you said it was pretty 1 or 0 :(

--

Avoid using autosaves, use hard saves only.

Logs are located in "C:\Users\Public\Documents\S.T.A.L.K.E.R. - Call of Pripyat\logs\xray_....log"

trojanuch
trojanuch Gameplay lead
Mar 27 2014 Anchor

Well - point of this thread is that this thing requires experimentation. In the comming days I won't really have time for this so I gathered that if 10+ ppl will dig into this, then the nice value is established quite effectively.

So again guys - whoever is interested, above is the key to NPC's omniscense :) Have fun!

Edited by: trojanuch

kcs123
kcs123 Just Kcs123
Mar 27 2014 Anchor

When you are in doubt, revert to last known good settings. In 2.1 BETA eye range was like this in "gamedata\configs\creatures\m_stalker.ltx"

Someone wrote:
eye_range = 150


Files for other NPC level of expirience have 50-100 higher values, but you will not be wrong if you play with same 150 eye range for all NPC levels.
Some other factors influence overall AI logic, so, you will be good with above.

Settings from vanilla CoP and Misery 2.0 - 2.0.2 is not so good anymore becouse of ghille AI thing introduced in Misery 2.1.
Even without wearing ghillie, the same calculations for ghillie are used for night bonuses and for recon class bonuses.

That ghillie tweak uses three different settings for close, medium and far range between actor and NPC. While close and medium range is pretty much good balanced, settings for far distance could give player too much bonus, so players who use high alife switch distance could abuse that.
I think that is main reason for unbalanced AI difficulty. I have some ideas how to change things for calculating close/medium far distance, but that requires some more testing.

The latest eye range of 350 x 2 could also be one of reason why quest NPCs like Spartacus or Topolov keep gettibg killed. They wander outside of "safe" area becouse they become alerted by mutants/hostile NPC squads that were far away on map. They wander outside to engage mutants/bandits and then become killed.

I'm also short on free time lately, but I will try to make some rework on AI on weekend and upload here. Until then you can try to tweak by yourself.

--

Mar 28 2014 Anchor

Ok, so I have played a few hours with the eye_range set at 250, for the moment it seems perfect, no more ambushes from 3 miles away and npcs still reacts when I am myself trying to shoot them from a distance.

That being said I play assaulter and my long range weapon is an AK, don't know what could happen if I was a Sniper with a x50 scope.

Ho and the file to change is gamedata\configs\creatures\m_stalker.ltx, the interesting line being barely in the middle of it.

Nyayr
Nyayr Reconnaissance Beta
Mar 28 2014 Anchor

I am playing at 200 as well as my alife is 200, so it is pretty easy ;) I noticed they ambush me less already, though still can 2 shot me in the head (monolith pripyat). At short range Someone's head stays paper regardless of your artefacts and plates, though i have noticed at longer range this is less so, no more headshots from accross the bay with an AKSU. :P

Edited by: Nyayr

--

Avoid using autosaves, use hard saves only.

Logs are located in "C:\Users\Public\Documents\S.T.A.L.K.E.R. - Call of Pripyat\logs\xray_....log"

Mar 29 2014 Anchor

eye_range 250 for me & 300 alife, runs better now thank you all for this little tweak. :thumbup:

Apr 1 2014 Anchor

From what I understand the negative factors of the default range are largely outweighed by its positives. Granted, NPC wandering is not good, but there must be a more dynamic adjustment to use that doesn't involve diluting the current persistent difficulty on the world map.

I have everything at default with Alife at the setting below full map, the only real issue with this is the Alife setting may be causing crashes. And the only issue I have with NPC ability is their pin-point grenade tactic, still something that doesn't bother me too much.

Nyayr
Nyayr Reconnaissance Beta
Apr 1 2014 Anchor

The grenade effect can't be fixed cause grenades are used just like weapons, its an engine thing. Which you can exploit cause if you are behind a wall enemies sometimes want to grenade you and then go boom :P

--

Avoid using autosaves, use hard saves only.

Logs are located in "C:\Users\Public\Documents\S.T.A.L.K.E.R. - Call of Pripyat\logs\xray_....log"

burguois
burguois MISERY Dev. Friend
Apr 1 2014 Anchor

I'm not sure if you're interested, but I've made a script that will dynamically change npc eye range and fov based on the time of day and weather conditions.

Right now it works off the value stored in m_stalker.ltx for eye_range and eye_fov values. It has different settings for night, day, combat (slightly higher than the other values, as they're more aware etc) and such. Also takes into account stalker rankings (veteran/master stalkers have better eyesight than rookies, and npcs designated as leaders/snipers in their section name have different values also)

It also drastically reduces the eye range of all NPCs in foggy weather and very foggy weather. At very foggy, it changes eye range to 30 and fov to about 50. The player cannot see more than 30 meters infront of them during very foggy weather cycles, so why should stalkers?

--

Author of the (now integrated into MISERY 2.1) MISERY 2.0.2.1 quickfix! The team congratulates you, Burguois, for this huge contribution! You've earned the Friend Of MISERY Dev. achievement!
- [TZP]LoNer1 
radasil
radasil Loner
Apr 1 2014 Anchor

Burguois wrote: I'm not sure if you're interested, but I've made a script that will dynamically change npc eye range and fov based on the time of day and weather conditions.


Definitely interested! Can it be released as a patch/update? This will be a big boost to realism!

burguois
burguois MISERY Dev. Friend
Apr 1 2014 Anchor

I have to test it out slightly at the moment. I'm using Atmosfear's assigned fog values for foggy/veryfoggy weather cycles, and I'm not entirely sure how well it plays with the LIOS function already in game.

--

Author of the (now integrated into MISERY 2.1) MISERY 2.0.2.1 quickfix! The team congratulates you, Burguois, for this huge contribution! You've earned the Friend Of MISERY Dev. achievement!
- [TZP]LoNer1 
Apr 2 2014 Anchor

burguois wrote: I'm not sure if you're interested, but I've made a script that will dynamically change npc eye range and fov based on the time of day and weather conditions.

Right now it works off the value stored in m_stalker.ltx for eye_range and eye_fov values. It has different settings for night, day, combat (slightly higher than the other values, as they're more aware etc) and such. Also takes into account stalker rankings (veteran/master stalkers have better eyesight than rookies, and npcs designated as leaders/snipers in their section name have different values also)

It also drastically reduces the eye range of all NPCs in foggy weather and very foggy weather. At very foggy, it changes eye range to 30 and fov to about 50. The player cannot see more than 30 meters infront of them during very foggy weather cycles, so why should stalkers?


That has got to be the most intelligent way to work around the range issue, simply fantastic if it works as intended. Great thinking mate.

Apr 2 2014 Anchor

burguois wrote: I'm not sure if you're interested, but I've made a script that will dynamically change npc eye range and fov based on the time of day and weather conditions.

Right now it works off the value stored in m_stalker.ltx for eye_range and eye_fov values. It has different settings for night, day, combat (slightly higher than the other values, as they're more aware etc) and such. Also takes into account stalker rankings (veteran/master stalkers have better eyesight than rookies, and npcs designated as leaders/snipers in their section name have different values also)

It also drastically reduces the eye range of all NPCs in foggy weather and very foggy weather. At very foggy, it changes eye range to 30 and fov to about 50. The player cannot see more than 30 meters infront of them during very foggy weather cycles, so why should stalkers?

wow I am really interested in this :)
because some guys in balaclava with a pistol are real sharpshooters at midnight rain :D

Apr 2 2014 Anchor

sounds like a great idea & I hope it works, thanks

Nyayr
Nyayr Reconnaissance Beta
Apr 2 2014 Anchor

You can take out enemies as well with a pistol at lets say 40 yards, beyond that range you can see stalkers don't fire at you when using a pistol and engage (unless they are zombies).

Though I agree weather has to affect their aim more especially rain, fog etc. You do notice during dense fog you easily ambush them now. :P

--

Avoid using autosaves, use hard saves only.

Logs are located in "C:\Users\Public\Documents\S.T.A.L.K.E.R. - Call of Pripyat\logs\xray_....log"

burguois
burguois MISERY Dev. Friend
Apr 2 2014 Anchor

Yeah, about that. I noticed in the xr_combat_ignore the st.stage is supposed to be set to 3 in very foggy weather, and 2 in foggy weather.

Problem is if I'm reading the script right, st.stage 3 will never be invoked because st.stage 2 uses "string.find(level.get_weather(),"foggy")"

Problem is that string.find looks at the whole string and if it finds any mention of foggy, it will change st.stage to 2.

This is my modified xr_combat_ignore.script that hopefully allows st.stage 3 to actually be invoked.

Pastebin.com

Edited by: burguois

--

Author of the (now integrated into MISERY 2.1) MISERY 2.0.2.1 quickfix! The team congratulates you, Burguois, for this huge contribution! You've earned the Friend Of MISERY Dev. achievement!
- [TZP]LoNer1 
Apr 2 2014 Anchor

Awesome! I'll definitely give this a go. I'd never modded STALKER games before, and really wasn't sure where to start with this one.

Here's my issue with the Cement Plant mercs. At this point, they're all kinds of spread out across the southern area of the map so I took a break from playing. Having them magically spawn next to me because I triggered their commander/original spawn has been a gamebreaker for me.

Apr 3 2014 Anchor

Guys, i'd appreciate if you would find some time to have a look at a tweak i made to adjust the A.I. detection parameters, it's available at my tweak thread - link.

This time around i started from scratch, nothing was based off of 2.0.x tweak's values, it should now have similar difficulty as vanilla 2.0.x, just with somewhat optimized parameters and fixed problems present in 2.1 (NPC's ability to see in complete darkness, total vision distances for skilled stalkers), so most of the elitist players should also find it to be useful.

But, if you'd like to read a bit more about what each of the settings does, feel free to have a look here.
Here's the image i posted there, might be a bit useful for quick reference (although a bit inaccurate at places):

Edited by: Stiivais

--

Author of a bunch of tweaks and stuff:

  • [Misery 2.0] Misc adjustments.
  • [Misery 2.0] Stealth fixes.
  • [Misery 2.1] - thread - Misc tweaks.
  • [Misery 2.1] - thread - New performance texture pack and radio songs addon.
  • [Misery 2.1] - thread - SweetFX shaders (poor man's ENB).

Lost all my files - goodbye... : /

Apr 4 2014 Anchor

So I tried eye_range of 225 with my switch distance at 250, it felt much better. Mercs no longer own the southern half of Zaton, but do react well when I initiated firefights. I only had one surprise pulled on me from a set of bandits at a good range, but at least I could see them. I'll bump it up to 250/250 and see how that goes.

Apr 4 2014 Anchor

Sorry for ignorance, but: What is this alife everything keeps talking about?

Nyayr
Nyayr Reconnaissance Beta
Apr 5 2014 Anchor

alife.ltx located in the config map, it is standard at 300 and affects how much of the area is 'alife' and not auto calculated. The higher the more area and more cpu/ram you need to prevent stutter and low fps. 150 is vanilla for example.

--

Avoid using autosaves, use hard saves only.

Logs are located in "C:\Users\Public\Documents\S.T.A.L.K.E.R. - Call of Pripyat\logs\xray_....log"

radasil
radasil Loner
Apr 6 2014 Anchor

Playing as a sniper on the standard 300, I had a chuckle when a very distant bandit tried like mad to hit me with a shotgun while standing on the bridge overlooking me (Zaton). I was at Noah's ark and kept hearing this ping-ping-ping of pellets striking the surrounding terrain, punctuated by the occasional whine of flyby rounds. After about 15 seconds of this I was able to pinpoint him on the arch under the bridge. It took me only two shots before I nailed him with my Moisin Nagrant, catapulting him through the air to land in the swamp below (but i still had to climb to get his crappy weapon).
The 300 standard works in your favour when they try to nail you from too long a range with inferior weaponry.

Nyayr
Nyayr Reconnaissance Beta
Apr 7 2014 Anchor

Sounds like it is best to have it the same as your alife setting.

--

Avoid using autosaves, use hard saves only.

Logs are located in "C:\Users\Public\Documents\S.T.A.L.K.E.R. - Call of Pripyat\logs\xray_....log"

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.