Jump to content
Sign in to follow this  
s_Hole

fixed range nightvision

Recommended Posts

i'm sure many of you have come across this and have got frustrated;

without nightvision:

plain.jpg

ahh, a nice night out.. a bit dark though

original BIS nightvision:

original.jpg

hmm.. better, but still can't really see anything

S_NVG:

newnvg.jpg

SWEET JESUS!  ALARM!

so what this addon does, is disable the HDR engine when nightvision is enabled

the way the original is, it renders the entire nightvision unusable if there's a single light source in the picture

it's damn frustrating

now, the nightvision is locked to a single brightness level

when it gets brighter, it gets burnt out as white(or bright green rather) on the screen, as you can see from the car lights on the right above

i have no idea how this would play out with multiplayer, so i suggest you place it at an addonfolder reserved solely for singleplayer play

using this addon online should be concidered cheating

Gameplay notes:

-The NV sensivity is set by default to 1.5, which is good for most nights of the year.

-You can adjust the sensivity by PageUp and PageDown keys.

-You can switch the game's stock automatic nightvision adjustment on and off from your action menu. It is disabled by default.

installation notes:

1. unzip the addon to your addon folder

2. play

download: S_NVG v0.5

history:

v0.1: initial release

v0.2: a number of issues fixed;

- no longer conflicts with BIS' nvg.. you no more have to unassign the key.. the addon automatically deals with this

- cleaned up the code some.. it actually makes sense now

- eliminated the hack delay when taking off the nvg

- made it slightly darker.. it was oversensitive for most nights

v0.3: what it was supposed to be!

- extended eventhandlers -> now works in every mission (including QG) thanks to Manzilla for helping me and sickboy for helping him

- added an action when nvg enabled to switch auto-adjust on and off

v0.4:

- no longer conflicts with GMJ_SightAdjustment nor SightAdjustment_AutoInit (many thanks to i0n0s)

- fixed issue where script ran for every npc, which was dumb

- vehicles should work properly now

- death, teamswitch and some other issues are addressed, but not foolproof

- other stupid bugs i squashed but can't remember anymore

- added keys to change NV sensitivity (page up and page down)

v0.5: hotfix release to resolve some pressing issues

- key assignments survive a savegame

- no longer leaves action on old character on teamswitch

- autoadjust action isn't echoed at the center of the screen anymore (distracting)

plans for v0.6;

- multiplayer support?

should probably be required for all

if somebody tells me what is needed, i'll add it

i don't play multiplayer so it is not a personal priority

- moved keydown event over to it's own addon, which will be required from now on

- this will allow configuration of addon from a text file and futureproof compatibility, if other addon makers adopt the key event addon

<span style='color:grey'>- automatic adjustment by date and time</span> - do this if you want to.. the code i started is inside the .pbo

- is there anything else i should change or add?

Share this post


Link to post
Share on other sites

Goodness! Thank you so much for that! Trying it out asap!

Share this post


Link to post
Share on other sites

Looks excellent. Maybe some people can give their view from a realism perspective as well?

Share this post


Link to post
Share on other sites

Hi,

I only took a look at the code:

Please use extended eventhandlers for the init.

Please init S_NVG_nvgOn at the start of the init-script with false. This will remove some isnil from your code.

In the init.sqf replace codeline 5 with the following

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">S_NVG_KEY = actionKeys "nightVision";

and in keypress.sqf codeline 6 with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (_PRESSEDKEY in S_NVG_KEY) then

S_NVG_KEY will be the keys that activate nightvision, so that you don't have to bring out different version.

Oh, please transport keyspressed to your namespace and introduce all local vars with private.

Keep working on it! The pictures are real nice.

Share this post


Link to post
Share on other sites
Hi,

I only took a look at the code:

Please use extended eventhandlers for the init.

Please init S_NVG_nvgOn at the start of the init-script with false. This will remove some isnil from your code.

In the init.sqf replace codeline 5 with the following

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">S_NVG_KEY = actionKeys "nightVision";

and in keypress.sqf codeline 6 with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (_PRESSEDKEY in S_NVG_KEY) then

S_NVG_KEY will be the keys that activate nightvision, so that you don't have to bring out different version.

Oh, please transport keyspressed to your namespace and introduce all local vars with private.

Keep working on it! The pictures are real nice.

+1. Very important!

This looks very promising wow_o.gif

Share this post


Link to post
Share on other sites

great

thanks

the code probably looks awful.. i just got annoyed when i couldn't get it to work proper and didn't clean it up that much

i'll probably look into it tomorrow some

edit: i can't use actionKeys as the addon conflicts with normal nvgoggles if they're activated simultaneously, effectively breaking eachother

unless if it's possible to disable the normal nvg, in which case this would be quite optimal

Share this post


Link to post
Share on other sites

Great work dude - this is an excellent way to fix what is definitely a problem with the BIS NVG! smile_o.gif

Share this post


Link to post
Share on other sites
edit: i can't use actionKeys as the addon conflicts with normal nvgoggles if they're activated simultaneously, effectively breaking eachother

unless if it's possible to disable the normal nvg, in which case this would be quite optimal

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player action [""NVGOGGLESOFF"", player];

You already used that code wink_o.gif

Share this post


Link to post
Share on other sites

that's a failsafe for something else

regular NV is still executed, but after mine

and it functions as a toggle, turning mine off

*looks at code*

coming back to this now, i can't but wonder what i was thinking when i wrote this

either way

the main issue for me was that it didn't work in every mission

like not at all in QG, which was my main frustration/inspiration in the first place

Share this post


Link to post
Share on other sites

It sounds wonderful, I'm going to watch this thread till a later version comes out, so its a bit more 'compatible' smile_o.gif .

Share this post


Link to post
Share on other sites

Oh yes indeed, this is a problem I noticed too with NV. The light source darkening EVERYTHING ... annoying then your running to get cover and the sky will dip the NV so you cant see where your running and have to look at the ground just to get the brighness back ... crazy_o.gif

Realism can take a back seat if thats how it works because in my mind its not very good for a PC SIM (as apposed to reality).

Anyway ... this is a superb fix, although as previously stated, get it XEH compatible and I will grab this right away!

Keep working on it, try searching out the hardcore modders and PM them for info, especially the XEH guys.

Share this post


Link to post
Share on other sites

yes, the main reason for posting this was to get help to fix my shortcomings as a newbie arma modder

i'm kinda bummed arma.info posted this in it's unfinished state

any help is welcome

Share this post


Link to post
Share on other sites

Very good decision to release it!

It's a very needed addon, because the default nvg effect sucks(sorry)!

At all you professional scripter out there, HELP this man to get this addon final!

Thanks!

MfG Lee wink_o.gif

Share this post


Link to post
Share on other sites

I am going to assume that you are not aware of this fact, since you have said you are not familiar with real nightvision systems.

On real NVGs, the lens cover typically has a tiny pinhole in it. This allows for the NVG device to be used in full sunlight. Because of this, your example of 0430 "whiting out" the NVGs is pretty much the exact opposite of realism. An NVG user in that situation would simply put the lens cover onto the NVG device and continue operating. Really, though, the point at which the NVGs become unusable without the pinhole cover is likely to correspond with the point at which the person could take their NVGs off and operate normally.

I think that there is some merit in working out a system to make the NVGs not suffer so badly from the moonless/overcast situation where light sources cause them to over-darken. However, I don't think that it's a good idea to disable the HDR effects entirely.

Share this post


Link to post
Share on other sites
Quote[/b] ]I am going to assume that you are not aware of this fact, since you have said you are not familiar with real nightvision systems.

My first thought when seeing this was "oh boy, someone made a modification that made the game easier and called it an improvement." Very rarely do mod makers actively pursue a decrease in equipment performance when making a mod.

However I think we can all agree that the BIS night vision devices are a bit bunk in their auto adjust. It seems like the light sampling for the HDR aperture adjust is one-point sampling and very sensitive and more than happy to go to extremes. A real PVS-7 can't really be this way, probably taking in total light volume as it's auto-adjust parameter.

Share this post


Link to post
Share on other sites

new version

see first post

the code is mostly rewritten from it's awful proof-of-concept state

.cpp is still completely unchanged as i couldn't get extended event handlers to work (newbie arma modder still)

Share this post


Link to post
Share on other sites

again and again

one side goto the the extrem and the other goes to theirs

couldnt we just find a place somewhere in the middle, sit down and acturally do something that works both ways??

Share this post


Link to post
Share on other sites

It sounds like he's planning on it, just hasn't figured it out yet. I could be mistaken though

Share this post


Link to post
Share on other sites

new version

fixed everything

XEH and all

comments and suggestions?

Share this post


Link to post
Share on other sites

good job s_Hole smile_o.gif

You need to adapt the setAperture value depending on date, time

and island location.

Share this post


Link to post
Share on other sites

possibly..

but i rather like it that it becomes useless beyond a certain point - but you're better off without NV at that point anyway

we'll see

i just found a mission that it doesn't work in, again

*dies*

Share this post


Link to post
Share on other sites

I'm sorry, but your config is not right now. Your starting your script for every men on the map. You have to make sure that your script starts only once:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

{

class S_NVG

{

units[]={};

requiredVersion = 0.1;

requiredAddons[] = {"Extended_EventHandlers"};

};

};

class Extended_Init_EventHandlers

{

class All

{

S_NVG_Init = "if (isNil ""S_NVG_Init_Var"") then {S_NVG_Init_Var = [] execVM ""\S_NVG\init.sqf"";};";

};

};

That should be the required config. Nothing more will be required.

init.sqf: Lines 34 and 35 are identically.

Then a general question:

What happens if player dies when having nightvision on?

And while playing in editor I haven't found a point were my nightvision (without autoadjust) got to dark confused_o.gif

Share this post


Link to post
Share on other sites
I'm sorry, but your config is not right now. Your starting your script for every men on the map. You have to make sure that your script starts only once:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

{

class S_NVG

{

units[]={};

requiredVersion = 0.1;

requiredAddons[] = {"Extended_EventHandlers"};

};

};

class Extended_Init_EventHandlers

{

class All

{

S_NVG_Init = "if (isNil ""S_NVG_Init_Var"") then {S_NVG_Init_Var = [] execVM ""\S_NVG\init.sqf"";};";

};

};

That should be the required config. Nothing more will be required.

init.sqf: Lines 34 and 35 are identically.

Then a general question:

What happens if player dies when having nightvision on?

And while playing in editor I haven't found a point were my nightvision (without autoadjust) got to dark confused_o.gif

If your talking about BIS NV going to dark, you have GOT to be kidding me. Refer to his pictures and thats my NV is like always, could be certain monitors but there was no chance in hell I could see any of that huge army he placed... so it would definetly be an improvement. wow_o.gif

Share this post


Link to post
Share on other sites

Unfortunately the player does not have control over NV autoadjustment while beign in vehicle. Brighter NVGs mean blind Shilkas.

Also - could "toggle" be replaced with "on"&"off" or "average"&"brightest" captions?

Great job!

Share this post


Link to post
Share on other sites

that config example doesn't work

lines 34 and 35 were identical on purpose.. there was a rare case nvg didn't turn off earlier without having it twice

might be useless now that i've changed it around so much

i totally forgot about death

i guess the aperture setting is stuck until something touches it

i'll have to look into it for the next version

if you're looking for a bit where the stock nvg is useless, try the camp mission in the QG campaign

or set time to night in editor and place a civilian car with lights on somewhere in your view

doesn't even have to face you

my example pictures would be even brighter with the stock nvg than mine, if it wasn't for that small car with it's lights in it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×