NPCs now react properly to sounds/visuals/hits. Port of Dead Air's xr_danger that is fixing utterly broken xr_danger from Amomale.
I beg you, read description before asking nonsense please.
Okay, since every second person asking about AI, please READ THIS:
-
This addon just fixes the danger system (how NPCs react to different sounds/visuals/hits).
-
Values for distance/time are from Dead Air. If you don't like them - change. This isn't the goal of addon (goal is #1).
Explanation of what was wrong in vanilla Anomaly's system and is fixed in this addon (don't copy anything from these examples)
Code example (in human language):
Messed danger types, i.e. when you walk behind a wall - NPC should be in danger state from "sound" type, which generally has lower distance to hear and time. BUT, in Anomaly walking can sometimes trigger a "visual" type, which has higher distance and time. Therefore it can lead to bugs when NPC hear your footsteps from a very long distance. And it happens for all 3 danger types, which to me it seemed, are picked randomly. This is just one example.
Config example:
So, the [danger_inertion] here is time in miliseconds and [danger_object] is distance^2, yet they for some reason have same values...
I don't think I need to explain further xD
Changelog
0.3: Thanks to Longreed, NPCs now react correctly to the bullet ricochet near them. I kept only 100 meters for friendly NPCs, hope you don't need it ;p
(Turns out that something broke after the system port from engine and now distance has to be not from bullet, but from source (object), but it still triggered only when bullet is near, so everything should be fine.)
0.2: changed "attacked by player" reaction value from 0 to 300 meters (don't know why DA's was set to 0).
Is this like the recent SearchLogic mod that makes enemies run instead of stand still when shot at by snipers?
I didn't really try SearchLogic addon ;]
This one just makes the default script to work as it's intended. It's not adding anything new, it's just fixing it.
1.5.1?
Any.
Wondering how this works. For example this addon file has (danger object) ignore distance for grenade as 400 instead of 40000. What does that mean? they dont so easily react to close by grenades? or that they react grenades even further away than normal?
And how about bullet_ricochet = 16 instead of 2500
Squared distance at which NPC will react to the grenade near him, 400 is 20 meters radius.
I did not change these values (they are from Dead Air).
So now with this addon they DONT react to grenade that is e.g 25 meters away?
Now with this addon they DO react correctly to whatever you set there xd
Afaik "grenade" here is visual, i.e. the grenade that landed near them, not its explosion or explosion sound (which counts after).
These numbers here are not the main point of addon. But just as comparison, in Anomaly this value is 40000 which supposedly makes NPCs to react to grenade that landed 200 meters away from them (and didn't even explode yet).
Alright I'll add another example as the goal of this addon in the description ;]
Is there a way of making NPC actually react to a bolt landing near them, to make them move away? It'll be good for stealth!
Uhm, don't know.
Yeah will be funny...
if the bolt had a unique landing sound -regardless of surface- it could be ogg-commented as "weapon", so NPCs should react. That's for the sound.
For the visual, different story
Which makes me think, it would be cool if in the bolts slot you could place junk items/weapons/etch just so you could throw them to create distraction.
Or create dummy-grenades...
..and play fetch with blind dogs :)
someone should actually fix the aimbot grenade combo npcs have, maybe adding a script that does randomize the actual aiming when throwing grenades towards you
Can you please give an example of what the mod will actually do? I mean, i can probably guess what will happen, but i don't think that i am sure that i know what this fix will do. Please, can you give some in-game examples of how NPCs reacted to some things without and then with your mod? It looks like a very nice addition, but it is has rather unintuitive description...
I'll add to description an example of what exactly it fixes at the code side.
Ok, thank you!
I wasn't sure people will understand it and hoped that messed up .ltx file will be enough as an example, but... don't think anyone get it xd
Are you telling me that now when I miss a shot next to an NPC or kill his friend right in front of him, he won't mind his own business like "oh look at that Mike, a bullethole appeared on your face and you're laying on the ground. You lazy bastard, get back up or I'll take your stuff."?
Yep, something like that xd
hi bvcx,
How this compares to your Stealth addon? Would both of them work together? Or it's a simpler change? Or these files would enhance the overall stealth experience?
So many questions
Since Stealth does not have xr_dangers in lattest updates, it won't overwrite anything. And yeah I think it should enhance it.
how does this differ from kebab's NPC overhaul mod (it edits the same file and some others) SORRY for the complete lack of knowledge on this topic lol. for me as a user want to know if it's better to abandon kebab's NPC overhaul and use this instead?
I can't explain it better than description does already.
But, for the 10th time: it does not overhaul anything, it just fixes a vanilla script that doesn't work as intended ;]
Just try it guys. Now when you shoot the ground anywhere near an npc, they'll alert and move around , search and move in cover.
Why don't they react to gunfire even when hit?
Hm, for some reason dead air had this turned off when attacked by player.
[danger_object_actor]
attacked = 0
Change this to 90000 or update addon, gotta be fixed now.
I always enjoy your contributions bvcx. :)
Been playing with this for hours now (with & without the danger_object_actor tweak), and it just makes the enemies blind and deaf. Almost like turning off their AI. if you want easy game with blind enemies use this, but if you dont... well, yeah. Not my cup of tea
fixed
What? xd
I think you installed something else.
nah it is/was this one, loaded last on the load order. Dunno if this new update (0.3) could help with the issues
0.3 changes only bullet ricochets.
I'm really tired of explaining, but ok:
- This addon makes the danger system to work as intended;
- Intention isn't to make AI easier/harder, it's to just make it work correctly;
- If you feel that it does not fit you, try to change values in ltx (it will actually now work and make difference).
- I'll add this to my Stealth addon after testing and tweaking values to fit the addon.
Hello, I already have the "xr_danger" file in my "gamedata/config/ai_tweaks" that I do not know which addon added it. To manually modify the values in the file that already exists in my folder, Is it enough with the values that are seen in the image of the description? Or are there more values to modify? Thank you very much in advance (Anomali 1.5.1)
Man, it is written that the description is an example of messy Anomaly's values...
Newest update has xr_danger.script.bkp2 file? is it the original file that was not working or...?
Uh, wops. It's the one for testing (spams console with info), forgot to delete. Just keep it, it does nothing in the ".bkp2" format.
I'm really glad how people skip description, go straight to installing, expect a great enhance for AI and NPCs with 200+ iq... then ask some nonsense and downvote when it's not what they expected xd
Once again, this addon is essentially a vanilla bugfix and that's all.
Это на мутантов распространяется? А то надоело уже, когда хотя бы один мутант увидит игрока, то сразу все мутанты со всей локации стекаются к игроку (типа: мутант по рации сообщил:(), как будто он самый злостный нарушитель и его во что бы то не стало нужно уничтожить. На NPC мутанты так не реагируют, они сражаются только с текущими мутантами, когда мутанты, находящиеся в 100 метрах от них, спокойно разгуливают по локации.
Это для всех насколько знаю. Мне кажется ты немного про другое, попробуй найти в конфиге мутанта "feel_enemy_who_just_hit_max_distance", это дистанция при которой когда ты в мутанта стреляешь он моментально понимает где ты. Я лично без нее играю, не очень нравится ("1" выставил).
Попробую, однако я говорю о том, что достаточно хоть одному мутанту меня увидеть, хотя я в него и не стрелял даже. Но если стреляю с глушителем, то мутанты пока меня не увидят, не бегут ко мне, только хаотично бегают.
P.S. Ну я конечно switch_distance в alife.ltx выкрутил по беспределу, по-этому вся локация и бежит ко мне.
This comment is currently awaiting admin approval, join now to view.
Could you give an example of what situations this would fix versus what would normally happen in Anomaly?
It's hard to tell what and how something gonna work different from vanilla, because vanilla picks a random danger type sometimes xd
In two words, you can now change values in xr_danger.ltx and expect them to work as you want.
now they react wisely to nearby shots wtf , is epic dude
I've got that:
Expression : <no expression>
Function : CScriptEngine::lua_error
File : ..\xrServerEntities\script_engine.cpp
Line : 191
Description : fatal error
Arguments : LUA error: ...maly_bas-1.5.1.2/bin/..\gamedata\scripts\xr_logic.script:491: attempt to call a nil value
stack trace:
It happened after I entered Garbage and killed 3 cats near the swamp, looted them and got thrown out.
However, like your fix; thanks for the work.
Can't say for sure if it's mine, seen this crash a lot even before this addon. Full log in discord after a crash would help if you can ;p
I see this crash in my actual playthrough, and i do not use yet your addon..i do not understand what it is because no addon i used modified this script, bur surely an addon call some functions in it. Maybe Stealth, but not sure...i was stealthy for each crash.
can they still react to the sound of a silencer from a far distance?
Don't know, almost all of "who reacts to what exactly" code is in engine and I can't read most of it ;[
Что-то действительно NPC стали часто застревать у костров, шанс примерно 30%. Специально сохраняюсь радом с врагом, который сидит у костра, начинаю атаковать, двое из трёх моментально реагируют, один встанет и потом стоит, ничего не делает. Перезагружаю сохранение и опа, все теперь нормально разбежались по укрытиям. И ещё, как-то быстро и легко арену прошёл, NPC тупят конкретно. Раньше самый трудный турнир с шестью бандитами был, они конкретно меня прижимали, а сейчас перестрелял их поодиночке, пока они бродили по арене.
Как я понял NPC сейчас почему-то не могут определить откуда выстрелы идут, хотя я без глушителя стреляю, просто бегают туда-сюда, ищут наверное. Только когда заметят, тогда уже начинают ломиться ко мне.
Да, и на гранату тоже по старинке реагируют, то видят её и разбегаются, то сидят дальше у костра, хотя граната им под нос прилетела, ну и потом разлетаются все трое в разные стороны.
Также один раз видел, как военный после того, как я пристрелил его товарища, пошел шманать тело. Стрелял с глушителем, но тем не менее... Дело было на Агропроме, где у проходной в военную базу сидят возле костра трое сослуживцев. Так что все косяки игры присутствуют и с этим модом.
P.S. Возможно авторы не случайно не исправляли эти баги со скриптами и ltx потому, что NPC начинают тупить больше, и из-за этого становится легче играть.
А, забыл сказать: ещё установлен ваш мод на стелс, может он как-то влияет.