Emergency lighting fix
Lazer
Join Date: 2003-03-11 Member: 14406Members, Contributor, Constellation, NS2 Playtester
It's been bugging me for a while that the emergency lights came on so sudden and awkward. I dug into the LUA a bit and fixed:
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/JKofELllc5M"></param><embed src="http://www.youtube.com/v/JKofELllc5M" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
I'm assuming since there was already a fade for the lights going on/off this fix is the actual intended behavior. The off time has not been altered.
Source: <a href="http://devin-afshin.com/lazer/PowerPoint_Client.lua" target="_blank">PowerPoint_Client.lua</a>
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/JKofELllc5M"></param><embed src="http://www.youtube.com/v/JKofELllc5M" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
I'm assuming since there was already a fade for the lights going on/off this fix is the actual intended behavior. The off time has not been altered.
Source: <a href="http://devin-afshin.com/lazer/PowerPoint_Client.lua" target="_blank">PowerPoint_Client.lua</a>
Comments
You up for the challenge Lazer :D
You up for the challenge Lazer :D<!--QuoteEnd--></div><!--QuoteEEnd-->
Right ... in the Spark engine, that's not a challenge. Its a cakewalk. In other words,
"That's not a challenge. THIS is a challenge".
5 changed lines or less, with only one line allowed to do any calculations.
Which map is that? Is it an official release?
ns2_icarus, a map I've been working on for a while now, not official though
And lol w/ these challenges. Making the lights behave independent from each other could be tricky. Maybe if I used something like (light's uid mod 10)/10 and used the fraction to determine a slight flicker on delay for each light could be a start... will take some playing around but I can attempt the challenge :)
I hope that made sense.
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/9JmnSSKD3nk"></param><embed src="http://www.youtube.com/v/9JmnSSKD3nk" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
It only flickers when turning on. It could be done all the time but I think it feels about right like this.
<a href="http://devin-afshin.com/lazer/PowerPoint_Client_flicker.lua" target="_blank">PowerPoint_Client_flicker.lua</a> (rename PowerPoint_Client.lua)
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/9JmnSSKD3nk"></param><embed src="http://www.youtube.com/v/9JmnSSKD3nk" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
It only flickers when turning on. It could be done all the time but I think it feels about right like this.
<a href="http://devin-afshin.com/lazer/PowerPoint_Client_flicker.lua" target="_blank">PowerPoint_Client_flicker.lua</a> (rename PowerPoint_Client.lua)<!--QuoteEnd--></div><!--QuoteEEnd-->
do it all the time. you know the amount of posts (some by me) advocate this.. make it so i can at least buy a California server and run it this way. cuz i will. called LAzer.
for the staggered effect, not sure if you implemented that. it wasn't as obvious as i imagined in my head, but it could be the way the game works. but the flickering looks great!
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/9JmnSSKD3nk"></param><embed src="http://www.youtube.com/v/9JmnSSKD3nk" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
It only flickers when turning on. It could be done all the time but I think it feels about right like this.
<a href="http://devin-afshin.com/lazer/PowerPoint_Client_flicker.lua" target="_blank">PowerPoint_Client_flicker.lua</a> (rename PowerPoint_Client.lua)<!--QuoteEnd--></div><!--QuoteEEnd-->Very nice little effects like that really add to the game...
Hopefully it makes the official cut :D
for the staggered effect, not sure if you implemented that. it wasn't as obvious as i imagined in my head, but it could be the way the game works. but the flickering looks great!<!--QuoteEnd--></div><!--QuoteEEnd-->
Thanks, I think it might be the video making it hard to tell the staggering effect. What I had done was on the loop that updates each individual light I used the index of the light mod 8 to create a cycling number between 0 and 7. Then took that number over 8 to determine how long before certain lights flick on (basically every .1s a different set of lights starts turning on until they are all lighting up). Also as they light up it uses the modulated index to determine when it should flicker as well. Also for the staggered effect to appear more obvious the light index can be modulated by a lower number (like 4) which often makes the difference in turn-on delay greater between neighboring lights but leads to a slightly less random appearance.
btw I made a couple adjustments and re-uploaded it just to tweak a few things
<a href="http://devin-afshin.com/lazer/PowerPoint_Client_flicker.lua" target="_blank">PowerPoint_Client_flicker.lua</a> (rename PowerPoint_Client.lua)
You should be able to run this locally and still play online too if anyone wants to try it.
As it is, my first impression was a graphical glitch, not a flickering light.
Pretty amazing what you can do in LUA though, great work Lazer!
Me too, when I get off of work later I will have to spend a little time fixing this.
<!--quoteo(post=1843657:date=May 2 2011, 09:38 AM:name=radforChrist)--><div class='quotetop'>QUOTE (radforChrist @ May 2 2011, 09:38 AM) <a href="index.php?act=findpost&pid=1843657"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->It looks good, but I wonder if you could prolong the flicker just a bit. have the flicker off be just a touch longer.
As it is, my first impression was a graphical glitch, not a flickering light.<!--QuoteEnd--></div><!--QuoteEEnd-->
I see what you mean, it should also probably flicker more when first turning on. The adjustments I had made this morning let it seem a little less glitchy (isn't flickering a glitch of sorts? :p) but I think an increased flicker duration and just a second or so shorter dark time will be a huge improvement. Later today I'm going to look into making it more something like this although a bit less intense:
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/is-Gn8J2xHY"></param><embed src="http://www.youtube.com/v/is-Gn8J2xHY" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
You now realize it is <b>imperative</b> that your next video example has that soundtrack!
But this is quite nice! The flickering looks cute too. Now let's hope the actual light models light emitting thingies (I believe they are called lights :P) are possible to turn off or into a color
You could probably use the same texture as the self illumination map.
I really do like the combined effects, though. I like the slow fade in because it gives that slightly archaic feel. The marine tech is in a way advanced, but extremely rugged/mechanical. The flicker helps add that feeling that the lighting is something that is unreliable somehow, or that it is indeed an emergency system that just barely, thankfully, comes on.
I was hoping the devs would change the properties of the emergency lighting somehow. This is a great step towards creating a better atmosphere; good job!
btw I made a couple adjustments and re-uploaded it just to tweak a few things
<a href="http://devin-afshin.com/lazer/PowerPoint_Client_flicker.lua" target="_blank">PowerPoint_Client_flicker.lua</a> (rename PowerPoint_Client.lua)
You should be able to run this locally and still play online too if anyone wants to try it.<!--QuoteEnd--></div><!--QuoteEEnd-->
as far as staggering, are you talking about staggering when the lights flicker or when they come on? i was talking about staggering as far as when they come on. like one light, then the next, and then the one after that. either way, i'm not going to criticize your work. it's all personal preference now. i like the suggestions others are making, but clearly you know what you're doing and it's great. i'm not much of a programmer so i don't know the effort you went through (especially since i've never worked with lua before).
I think it's hard to tell the staggering because of how I implemented it. Right now there is 8 different time delays for the lights but because they are all <1 second it is really hard to notice the differences between them. I do plan to make a few more adjustments and would like to account for this better as well.
gotchya. so i imagine all of this is going to be featured in the final version of your map then. how big is your map?
Kind of like this:
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/hiyOcAKB_-A"></param><embed src="http://www.youtube.com/v/hiyOcAKB_-A" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>