Game Development Community

dev|Pro Game Development Curriculum

Night Vision Goggles

by Stefan Grufman · 02/11/2002 (8:14 am) · 17 comments

I made this available through my own site.
Click here!

Hope that is OK with you guys.

If there are any problems with it, please mail me at:
gruffy@telia.com
/Stefan

About the author

Recent Blogs


#1
02/11/2002 (3:08 pm)
Cool, although 3 1meg images and a light source coming from the player is pretty resource intensive :\

I'm working on a night vision (started 2 nights back believe it or not) that will be much like the one seen in Perfect Dark. Yours is nice, a lot like the one in Counter-Strike. I hated that one... so I have to make on on my own. I'm sure other people (who like CS... i dont, hehe) will love to use this.

Nice work!
#2
02/11/2002 (6:40 pm)
Me, Grimlock, like Perfect Dark night vision!
#3
02/11/2002 (10:57 pm)
Yes, I agree, the large pictures are bad at this point. It is not at all difficult to make them smaller or even skip the 3 pictures and have one static instead.

Whay do they look like CS? Hrm...could it be because I did NVG's in my last project StrikeForce for the UT engine... ;-)

This tutuorial shows the concept of the NVG's, i.e. how you "enhance" the picture with help of a client side light. What you place on top of that is up to you (i.e. the greenish flicker and the goggles), the pics included are just large green noice pictures, easy to scale down.

/Stefan
#4
02/13/2002 (5:14 pm)
I'm still doing testing to figure out if it's the full-screen images or if it's the "head" light that is causing major slowdown (from 30 to 18fps on my system)

I've already integrated a color "screen" that converts to green monochrome as seen in other games. It looks nice, but lighting really can't be done with a moving lamp. Looks too fake.

I'm currently messing around with the values applied to each object so that specific object's light values are increase (like in PD, where players light values are increased a good 5-10x while static objects are only 2x)

Anyway, more info on my progress later.
#5
02/13/2002 (10:53 pm)
Kewl Matt!
Looking forward to hear about your progress!

You could try turning off the light and see how the fps are in that mode.

Keep it up!
/Stefan
#6
02/19/2002 (4:06 am)
Maybe you could disable all the other lights on the client with the goggles? So the only light rendered is the one on the head.

Nice work :)
#7
08/11/2002 (9:55 pm)
I dont think you can do large-area dynamic lights without lag. I've tried it on a few things I did with T2 and it dragged the game down pretty damn fast. If you could just render differently, it would be perfect. Fast and you could even make it look very authentic.
#8
02/15/2003 (9:32 am)
I only lose about 3-5 frames with it on (I have a GF4 MX 440 64DDR)

Needs some work tho, if you go in 3rd person, it lights you up ;)
#9
10/02/2003 (5:30 pm)
how would i change the code so that when the mission starts the nightvision is on? ive tried many things to do this but no success. thanks if any one can help.
#10
04/02/2005 (6:15 am)
Has anyone had problems with the night vision not lighting up players or static objects? I have that problem for some reason, any ideas?

@GarageGamer::
I doubt you still check this, but just in case, call "C3NV.toggle();" at the start of your mission, like in th GameConnection::onClientEnterGame(); or something.
#11
01/18/2006 (10:56 pm)
If anyone stumbles across this and wants to implement it into 1.4, you just need to change a small piece of c3GuiNightVisionCtrl.cc.

find this portion of code:

// Now, add a light if we are enabled
   // Make sure it is added at our position.
   if (mOn)
   {
	    // Get our "client", i.e. the server connection
		GameConnection *client = GameConnection::getServerConnection();
		Player *player = NULL;

and change it to:

// Now, add a light if we are enabled
   // Make sure it is added at our position.
   if (mOn)
   {
	    // Get our "client", i.e. the server connection
		GameConnection *client = GameConnection::[b]getConnectionToServer();[/b]
		Player *player = NULL;

It seemed to work fine for me, including multiplayer.

-Alan
www.reallyreallygoodthings.com
#12
05/29/2006 (2:14 am)
Can anyone help me?

This error message appears in the console everytime I press "n" :

Unable to find object: 'C3NV' attempting to call function 'toggle'
#13
01/28/2007 (6:07 am)
"I made this available through my own site.
Click here!"

And now it's not available anymore! GG! :)
#15
09/16/2007 (6:41 am)
Dead link.
#16
09/23/2007 (9:39 pm)
I got it to work with the 1.5.2

The only other thing you need to change in addition to the change above is the last line in the register lights function.

it should be

lightManager->sgRegisterGlobalLight(&mLight);

I can't find the original tutorial file. But I've temporarily placed the version of the code I have here. For anyone that still wants to add this to their project.

http://netfiles.uiuc.edu/bjsmith4/shared/c3GuiNightVisionCtrl.cc
#17
07/14/2008 (8:08 pm)
I tried the link you posted and unfortunately it doesn't work.