Help with nightvision/tech goggles fix

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Help with nightvision/tech goggles fix

Postby badmojo » Wed Apr 06, 16 7:40 pm

Hey,

If anyone is there to help me on this, much appreciated.

What I'm trying to do is make the Tech Goggles actually work, as in increase the brightness/contrast/gamma as it should have done since deus ex's release.

I have managed to create a "light glow" around the player which looks great in use.. but it renders the whole reason of using "night vision" as it removes the shadows and puts you in clear sight of the enemy.

This is probably the wrong way to approach this as i initially wanted to increase the brightness and preserve the shadows.. but that can also create a problem with the fact that it probably wont let you see in pitch black areas (the vents when saving the hostages in battery park for instance).

So, my questions are:

1. Is there a way to increase the brightness, contrast and/or gamma temporarily through unrealscript?

2. Is it possible to preserve what the npc detects as a shadow whilst using my version of the nightvision effect? (best way i could phrase this question with my knowledge)

3. Whats the best way to approach all this?

Thanks to anyone who replies :)
User avatar
badmojo
Newbie
 
Posts: 6
Joined: Wed Apr 06, 16 7:11 pm
Location: Australia

Re: Help with nightvision/tech goggles fix

Postby Allan » Thu Apr 07, 16 10:34 am

You can increase the gamma in-game, I believe. The only caveat is that if you leave the game with the goggles on, you may have to reset the brightness back to normal. You'd need some of this;

Code: Select all
// in your global variables:
var float savebright;

// Somewhere in your activation code:
   savebright = float(player(Owner).ConsoleCommand("get ini:Engine.Engine.ViewportManager Brightness"));
   player(Owner).ConsoleCommand("set ini:Engine.Engine.ViewportManager Brightness" @ 1.0);
   player(Owner).ConsoleCommand("FLUSH");

// and somewhere in your deactivation code:
   player(Owner).ConsoleCommand("set ini:Engine.Engine.ViewportManager Brightness" @ savebright);
   player(Owner).ConsoleCommand("FLUSH");


There is an alternative way to do this, but it requires entirely replacing the Tech Goggle's view window with a custom one of your own. You just layer two layers of modulated white over everything, brightens things up a treat.

As for your second question... I'm afraid not. Assuming you're creating a light source somewhere (even if it's inside you), it increases your character's visibility value. A similar effect is applied when you use the light augmentation.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Re: Help with nightvision/tech goggles fix

Postby badmojo » Thu Apr 07, 16 11:46 am

cool thank you, i didnt expect to get a reply to be honest, this is a big help.

That works a treat, although i did have to modify it a bit because it kept giving me errors with player(owner) so i changed it to just Player instead and that works as expected. But the issue still stands with the pitch black areas, is it possible to up the ambient brightness just a fraction?

I have already messed with the "light amp" window, to be full resolution rather than that pathetic little box in the middle of the screen, and have also removed the "ir red" border window aswell for the augvision so that it doesnt interfere with that. in addition to that i also changed the solidgreen to visualblue, so that it looks like the multiplayer version of augvision.

Now, my next question is about the colours. I could have this all wrong, but are these colours "solid red, solid green and visual blue" textures or are they predefined colour values set by the engine or defined in a *.uc file somewhere?... or even a header file now that ive found them?

again i might have this all wrong, id just like to know where these colours come from and if there are more?

Actually, better yet, is there a reference guide for unrealscript and anything deusex script related that i could study, most of the links to anything related to the old legacy stuff are dead.

sorry about the massive reply :P
User avatar
badmojo
Newbie
 
Posts: 6
Joined: Wed Apr 06, 16 7:11 pm
Location: Australia

Re: Help with nightvision/tech goggles fix

Postby Allan » Thu Apr 07, 16 2:52 pm

Ah, I didn't realise you had the Player variable defined, it should've been DeusExPlayer or PlayerPawn for the (Owner) things to work. It's been a long time since I've done much of this.

The colours in question are 8x8 textures in the Extension package. There's Solid, SolidGreen, SolidRed, SolidYellow, and VisionBlue.

As for a guide... There's not much of that around these days. There may still be things on https://wiki.beyondunreal.com/Legacy:Unreal_Engine that could help, but there was never a single resource that goes into great lengths on editing aside from... Tack's Deus Ex Lab. Which is sadly so outdated as to still talk about Deus Ex Mod Loader. o_o
http://www.offtopicproductions.com/tacks/ <- That's Tack's page, but if you're onto window editing you'll likely be past the level of most of the contents of that site anyway, sadly.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Re: Help with nightvision/tech goggles fix

Postby badmojo » Thu Apr 07, 16 3:50 pm

Ahh yes, everytime i see that page it brings back fond memorys of my teen days... i wish i could go back in time and be more apart of the old dxediting and such communities.

Yea im well past all the tutorials there, but as for programming in general.. I know how to "copy and paste" and make things function from a basic foundation of what Im trying to accomplish, then edit in any modifications that i want... if that makes any sense :?

But i definitely get lost in unrealscript, its soo.. messy and all over the place... I ended up creating a project in ms visual express, just so i could open all of the *.uc files at once and do a "find in all files" search for the definitions and where functions are used so that i could get a grasp of what i was doing and where i needed to make changes.

Aside from all of that though, im most prominent in c++, and thats where my knowledge in programming stems from, but would it be worth trying my hand at learning JavaScript, as ive seen on another forum that unrealscript is loosely base on JavaScript... Perhaps that would make my understanding of unrealscript a bit better. Any thoughts on this? I promise this is my last question :P

Thanks for your insight, i really appreciate the help and your time.


Purple night vision, here i come :P
User avatar
badmojo
Newbie
 
Posts: 6
Joined: Wed Apr 06, 16 7:11 pm
Location: Australia

Re: Help with nightvision/tech goggles fix

Postby Allan » Thu Apr 07, 16 5:08 pm

Yeah, UnrealScript seems to share the syntax of C-based languages, with object-oriented features of JavaScript. I'd say it'd be worth learning some Javascript, even if it's not something you use on a regular basis. It's got a lot of applications these days - you could end up coding rudimentary phone games with it if you felt so inclined! :D

You can keep asking things if you want, I'm sure it'd do some good to have /some/ forum activity here these days. Gives me a reason to have this place bookmarked for something other than nostalgia's sake.
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Re: Help with nightvision/tech goggles fix

Postby badmojo » Thu Apr 07, 16 5:48 pm

Awesome, ive got plenty more lol

So ive been playing with this nightvision thing, ive tryed layering white, but thats about the same as brightness... im starting to think that unless i can modify the level ambient brightness, im not going to be able to see in places where theres absolutely no dynamic light... im almost certain that if i raised the ambient brightness temporarily, ill then be able to raise the overall brightness using layering, so that it doesnt interfear with ini settings... the only way i know how to raise the ambient brightness though is in the levelinfo actor, i think, when making the map.

Im not exactly sure how the enemy detection system works, im hoping that its not an on off thing, so pitch black the enemy cant see you at all unless provoked, any kind of light will make you detectable and anything inbetween would be classed as 100% visible... Or is it based on percentage and the NPC's visible range... so for instance

At 0% light, No detection unless provoked

at 50% light, the visible range is half of its default range

at 100% light, the visible range of the npc is as far as its set to see

therefore if i only raised the ambient brightness about 5 - 10%, it would seem the enemy wont see me unless im right infront of him... at least then id be able to see in the dark, allow these tech goggles and the first level of augvision to function as i had expected it to back in 2001..

wow... its been that long... i cant nitpick anything about deus ex other than the goggles... as Rainier Wolfcastle said in an episode of The Simpsons "The goggles, they do nothing!"... and yet in that whole time, ive never seen a mod that fixed the issue.

btw... i know how you feel about nostalgia... its so sad how with all these new games, with all their fancy graphics, and post processing effects, with their bump mapping, hdr and all of this "new generation" crap, and the fact you goto be connected to the internet, and you cant just buy a disk that has the game on it ready to install and play without the need to download a bloody 3 gig patch on a 250kb/s connection, not to mention the limited amount of years youll be able to play it due the the fact that it connects to a server first and you need to be logged into some website to be able to play single player and then when the developers move on and stop supporting the game and all the servers shut down and then it relies on the modding community to "Hack" the game into working again, not to mention the fact that every game out now was created on a PC for a console then ported back to pc.. its a nightmare

Then theres the kids these days..."computers are too hard, thats why i have a console", "the graphics are shit so im not gonna play it", "theres too much reading", "its not cod".. and the one that annoys me the most "i dont know how to use a mouse and keyboard and im not willing to learn"...

i could rant forever.. but ill stop here lol

so yer, i know how you feel :lol:
User avatar
badmojo
Newbie
 
Posts: 6
Joined: Wed Apr 06, 16 7:11 pm
Location: Australia

Re: Help with nightvision/tech goggles fix

Postby badmojo » Thu Apr 07, 16 7:29 pm

Well... Ive come up with a solution.. its soo simple i laughed when it worked..

Code: Select all
//=============================================================================
// TechGoggles.
//=============================================================================
class TechGoggles extends ChargedPickup;



// ----------------------------------------------------------------------
// ChargedPickupBegin()
// ----------------------------------------------------------------------

function ChargedPickupBegin(DeusExPlayer Player)
{
   Super.ChargedPickupBegin(Player);
   
   //NEW=======================
   Player.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ True);
   Player.ConsoleCommand("FLUSH");
   //==========================
   DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount++;
   UpdateHUDDisplay(Player);
}

// ----------------------------------------------------------------------
// UpdateHUDDisplay()
// ----------------------------------------------------------------------

function UpdateHUDDisplay(DeusExPlayer Player)
{
   if ((DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 0) && (IsActive()))
      DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount++;
   
   DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = True;
   DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionLevel = 0;
   DeusExRootWindow(Player.rootWindow).hud.augDisplay.visionLevelValue = 0;
}

// ----------------------------------------------------------------------
// ChargedPickupEnd()
// ----------------------------------------------------------------------

function ChargedPickupEnd(DeusExPlayer Player)
{
   Super.ChargedPickupEnd(Player);
   
   
   //NEW=======================
   Player.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ False);
   Player.ConsoleCommand("FLUSH");
   //==========================
   
   if (--DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 0)
      DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = False;
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

defaultproperties
{
     LoopSound=Sound'DeusExSounds.Pickup.TechGogglesLoop'
     ChargedIcon=Texture'DeusExUI.Icons.ChargedIconGoggles'
     ExpireMessage="TechGoggles power supply used up"
     ItemName="Tech Goggles"
     ItemArticle="some"
     PlayerViewOffset=(X=20.000000,Z=-6.000000)
     PlayerViewMesh=LodMesh'DeusExItems.GogglesIR'
     PickupViewMesh=LodMesh'DeusExItems.GogglesIR'
     ThirdPersonMesh=LodMesh'DeusExItems.GogglesIR'
     Charge=500
     LandSound=Sound'DeusExSounds.Generic.PaperHit2'
     Icon=Texture'DeusExUI.Icons.BeltIconTechGoggles'
     largeIcon=Texture'DeusExUI.Icons.LargeIconTechGoggles'
     largeIconWidth=49
     largeIconHeight=36
     Description="Tech goggles are used by many special ops forces throughout the world under a number of different brand names, but they all provide some form of portable light amplification in a disposable package."
     beltDescription="GOGGLES"
     Mesh=LodMesh'DeusExItems.GogglesIR'
     CollisionRadius=8.000000
     CollisionHeight=2.800000
     Mass=10.000000
     Buoyancy=5.000000
}


Basically i just toggle the NoLighting bool... the AI still thinks im in the shadows even though for me there are no shadows, it works a treat... I also laughed because now i have to lower the brightness so that its not so intense

heres another question for ya though..

where is the destructor for the game loop, or if theres something similar, like a function that runs on exit?

all id need to do is set nolighting to false and the brightness to your "savebright" variable so that it always defaults on exit.

=========================================================

ahh success... it feels great doesnt it? ill send a few screens if i can figure out how to attatch them.

Edit: SolidGreen on its own was too intense, VisonBlue on its own was a too intense, but solidgreen with visionblue layered on top of it works really well, its weird..... and although it shows the border of the skybox and other things that arent supposed to be seen during gameplay, at least the nightvision works like it should.

Edit2: Ok so ive managed to find function PreBeginPlay() under Engine\classes\GameInfo.uc... from there i set NoLighting to false so that its always false on startup regardless of the ini file, im sure noones going to miss it :P
works a charm, but a new problem arises, i had to use WOTGreal Package exporter to export the images in that package to recompile engine.u, but there all named by their "given" names, not their original file names, so i renamed them to the correct name, compiled successfully with no errors or warnings but for some reason, SmallFont.bmp... the only bmp it asked for... doesnt seem to work in the game.. its the font for the console\talk for entering commands. Its not corrupt or anything... perhaps theres a better function in DeusEx/classes for this i havent found yet..

Is there a way to just recompile any changes in the source or do i have to recompile the whole thing from scratch including the images?

i really hope someone sees this and puts this in the next Revision update, or any of the other "improvement" mods.

Before:
Shot0001.png
Before
(258.21 KiB) Not downloaded yet

After:
Shot0000.png
After
(1 MiB) Not downloaded yet

Before:
Shot0003.png
Before
(106.85 KiB) Not downloaded yet

After:
Shot0002.png
After
(554.67 KiB) Not downloaded yet


Sorry for the "Wall of Posts" :lol:
User avatar
badmojo
Newbie
 
Posts: 6
Joined: Wed Apr 06, 16 7:11 pm
Location: Australia

Re: Help with nightvision/tech goggles fix

Postby Allan » Fri Apr 08, 16 11:49 am

I've actually got no experience with recompiling the game's main packages, to be honest, so I can't really help with that. Though if you have a package with more than just code in it, you have to recompile every part of it at once. I learned that the hard way trying to remake tnag with all of the UT99 weapons. Took FOREVER to compile the 10MB, even on an SSD!

I always just made additional packages, then made similar-but-different named (usually just sticking a 2 on the end of the name) weapons in a new .u package, rather than replace the classes in the DeusEx.u. Though that doesn't replace any of the existing Tech Goggles or anything else with the new ones, unless you write /another/ class that you can spawn in with the console commands. Said new class has to remember the situation of each old pair of TechGoggles, delete the old pairs, spawn in the new pairs in that same situation, then delete itself. It's a bit of a hassle, so if your way works better, more power to you!

Good work on getting the goggles to work by the way - I'd have never thought about using bNoLighting. :D
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Re: Help with nightvision/tech goggles fix

Postby badmojo » Fri Apr 08, 16 12:34 pm

Im sure back in the day it would have taken ages, but the system im on now its not too bad, 30seconds at most to recompile both deusex.u and engine.u which contains the images.. and thats with firefox and other miscellaneous programs running in the background.

Yea too much work just to replace an item with another item using a different package, i know with something like shifter, it replaces the deusex.u because of the modifications to the already existing items and such... its ashame i cant do the same thing i do for zDoom in DECORATE.. something like:


Code: Select all
class _TechGoggles replaces TechGoggles;
function blah()
{
blah blah
}

ect...


although i never tried lol

Really need to figure out why its not reading that bmp though, its strange, ill try changing the code to find a pcx instead, like the rest of them, i dont know why they decided to go bmp for that one font in the first place.


Update:

Okay i found a solution... Ive left engine.u as vanilla, has nothing to do with it anymore, instead though, inside DeusEx/Classes/DeusExLevelInfo.uc theres a function called PostBeginPlay(), in there i set nolighting to false.. im fair sure that resets it back to normal on level load, and because the main menu is technically a map, it loads on startup...

So heres a recap for anyone that reads this and wants WORKING TECH GOGGLES and FULL SCREEN NIGHTVISION.. and knows how to compile code :P

Firstly, the fullscreen part:

In Deusex/classes/augmentationdisplaywindow.uc

from line 1219, i comment out the first if statement (or delete):

Code: Select all
      // shift the entire screen to dark red (except for the middle box)
   /*
      if (player.Level.Netmode == NM_Standalone)
      {
         gc.SetStyle(DSTY_Modulated);
         gc.DrawPattern(0, 0, width, boxTLY, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(0, boxBRY, width, height-boxBRY, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(0, boxTLY, boxTLX, boxH, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(boxBRX, boxTLY, width-boxBRX, boxH, 0, 0, Texture'ConWindowBackground');
         gc.DrawPattern(0, 0, width, boxTLY, 0, 0, Texture'SolidRed');
         gc.DrawPattern(0, boxBRY, width, height-boxBRY, 0, 0, Texture'SolidRed');
         gc.DrawPattern(0, boxTLY, boxTLX, boxH, 0, 0, Texture'SolidRed');
         gc.DrawPattern(boxBRX, boxTLY, width-boxBRX, boxH, 0, 0, Texture'SolidRed');
         gc.SetStyle(DSTY_Translucent);
      }
     */


That removes the red border on augvision as its no longer needed for this purpose.

from line 1421i comment out the "IRAmpActive" message as its not really needed

Code: Select all
 // draw text label
     /*
      if (player.Level.Netmode == NM_Standalone)
      {
         gc.GetTextExtent(0, w, h, msgIRAmpActive);
         x = boxTLX + margin;
         y = boxTLY - margin - h;
         gc.SetTextColor(colHeaderText);
         gc.DrawText(x, y, w, h, msgIRAmpActive);
      }
     */


Next i find line 1357 and modify as follows:

Code: Select all
   // shift the middle of the screen green (NV) and increase the contrast
   // DEUS_EX AMSD In singleplayer, draw this here
   // In multiplayer, drawn earlier so you can still see through walls with it.
   if (player.Level.Netmode == NM_Standalone)
   {
     gc.SetStyle(DSTY_Modulated);
    gc.DrawPattern(0, 0, width, height, 0, 0, Texture'VisionBlue');
    gc.DrawPattern(0, 0, width, height, 0, 0, Texture'SolidGreen');
   }
     gc.SetStyle(DSTY_Normal);

    /*
   if (player.Level.NetMode == NM_Standalone)
      DrawDropShadowBox(gc, 0, 0, width, height);

   // draw text label
   if (player.Level.Netmode == NM_Standalone)
   {
      gc.GetTextExtent(0, w, h, msgLightAmpActive);
     if(visionLevel>=1)
      x = boxTLX + margin + width/2;
     else
     x = boxTLX + margin;
      y = boxTLY + margin - h;
      gc.SetTextColor(colHeaderText);
      gc.DrawText(x, y, w, h, msgLightAmpActive);
   }
   */


Here i have changed the first instance of 'SolidGreen' and changed it to vision blue, changed the width and height to the resolution of the screen, then i comment out the last two if statements as the first one is the thin white border where the mini lightamp window would be and the other is the string "LightAmpActive" that would be on the top left of that window, both of which are not needed anymore as i know the "LightAmp" is active because my whole screen is green now :P

Moving on....

Save that mofo, then open up augvision.uc

line 25, under function activate() and function deactivate() somewhere i added these new lines of code
Code: Select all
function Activate()
{
   local bool bWasActive;
   
   bWasActive = bIsActive;

   Super.Activate();
   
   //NEW=======================
   Player.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ True);
   Player.ConsoleCommand("FLUSH");
   //==========================

   if (!bWasActive && bIsActive)
   {
      SetVisionAugStatus(CurrentLevel,LevelValues[CurrentLevel],True);
      Player.RelevantRadius = LevelValues[CurrentLevel];
   }
}

Code: Select all
function Deactivate()
{
   local bool bWasActive;
   
   bWasActive = bIsActive;

   Super.Deactivate();
   
   //NEW=======================
   Player.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ False);
   Player.ConsoleCommand("FLUSH");
   //==========================

   if (bWasActive && !bIsActive)
   {
      SetVisionAugStatus(CurrentLevel,LevelValues[CurrentLevel],False);
      Player.RelevantRadius = 0;
   }
}


save that sucker and open techgoggles.uc

here we have ChargedPickupBegin and ChargedPickupEnd functions, in there i added these new lines of code

Code: Select all
function ChargedPickupBegin(DeusExPlayer Player)
{
   Super.ChargedPickupBegin(Player);
   
   //NEW=======================
   Player.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ True);
   Player.ConsoleCommand("FLUSH");
   //==========================
   DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount++;
   UpdateHUDDisplay(Player);
}

Code: Select all
function ChargedPickupEnd(DeusExPlayer Player)
{
   Super.ChargedPickupEnd(Player);
   
   
   //NEW=======================
   Player.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ False);
   Player.ConsoleCommand("FLUSH");
   //==========================
   
   if (--DeusExRootWindow(Player.rootWindow).hud.augDisplay.activeCount == 0)
      DeusExRootWindow(Player.rootWindow).hud.augDisplay.bVisionActive = False;
}


save and lastly i open up DeusExLevelInfo.uc

At line 42 you will find function PostBeginPlay()

i modify as follows:
Code: Select all
function PostBeginPlay()
{
   Super.PostBeginPlay();
   
   //NEW=======================
   Level.ConsoleCommand("set ini:Engine.Engine.ViewportManager NoLighting" @ False);
   Level.ConsoleCommand("FLUSH");
   //==========================

   SpawnScript();
}


save that, goto your deusex\system folder, rename deusex.u to deusex.u_ or something, just to keep a backup, then run ucc.exe make

All done, start the game, summon techgoggles, augadd augvision then allaugs and test your fancy new working nightvision.

a few things to keep in mind would be that, it removes the lighting, so you will be able to see things that the developers didnt intend for you to see, skybox borders for instance, where the map ends when looking in the water on liberty island and such, and when talking to someone it will disable the green filter but it will still be full bright due to the nolighting bool still being true whilst in these situations.

And theres my take on fixing the NightVision in deusex :)

never been done before until now :P
User avatar
badmojo
Newbie
 
Posts: 6
Joined: Wed Apr 06, 16 7:11 pm
Location: Australia


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 11 guests
cron