Page 1 of 2
Night
Posted: 06 Sep 2008, 20:49
by Evil4Zerggin
Night
This widget filters the world to look like it is nighttime, and gives most units searchlights. Somewhat performance-intensive due to my lack of GL-fu.
Download from caspring at the bottom of the page here.
Versions
1.5.4
- Tweaked searchlight upwards. Hopefully this is the end of the crotch light problem.
- Fixed bug where extra upward-pointing cones would appear for units going down slopes.
1.5.3
- "/luaui night_simplebase" replaced with "/luaui night_basetype [0-2]", with 0 = no base, 1 = simple base, 2 = full base (default)
1.5.2
- I hereby release this widget under the GNU LGPL, version 2.1 or later.
1.5.0
- Now uses color map with sunrise, sunset.
1.4.1
- Made searchlights stronger, not all turn on/off at the same time.
- Made days longer.
1.4.0
- Added day/night cycle; "/luaui night_cycle" to stop.
- Darkened default night color.
1.3.1
Commands
- "/luaui night_preunit" to toggle whether the filtering is done before or after units and projectiles are drawn. Unfortunately, I don't know of a way to do it after units but before projectiles.
- "/luaui night_basetype" to set the base type.
- "/luaui night_beam" to toggle the searchlight beam.
- "/luaui night_setsearchlight [number]" to set the strength of the searchlight, typically 0-1, or <= 0 to turn the searchlight off.
- "/luaui night_cycle" to start/stop the day/night cycle.
Re: Night
Posted: 06 Sep 2008, 21:04
by BaNa
OMFG man you f*cking rule the world. You sir deserve a happy ending with everything you order.
Re: Night
Posted: 06 Sep 2008, 21:55
by Cremuss
lol ! amazing !
It could be interseting to have a game where it switch from day to night every XX minutes. Enemy units will be harder to localize by radars, artillery will have less accuracy etc..

Re: Night
Posted: 06 Sep 2008, 22:46
by Evil4Zerggin
Any gameplay element will have to be done by the modmaker. However, I just implemented a visual day/night cycle.
Re: Night
Posted: 06 Sep 2008, 23:16
by Argh
Um... whatever happened to Trepan's changes where we were finally going to be able to control the main lighting?
This is neat, but without that... it's very incomplete-feeling, imo. It's not "night" when the map merely darkens, but units are all fullbright. Same issues with the sky, the shadows, etc., and redrawing all of the quads seems very wasteful...
Re: Night
Posted: 06 Sep 2008, 23:56
by REVENGE
Argh wrote:Um... whatever happened to Trepan's changes where we were finally going to be able to control the main lighting?
This is neat, but without that... it's very incomplete-feeling, imo. It's not "night" when the map merely darkens, but units are all fullbright. Same issues with the sky, the shadows, etc., and redrawing all of the quads seems very wasteful...
Heh, should be easy to incorporate right? Just put in the call and have it be incremented to change gradually with the cycle code (FSCKING WIN). Now, if only we had the ability to change the skybox.

(Or can we draw it using lua? Hm...)
Re: Night
Posted: 07 Sep 2008, 01:53
by smoth
very nice.
Re: Night
Posted: 07 Sep 2008, 02:19
by rattle
Reminds me of Tiberian Sun
Re: Night
Posted: 07 Sep 2008, 02:51
by FLOZi
Very cool. I was hoping someone would write a nighttime shader, which would probably be a better way of doing it.
Re: Night
Posted: 07 Sep 2008, 03:29
by Evil4Zerggin
I might write a shader once I learn how.
Re: Night
Posted: 11 Sep 2008, 05:02
by Tribulexrenamed
Evil4Zerggin wrote:I might write a shader once I learn how.
rofl so would we all
Re: Night
Posted: 11 Sep 2008, 05:14
by aegis
o_O
Re: Night
Posted: 11 Sep 2008, 09:30
by Forboding Angel
Any chance you could make the sun move around?
Re: Night
Posted: 11 Sep 2008, 09:38
by Evil4Zerggin
Unfortunately, it appear there is a gl.GetSun but not a gl.SetSun. I'll experiment with gl.Light when I get a chance, although I'm not entirely sure what it does.
Re: Night
Posted: 13 Sep 2008, 08:43
by CarRepairer
I absolutely love this widget. A bit of brainstorm and it could definitely go into CA's rules as a modoption that modifies gameplay like less LoS and accuracy at night.
Argh wrote:Um... whatever happened to Trepan's changes where we were finally going to be able to control the main lighting?
This is neat, but without that... it's very incomplete-feeling, imo. It's not "night" when the map merely darkens, but units are all fullbright. Same issues with the sky, the shadows, etc., and redrawing all of the quads seems very wasteful...
Zerggin included several commands that allow you to change the behavior. /luaui night_preunit makes the colormap apply to units too so they look dark as well and it's awesome. Unfortunately it also causes lasers and explosions to get darker but it's still the best way to play in my opinion. I suggest you make a screenie with preunit darkening on, looks more more like night. Good work zerg!
Re: Night
Posted: 15 Sep 2008, 23:36
by Masure
Nice work but this really should be made in the engine code.
Just like bloom...
Re: Night
Posted: 16 Sep 2008, 15:56
by Tribulexrenamed
I have this widget on permanently. I love it. :)
Re: Night
Posted: 26 Sep 2008, 23:56
by smartie

Love the widget
Re: Night
Posted: 27 Sep 2008, 23:03
by smartie
A couple of ideas
aa defenses should have the search light point upwards
(mainly flak, it probably wouldn't look as good for missile towers)
for defenses, the spotlight should focus on the unit that it is shooting at
This should really be programmed into the engine so that the sun position can be set, and the color of the map lighting could be changed that way. Then you could have the sun moving, and the shadows getting longer and everything. It looks good now, but it could look even better.
Re: Night
Posted: 28 Sep 2008, 06:57
by Evil4Zerggin
Unfortunately AFAIK there is no way of reading a unit/weapon's current target.
But yeah, like the bloom shader, it's pretty much a case of doing as much as possible without real engine support.