Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
- TopHatPenguin
- Community Contributor
- Posts: 2383
- Joined: 14 Dec 2014, 18:06
- Location: Forever Editing The Wiki.
- Byond: TopHatPenguin
- Contact:
Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Bug Description:So you can stack light sources to have a bigger light source.. such as a lighter and a flashlight.
1) Just flashlight with lighter off http://gyazo.com/faf9cf8034f1ce1e11af800cadd60f62
2) Both light sources turned on( flashlight and the lighter) http://gyazo.com/0b36e4753b9395c9d6b4434f3c95e2f8
As i stated before i'm not sure if this is a bug or not...but i'll just put it in this just in case.
Steps to reproduce:
1.grab a lgihter
2.grab a flashlight
3.Turn on both
4. Profit More light
1) Just flashlight with lighter off http://gyazo.com/faf9cf8034f1ce1e11af800cadd60f62
2) Both light sources turned on( flashlight and the lighter) http://gyazo.com/0b36e4753b9395c9d6b4434f3c95e2f8
As i stated before i'm not sure if this is a bug or not...but i'll just put it in this just in case.
Steps to reproduce:
1.grab a lgihter
2.grab a flashlight
3.Turn on both
4. Profit More light
Shit cm memes:
That guy called Wooki.
Resident Santa.
(THP)
► Show Spoiler
That guy called Wooki.
Resident Santa.
(THP)
- Fickmacher
- Registered user
- Posts: 217
- Joined: 27 Apr 2015, 18:10
- Location: Tucson, AZ
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
I've seen this happen on literally every server that I've ever been on.
Squad Leader, Engineer, Sentinel, Queen, Jackass
- Evilkyle24
- Registered user
- Posts: 539
- Joined: 30 May 2015, 21:46
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
This is how space station 13 works.
That's always been how it works.
That's always been how it works.
- TopHatPenguin
- Community Contributor
- Posts: 2383
- Joined: 14 Dec 2014, 18:06
- Location: Forever Editing The Wiki.
- Byond: TopHatPenguin
- Contact:
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Ah forget it then..first time i have actually bothered to look into light sources anyway
This can be deleted then as it apparently isn't a bug
This can be deleted then as it apparently isn't a bug
Shit cm memes:
That guy called Wooki.
Resident Santa.
(THP)
► Show Spoiler
That guy called Wooki.
Resident Santa.
(THP)
- Abbysynth
- Registered user
- Posts: 465
- Joined: 30 Apr 2015, 21:15
- Location: Ottawa, Ontario
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Well, prepare to be amazed, because I changed how light stacking works on Alpha a few builds ago. Literally every server has always been like this because nobody has ever dared to touch the light-gen code, since it was written in a time before time (even before originalstation). In vanilla, light sources simply add on top of each other until you hit the maximum, which for movables like mobs is 5 super-bright tiles around you and pitch blackness everywhere else.
What I did was make light sources not stack -- instead it keeps track of your total luminosity in a seperate variable, and adds-subtracts from it as you turn on or off light sources; when that triggers, it takes your highest light source and uses that instead. So for example:
You pick up a flashlight (5) and turn it on. Your luminosity is 5.
You take an unlit flare (7) out of your backpack and light it. Your luminosity is now 7, since it's higher, but your hidden luminosity is 12.
You throw the flare into the jungle. It subtracts 7 from your total, and since your total is now less than before, your new luminosity is 5, just the flashlight.
Turn the flashlight off and it subtracts 5, setting you to 0. Turn it on and you're at 5 again.
Throw the turned-on flashlight and it subtracts 5 again, setting you to 0 (none).
It did require some tweaking, mostly because of some weird, old, shitty code with moving objects around (it was doubling up the drop() function in some places, using incorrect drop() and pickup() functions in others, and so on), so there -may- be some oddities I haven't quite squashed yet, but in all the tests I've done it works perfectly.
And yes, I am aware that it's not realistic for light sources to not stack like that, but in practice it's 100x better all-around, less laggy for everyone, and gives a much better game-playing atmosphere in general.
What I did was make light sources not stack -- instead it keeps track of your total luminosity in a seperate variable, and adds-subtracts from it as you turn on or off light sources; when that triggers, it takes your highest light source and uses that instead. So for example:
You pick up a flashlight (5) and turn it on. Your luminosity is 5.
You take an unlit flare (7) out of your backpack and light it. Your luminosity is now 7, since it's higher, but your hidden luminosity is 12.
You throw the flare into the jungle. It subtracts 7 from your total, and since your total is now less than before, your new luminosity is 5, just the flashlight.
Turn the flashlight off and it subtracts 5, setting you to 0. Turn it on and you're at 5 again.
Throw the turned-on flashlight and it subtracts 5 again, setting you to 0 (none).
It did require some tweaking, mostly because of some weird, old, shitty code with moving objects around (it was doubling up the drop() function in some places, using incorrect drop() and pickup() functions in others, and so on), so there -may- be some oddities I haven't quite squashed yet, but in all the tests I've done it works perfectly.
And yes, I am aware that it's not realistic for light sources to not stack like that, but in practice it's 100x better all-around, less laggy for everyone, and gives a much better game-playing atmosphere in general.
- TopHatPenguin
- Community Contributor
- Posts: 2383
- Joined: 14 Dec 2014, 18:06
- Location: Forever Editing The Wiki.
- Byond: TopHatPenguin
- Contact:
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
All i can say is well doneAbbysynth wrote:Well, prepare to be amazed, because I changed how light stacking works on Alpha a few builds ago. Literally every server has always been like this because nobody has ever dared to touch the light-gen code, since it was written in a time before time (even before originalstation). In vanilla, light sources simply add on top of each other until you hit the maximum, which for movables like mobs is 5 super-bright tiles around you and pitch blackness everywhere else.
What I did was make light sources not stack -- instead it keeps track of your total luminosity in a seperate variable, and adds-subtracts from it as you turn on or off light sources; when that triggers, it takes your highest light source and uses that instead. So for example:
You pick up a flashlight (5) and turn it on. Your luminosity is 5.
You take an unlit flare (7) out of your backpack and light it. Your luminosity is now 7, since it's higher, but your hidden luminosity is 12.
You throw the flare into the jungle. It subtracts 7 from your total, and since your total is now less than before, your new luminosity is 5, just the flashlight.
Turn the flashlight off and it subtracts 5, setting you to 0. Turn it on and you're at 5 again.
Throw the turned-on flashlight and it subtracts 5 again, setting you to 0 (none).
It did require some tweaking, mostly because of some weird, old, shitty code with moving objects around (it was doubling up the drop() function in some places, using incorrect drop() and pickup() functions in others, and so on), so there -may- be some oddities I haven't quite squashed yet, but in all the tests I've done it works perfectly.
And yes, I am aware that it's not realistic for light sources to not stack like that, but in practice it's 100x better all-around, less laggy for everyone, and gives a much better game-playing atmosphere in general.
Shit cm memes:
That guy called Wooki.
Resident Santa.
(THP)
► Show Spoiler
That guy called Wooki.
Resident Santa.
(THP)
- MrGabol100
- Registered user
- Posts: 636
- Joined: 06 Jan 2015, 17:12
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Nice, because the i drop a light while having other in my other hand and now i'm fucking pitch back thing, was on.
- LordeKilly
- Registered user
- Posts: 806
- Joined: 24 Feb 2015, 16:55
- Location: mongoria
- Byond: lordekilly
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
I personally dislike the luminosity because if I have my gun in one hand and light a flare to throw, it turns my gun light and it have to right click it to turn it back on, which lags the shit out of my late rounds. I've died because of it lagging from that, and then a runner pounces me.
- Juninho77
- Registered user
- Posts: 276
- Joined: 06 May 2015, 10:22
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
I've actually fixed that a few days ago...LordeKilly wrote:I personally dislike the luminosity because if I have my gun in one hand and light a flare to throw, it turns my gun light and it have to right click it to turn it back on, which lags the shit out of my late rounds. I've died because of it lagging from that, and then a runner pounces me.
"Do not go gentle into that good night; rage, rage against the dying of the light."
If you would permaban a player, you owe it to him to look into his logs and hear his side of the story. And if you cannot bear to do that, then perhaps the player does not deserve to be banned.
- MrGabol100
- Registered user
- Posts: 636
- Joined: 06 Jan 2015, 17:12
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Juninho77 wrote:I've actually fixed that a few days ago...
Please, Let me laugh, No, the problem ain't solved, Lights turning off while you turn off other lights sets your total light to zero, or to a really low light.
- LordeKilly
- Registered user
- Posts: 806
- Joined: 24 Feb 2015, 16:55
- Location: mongoria
- Byond: lordekilly
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Yeah, it's still an issue for me as well.
- Juninho77
- Registered user
- Posts: 276
- Joined: 06 May 2015, 10:22
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
For throwing and turning lights on/off it's gone, but the problem is still around if you place light sources in backpacks or suit storages. As Abby said, the code for storing items makes the game think your light source was dropped twice, decreasing your luminosity two times.
But fear not, I fixed that yesterday, I just haven't pushed my fixes just yet. A (hopefully) complete fix to the light bug should be coming this weekend, though.
But fear not, I fixed that yesterday, I just haven't pushed my fixes just yet. A (hopefully) complete fix to the light bug should be coming this weekend, though.
"Do not go gentle into that good night; rage, rage against the dying of the light."
If you would permaban a player, you owe it to him to look into his logs and hear his side of the story. And if you cannot bear to do that, then perhaps the player does not deserve to be banned.
- Abbysynth
- Registered user
- Posts: 465
- Joined: 30 Apr 2015, 21:15
- Location: Ottawa, Ontario
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
You should check out how I did it on the Alpha, it's pretty similar to your solution but I also had to fix a lot of superfluous issues with items in general - getting items from a backpack for example triggers the drop() proc rather than pickup(), stuff like that.
- Juninho77
- Registered user
- Posts: 276
- Joined: 06 May 2015, 10:22
Re: Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)
Oh, THAT too? And I thought I was bad at coding.Abbysynth wrote:You should check out how I did it on the Alpha, it's pretty similar to your solution but I also had to fix a lot of superfluous issues with items in general - getting items from a backpack for example triggers the drop() proc rather than pickup(), stuff like that.
Anyway, I don't have access to the alpha code, so I'll just wait for the release.
"Do not go gentle into that good night; rage, rage against the dying of the light."
If you would permaban a player, you owe it to him to look into his logs and hear his side of the story. And if you cannot bear to do that, then perhaps the player does not deserve to be banned.