Changed formula for NPC's detection. It is now heavily based on light and distance. Added weight, body state, memory and many other factors. Flashlights/headlamps/campfires are now giving visibility boost to enemy. Modified luminosity itself (a lot).
WARNING:
- There might be some weird spikes in NPC visibility (happens in vanilla too) on DX9 and higher. Usually happens in houses (Dead city, Limansk are the maps where I've met it). This is most likely caused due to broken static lights and from what I heard require recompilation of maps (which isn't something I or anyone I know can do).
- Just in case, NPCs can't see you behind a cover sometimes, because of broken camera placement (height of camera when crouching). Vanilla bug but for some reason people report it to me.
- If you use any weather addons (except Michiko's Weather Revamp), I can't guarantee my addon to work correctly. It was made for vanilla weather/colors. Reshades should be fine as long as they don't touch weather configs.
Description
Tried to make NPCs see you just how you see them (with lesser range ;p). New formula is mostly based on light, distance and to a lesser extent velocity, your total weight, type of outfit you're wearing and body state.
To be more specific on each variable, other changes and why they were important:
(Just a heads up, talking about DX9,10,11 because DX8 works differently)
- Luminosity, sun, shadows and flashlights: Reworked luminocity (wasn't working correctly in vanilla). NPC flashlight now gives them a solid boost to their vision on you, 25m is max, the closer you are the better they see. Your flashlight gives them vision boost aswell (only if you are in their range of vision, can't do it differently), even at long distance, but not too much compared to short distance.
- Weight and outfit: weight and outfit type are now the visibility factors. Doesn't really matter too much at distance greater than 50m. Light outfit and low weight is the best for it, but medium outfit and 45 kg is still optimal.
- Velocity and distance: Mostly unchanged, still a decent penalty.
- Crouch: simple 0.4 multiplier when you are crouching (0.2 for low crouch). Won't help much at closer distances during daytime, but essential for hiding at medium/long distances and obviously stealth (also reduce sound).
- Static lights: they don't affect luminosity on DX9 and higher, waiting for devs to fix it.
- Campfires: are back and affect luminosity once again.
- Luminosity Icon: If you want to turn it off - install MCM (Mod Configuration Menu). Icon only displays how much light there is on player, nothing else.
- Memory: NPCs remember the target they already saw. NPC will receive a boost to their vision once this specific target enter their view range again. Boost decays over time and it take around 100 real-life seconds (with default MCM value of 1.0) for NPCs to lose their boost on this target again.
- Danger and Sound: isn't touched, but you can try this addon dead air xr_danger .
- Ghillie suit: increases the time it takes for NPCs to notice you, based on distance and does work only when you aren't moving.
- NVG (works on 1.5.2 only): some NPCs could get an NVG (green dot on their head) at night, which gives huge vision boost, probability of getting NVG depends on rank. Set NVG to "0" in MCM if you want NVGs to never appear on NPCs (if you also want current ones to disappear - reload after).
The higher MCM sliders are the faster NPC will see an enemy.
Changelog:
- 2.31:
- Okay apparently there was a very very rare "busy hands" occurrence with NPC NVGs feature, fixed hopefully, thanks to Thial and RavenAscendant for helping and freedomfighter for finding and testing it.
- 2.3:
- Added muzzle flash vision boost for NPCs aswell, works on 1.5.2 only (should not crash on 1.5.1), tnx to RavenAscendant and demonized.
- Setting NVG MCM value to 0 now also should prevent crashes if you are on 1.5.1 Anomaly version (also added another check for previous version just in case).
- Small code rework, fixed some small bugs where couple of player variables were added to NPC against NPC vision (even if none of them sees the player).
- 2.2.2:
- Fixed NPC vision texture, lost it somehow in the process, sorry for it taking so long ;s
- 2.2.1:
- 2.2:
- Added NVG to some NPCs (based on rank) instead of headlamps. It looks like NPC without headlamp and with a green dot on their head at night and it gives them decent vision boost regardless of distance or angle (unlike headlamps). Set to "0" in MCM if you want to disable feature. And no, you can't loot it xd Thanks to Thial for the particle!
- 2.1: New skyrim-like icon, code refactor.
- 2.0: Added vision memory for NPC.
- 1.9: Flashlights (for NPCvNPC and NPCvPlayer).
- 1.8.2: Michiko's Weather Revamp 3.0 compatibility patch.
- 1.8: Couple of features and preparations for next Amowawy update: Muzzle flash is now giving small boost to NPC's visibility (silencers remove this penalty). Reworked and moved "ghillie suit", now it decrease the time NPCs need to notice you, based on distance and does work only when you aren't moving.
- 1.7:Brighter moonlight, darker night shadows. Better free/danger state multipliers. Toggleable through MCM icon.
- 1.6.8:Death Animations compatibility patch, weight adjustment.
- 1.5: Campfires, DX8 support, luminosity icon.
- 1.4: Added Low crouch, fixed NPC's danger state.
Compatibility, installation
Compatible with any mod that doesn't change two files: m_stalker.ltx (if you overwrite this one - NPCs will probably be blind) and visual_memory_manager.script (overwriting this file will crash your game), m_stalker.ltx can be easily merged. I only changed [vision sections] and also eye_range, eye_fov. I don't recommend changing formula variables in m_stalker.ltx.
Just so you know, addon has Mora's NPC without Amnesia mod in it, which I thought is necessary. If you (for some reason) want NPCs to have amnesia back - delete xr_combat_ignore.script.
Installation is simple drag and drop gamedata to Anomaly root folder or use mod manager.
If you are having blind NPCs then congratulations, you successfully skipped description.
Credits
Mod isn't that big, but I'd like to still thank people who helped ;]
ravenascendant and Feel_Fried mainly, for helping with everything; Longreed for writing a HUD class even if I didn't ask xd; whereismy for explaining how some things work, DX8 support and testing; NiceDreamer for testing; Igigog didn't actually do anything; artifax RazorShultz Grokitach for help with code; mora145 for "no Amnesia mod"; meatchunk; LVutner; Blackgrowl and Trolleybus for icons. Thial for particle.
sneaky breeki
not work on Hotfix 8 im so sad
It might work on U4H8 if you delete/comment block with 'mcCrouch' and 'mcAccel' in script, remove "* crouch" from "step_incr" equation and delete Mora's no Amnesia files (you can get moddb version of it, its for u4h8) ;] But then it won't matter if you stand or crouching, not sure there's other way to add it for previous versions.
Cool! Thx for the tip, installed in my anomaly
Have fun ;] But keep in mind, I mentioned that there's something wrong with luminosity on RC19, so it's probably on U4H8 aswell. Hope I was just wrong in my observations, try it.
thx, how can i try testing it fast?
Hm, you will have to uncomment test tool in script, remove "--[[" and "--]]". Then go to game and watch console numbers of luminocity(orig) during different weather, here are some examples of how it should be:
w_clear1 (time 13:00): under sun = 1.0 ; in shadow = 0.4
w_cloudy1 (time 17:00): under sun = 0.66 ; in shadow = 0.32
You can use F7 weather editor for it. Oh, and you also have to place cursor on any NPC or console won't display anything.
bro you use U4H8?
cheeki breeki
I'm about to try this on RC22, I'm on my first playthrough and have a lot of experience with CoP and SoC, as well as CoC. I'm hoping this mod actually makes stealth harder and makes the NPC / AI generally more challenging. I hate it how you sometimes have to walk up 3-5 feet next to NPC's for them to detect you. Even on Hard and Survivalist with Hardcore AI aim enabled the furthest engagement distance I have been spotted and shot from is about 80 or 100m. It was kinda far but at the same time I feel like it should be further, I'm hoping this mod does that. I'll report back and be sure to review and such once I see the changes and potential improvements in game!.
The thing I noticed in all Stalker games, there's no golden middle between stealth and non-stealth, NPCs are either notice you at any time or not notice at all. So the purpose of this mod was not to make stealth harder (but ye it's quite challenging here ;p), but to make it possible without breaking non-stealth gameplay. NPCs in realistic version can notice you from approx 115m (more in danger state), but if you want them to see even further just add max_view_distance in m_stalker, I left some examples of different range there so should be easy ;] There's also a test tool in script that you can uncomment for even easier tweaking ;p
с рилизом епта
tx
а он работает на RC23?
Да
Worked fine on RC23 here, gonna update the addon now and see
Tnx, I just compared RC23 to RC22 numbers too. Seems like they didn't change ambient_light too much, so mod should be perfectly fine to use on RC23.
Yo thanks for the mod and the post on the discord. Enjoying coming back to this game after many years, cheers
Glad to hear it, yw ;]
it works on RC19?
Yes, I didn't test it too much on RC19, but it felt like one engine variable wasn't working as expected or so I thought...try it out.
you can put in your file a variant with the modification for DX8 is that I can't find where to configure
I need too
Ok, updated with DX8 version.
Edit: sorry, redownload again please, I decide to keep luminosity from weather configs as they should be same as dx9+ ;p
It's good, it doesn't seem to destroy stealth, but it affects FPS quite badly for me (i7-3770/1060-6GB). I don't know if it's from the script or the LTXs, or whether there is any solution that still keeps most of the mod's features.
Huh, that is weird. I don't have strong PC and the only FPS drop I experienced is when I uncommented lower block for testing and spawned 20 npcs with flashlights who look at me all the time, although I didn't lag with this block commented out on my next try.
Can you describe when and where this happened? I'll take a look at it.
Sorry, my bad, I forgot to mention I increased NPC spawns quite a bit. I changed the npc_in_squad values in the squad_decr files. Increased numbers by 25-50% more, I increased it even more a few hours ago (+50-100%).
It happens everywhere. In the rookie village, with ~15 NPCs, after cleaning out the map, I lose about 8% FPS, other times more.
Did a quick test, which is not 100% reliable with such a dynamic game, but still it's info. With the mod fully merged, I get a very variable 45-50 FPS. Without it it tends to stay closer to ~53-55.
I think it's gets worse worse with more squad activity, I just did a quick test at the burnt house (in the swamp) at night.
I used WinMerge 2011 to quickly try a few combinations, and the biggest problem is visual_memory_manager.script. Reverting that to vanilla RC23 seems to bring FPS closer to ideal, but maybe still slightly lower than vanilla.
Turns out it's "distance to campfire" check that I added lately, really eats around 5-10 FPS when a lot of NPCs looking at you/each other and there's a campfire nearby...funnily enough it doesn't drop FPS when you are in the range of campfire that affect luminosity.
Something is very wrong with either campfire scripts or engine.
I'll turn it off for now till I figure out another way of adding them.
Lot of thanks for letting me know tho! ;]
Tried it quickly, it seems to be a much smaller decrease now. Features cost performance, of course :). I will play with it a little, but for now it seems the FPS is a slightly less stable with the mod, but nowhere near as much as before. Thanks!
Still? xd
Alright, I'll try to do something.
Like any truly dynamic game, the FPS oscilates slightly so it's a bit hard to get 100% accurate measurements.
It's a very small decrease now, maybe 1-3%, not something that makes the game hell. Doing AI stuff using scripts is probably going to cost some performance no matter what, I mean it's not native C/C++ code.
Despite of function running every frame (or so), I'm still not sure why it's so demanding for you, I thought lua is better at calculating that much. But I'll try my best to optimize for people with millions of NPCs ;p
Well, I'm sorry man, but I've been spawning 60 NPCs around me and testing every single block. I always get same FPS numbers as on vanilla, maybe -1 FPS at max with that many npc looking at me.
If you are sure that you didn't uncomment last block of script, or if you sure it's not other mods then I honestly don't even know how else to reproduce it.
I have a variety of mods merged, but I have no conflicts with the files your mod changes (1.3.5 Realistic).
It's really not a big deal, the AI is better and my perforamance decrease is very very small with 1.3.5 - worth it. Thanks for making and supporting the mod!
I did get one episode of NPC amnesia though - attacking the army outpost in the swamp with an unsilenced SVD from the little wooden fences on the hill to the east. Killed a few soldiers, then the few more kinda just sat down over the corpses of their bros :)
This was the only time I had this happen, but will report if it happens again.
EDIT: Just noticed you posted an update, I was crouched when that happened :)
Mora's no amnesia mod only prevents them from forgetting about you after 15 seconds if they lose vision. If they didn't see you before (i.e. distance too far) they'd just sit around in danger state instead, this is unfortunately "normal" behaviour in this game and probably need a lot of changes in other scripts (maybe engine) to fix;[
Something i noticed since i downloaded this addon:
- Enemies that are far away will stare at you for long periods of time without doing nothing. they will stare even longer if you are in the shadows.
will PM in disc.
Upd: So apparently NPCs reset threshold everytime actor leaves their vision, even during combat. We don't notice it in vanilla because the main equation variable is based on frames (always high), so other factors aren't very significant. Was a little bit more complicated to balance it out in my mod.
Should be much better now and thanks ;]
Nice work!
Did you change Mora's mod or just include it? Because his latest version includes a newer xr_combat_ignore script. Can I update it or does yours include some necessasry changes?
EDIT: Well, the only difference is that yours include a higher value for rnd. I guess it's up to personal preference.
Included.
xr_combat_ignore.script haven't really changed much, only maximum random time, you can change it if you want. xr_danger.ltx I already updated to his newest.
Nice! What about if I already have the NPC whitout amnesia mod? Just overwrite?
Yeah
What's up with updating every 5 mins in the past 15 mins or so?
Small adjustments, 1.5.9 will probably be final version.
Okay, thanks, is it safe to just paste new one over previous version?
Yep
Lol bet you that other guy is gonna re-release his with working campfires in a day or 2....
Hey, will your mod work together with this, considering the further light ranges?
Moddb.com
In terms of luminosity it's gonna work as flashlights are still 25m, just add *2 at the end of lines 60 and 70 in visual_memory_manager.script
Would it be possible to have grass and foliage hide the player based on Grass Size? Or is there something with the base detection implementation that prevents that?
To my poor engine knowledge I think it would be very hard to implement even for devs. Foliage sounds easier but I'm not sure I can do it in game files.
Since those are 2D, the AI does not have blocked vision. Same with shrubs and tree leaves. That is an engine issue.