Immersive NPC in the dark

Skyrim Mods |

Immersive NPC in the dark

This mod makes NPC more immersive in the dark, they will use various light sources to see their enemies and they will alter their combat behaviors when they can’t see their target.

Immersive NPC in the dark
version 0.8.2 BETA

I love lighting mods that make Skyrim darker (RLO and ELFX), but i hate seeing NPC behave like they all have some sort of nightvision, they can hit me even in the dark while i struggle to spot and hit them.

This mod will make those NPC have difficulties seeing and fighting in the dark and they will carry/use their own light sources to overcome these difficulties.

Not all NPCs will have these behaviors, undeads and those that has nightvisions are more than happy to fight you in pitch black dungeon, you will still need to use night vision or just wield your torch to fight them

Here is a video that shows some of features in version 0.6 (it’s the older version of this mod, some features has been re-tweaked) (thanks to brodual for making this awesome video)

Features
The main purpose of this mod is to make almost every humans, orcs, and elves in the game behaves differently in the dark by making them use various light sources and/or limiting their combat capabilities. Not all of them will have these behavior and limitation, you can read here for the full list of NPC that are excluded by this mod.

Out of combat behavior
NPC will use torch or lantern to see in the dark, most of them will prefer torch over lantern.

NPCs will use light only when they think it’s necessary, e.g: they will not use it If someone around them has already used one.

There are a lot of other things that are taken into consideration in deciding whether to use/not use a light source, all are done in order to make them more believable and minimize light usage in a very crowded places.

Searching Behavior
When NPC is alerted, they will search for their undetected enemy, usually by going to a certain area that draws their attention.

While they are searching, each NPCs in different directions will usually turn their lights on so that they can see better and able to detect their enemy. Thus, each search party will usually have one
person at the front using a light source.

Once an enemy has been detected, there is only one thing that matters to them, it is whether they can see their target or not.

Combat behavior
NPCs prefer to not using any lights in battle, they simply don’t want to be seen, so if they can see their target they will have no reason to keep their light on and charge at their enemy from the dark.

Usually a battle ends up with one melee fighter closing in using lantern/torch, while his friends turn off their lights and attack their target from the shadow. A light bearer has a responsibility to make sure the target can be seen.

When the light bearer dies, he will throw his torch at his target at the last moment of his life. If the enemy still can’t be seen, a new Light bearer will arise to replace his dying comrade.

Archers behavior
After losing sight of their target, Archers (bow and crossbow users) will shoot one or maybe two arrows and then either hold their current position or just go full-melee and search their target.

Mages behavior
Mages usually cast candlelight in battle even if he/she has already seen the enemy, Candlelight is very bright and cover a lot of ground, it acts as a beacon for their teammates so that they don’t have to use light anymore, one candlelight is enough to light up a cave.

Difficulties in turning torch and lantern on

For NPC, turning on lights in combat is way harder that it is out of combat, especially when they are very close to their target, at the very least, they will have to turn the light on and reequip their weapon.

In the heat of battle, things can happen, sometimes they forgot to reequip their weapon after turning on their light, they will punch their target once or twice before they can think straight again and use a proper weapon, some may even stay unarmed throughout the battle.

Overly excited NPC around you may get tripped over while whipping out their lantern/torch, they may even loose grasp of their weapon which forces them to either fight bare handed, or pickup their dropped weapons. NPC will hardly ever get tripped in battle, but once it does, their opponent can usually kill them while they’re trying to get up.

Configurable
Several aspect of this mod can be configured through MCM (you need to have SkyUI installed to do this). I do not put everything in there mostly because of performance or maintenance reason, i will probably add / remove some options before version 1.0.

Special NPCs
Carriage drivers will never use torch, they only use lantern, and will keep it on most of the time.

Beggars will never use light in the city they’re in, but they will use one in combat ! those beggars are just pretending to be poor and can’t even afford a cheap torch while they can actually buy and use endless supplies of lanterns.

Assassins are the opposite of beggars, they will use torches/lanterns just like other NPCs, but once they’ve entered combat, they will turn their light off and use their night vision to fight in total darkness.

Who are these assassins ? They are Dark Brotherhood members, some people in Blackbriar family, and any custom NPC that has CombatAssassin class.

Requirements
Skyrim version 1.9.32 or later
SKSE version 1.6.16 or later
(Optional) SkyUI 4.1 or later
(Optional) Any mods that makes Skyrim darker

Installation
Download with NMM and install, or manually download and copy it to your Data folder
Put this mod anywhere in your load-order, it doesn’t matter
Play the game, you should see notification on the top left corner that this mod has been installed

Uninstalling
Use NMM to uninstall, or manually delete the two files.

As this mod is a script mod, Save game script cleaner is very very helpful in cleaning your save game after uninstalling this mod.

Upgrading From 0.8.* to 0.8.2
Save your game in are that has no people around you (e.g: in wilderness or an empty house)
Replace the old files
Load your save game and you will see notification at the top left corner of your screen that the mod has been upgraded to 0.8.2

Upgrading From 0.7.* to latest version
I do not recommend upgrading from 0.7.* to the latest version, it’s better to just re-install the mod and load from a clean save game, it’s because the code base are totally different while still using the same FormID from previous version.

But if you really still want to use the save game, here are the steps (thanks to looooots for testing this out)

Uninstall the previous version
Load the save game
Play the game for a while, save the game, and quit
Use Save game script cleaner to clean your save game, make sure all scripts that have _NUL_ prefix are deleted
Install latest version
Load the save game, you may find some NPCs not having the behaviors from this mod, but they will regain them after sometime

Compatibility
Technically, this mod is compatible with any mods out there, because it doesn’t modify any master data at all.

These are some mods that the good people in the posts have tested :
Requiem
Immersive Spells and light
SkyRe
ASIS
Improved sneak detection
Duel: Combat Realism
Lights up the night, people use torches *

* I do not recommend using this mod with Lights up the night, my mod ignores NPCs that already has torch in their inventory, and since Lights up the night adds torches to bandits and villagers, my mod will have nothing left to do.

Changelogs For version 0.8.2
Fixed bug where oncelldetach function waiting for mutex to be unlocked before removing torch from NPC, which result in frequent invisible torches
Fixed bug where people use torch simultaneously out of combat, it also fix fast light switching because of hasty decision in turning light on, things looks better now out of combat
Fixed bug where torch user reequips weapon twice upon entering combat/searching mode
Fixed bug where torch user drop 2 torches upon death
Fixed bug where NPC turn off their light while running from one location to another
Fixed bug where NPC still use torch/lantern after moving from exterior to interior

You can read the full changelogs from previous version, here.

Non critical Bugs
[*} NPC may failed to respond to time and weather changes if the cell they’re in never gets detached (e.g: the player staying in one place for too long and/or the uGrids is above normal)
Archers aren’t waiting anymore, they immediately switch to melee and charge the unseen target.

This mod is still in beta and it affects almost all NPCs in the vast world of Skyrim, so there bound to be bugs here and there. If you like this mod, please help me beta-test it and report any bugs that you’ve found in your test , even if it’s just a small annoying things.

Frequently Asked Question
Q: How does this mod affects sneaking ?

Having more lights equals harder sneaking. Unless you are using mods that removes lights from the detection formula.

Q: The enemies are so nerfed they’re not challenging anymore, is this intentional ?

This mod aims to make NPC more belivable in the dark, and nerfing them is one of the method that i’ve chosen, so yes, they will be a bit easier to beat; But, if you’re used to seeing people using torch/lantern, you’ll be having a hard time fighting khajits, falmers, spiders, assasins and others who can see in the dark.

Note: If you’re asking this question while still using vanilla difficulties in Skyrim, please do yourself a favor and install mods that make Skyrim a lot more challenging.

Q: Does this mod conflicts with other mod that changes combat AI ?

NO, combat AI is not something a modder can change, we can only change its parameters, interrupts it to run an AI package, issues very limited set of commands from script to alter their behavior, or listen to events sent by the game such as when the NPC is hit or things like that.

This mod only controls light source usage and do a bit of commands to the AI at a very specific time, place and condition. It doesn’t change any master data (including AI packages) at all, so it should be compatible with other combat AI mods.

I’m developing this mod while having SkyRe intalled, SkyRe changes a lot of aspect of combat, and they both run without any problems or glitches.

Q: How does this mod affects performance ?

This mod doesn’t add excessive lights (e.g: not adding torch to all NPCs), so the strain on rendering is minimal. But this mod runs a script on every valid NPCs in your area, each will run the script until they are detached from their cell. The script behaves like a vampire, it’s active in dark places (dungeons, night time, bad weathers), and hibernate in daylight or bright interiors.

The script doesn’t do extremely fast heart-beat updating, only one NPC at a time executes the heavy light distribution algorithm. It runs even faster in combat since they will rarely use the algorithm (their main concern is their combat target’s light level).

Anyway, my laptop is an outdated one, it has a medium-end graphic card and a somewhat decent CPU; And i don’t experience any drop in frame rate while using this mod even in Solitude’s busiest hours.

Q: How can i make skyrim darker ?

There are plenty of mods and ENB presets on Nexus that can do this. These are some that i have tried :
Realistic Lighting Overhaul
Enhanced Lights and effects
RCRN AE
Realistic Nights
Climates of Tamriel

Be careful if you’re using Climates of Tamriel, its darker night and dungeon modules achieves darkness by making all lights dimmer (it’s like you’re playing using a very dark sun glasses). But the good thing is, CoT is very compatible with other lighting mods, you should mix and match them to achieve the level of darkness that you want.

Troubleshooting
Texture flickering in major cities

Some people (and me) experienced a certain rectangular / triangular area in the cities that refuse to render lights from torches when they’re seen at a certain camera angle.

It’s less noticeable in vanilla, but sticking out like a sore thumb in custom major cities exterior mod (e.g: RLO major city exterior). This is a very annoying thing to see and i hope bethesda would fix this in later version.

If you also experience this problem, please untick Enable in major cities option in MCM. If you are not using MCM, you can open the console using ~ and enter this command:

set _NUL_gEnableCapital to 0

This doesn’t instantly makes NPC turn their lights off, you need to get out of the city for a little while before the changes kicks in.

Depending on your current installed lighting/weather mod, this will make citizens walk like they can clearly see their path in pitch black night, and if you can’t tolerate this, you can use either Lantern of Skyrim mod or ELFX exterior modules which adds some nice light sources in various places.

Brawlbug patch

I added brawlbug patch scripts in my mod. There are two types of fixes to brawl bug, the one without replacing vanilla script is not feasible for this mod, so i use the other one.

Mod organizer will mark them as conflicts with other mods that also added these scripts.

I could have separated the brawlbug scripts in another file, or make brawlbug plugin modder resource as one of the requirements, but since i see a couple of mods adding these scripts in their mod, i thought it’s a common practice so i added them too.

You can replace these scripts from those contained in other mods, it doesn’t matter as long as they fix the brawl bug.

Credits and Permissions
Chesko for his cool wearable lantern meshes and effects
Vixenfinder for the lantern texture

Special Thanks
Thanks to these wonderful people who has given me support, feedback, ideas, and/or bug reports

Chesko, MotoSxorpio, Nizuma, brodual, Dkboy24, Ripster, saqk , ArtMurder, GMulryanm kujoe, Sondermann, xpatonsonx, alantern, looooots, atlashrug, tonycubed2, filimon 666, oqhansoloqo, devondaman, shaiwan, zekafonss, DJ_Supra, sppphy, and lots of others that has helped me which i may have forgotten

TODO: add some more beta testers, you’ve all been really helpful …

Disclaimer
THE MOD IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE MOD.


Author: hacknpaint
This content was uploaded by website visitors. If you notice any mistake, please let us know.



Useful Information:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *