Light stacking...( Not quite sure if this is a problem but eh.. i'll go with it.)

Locked
User avatar
TopHatPenguin
Community Contributor
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.)

Post by TopHatPenguin » 26 Jun 2015, 16:28

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
Shit cm memes: Image
Image
Image
Image
That guy called Wooki.
Resident Santa.
(THP)

User avatar
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.)

Post by Fickmacher » 26 Jun 2015, 16:44

I've seen this happen on literally every server that I've ever been on.
Squad Leader, Engineer, Sentinel, Queen, Jackass Image

User avatar
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.)

Post by Evilkyle24 » 26 Jun 2015, 18:53

This is how space station 13 works.

That's always been how it works.
Image

User avatar
TopHatPenguin
Community Contributor
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.)

Post by TopHatPenguin » 26 Jun 2015, 19:12

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 :D
Shit cm memes: Image
Image
Image
Image
That guy called Wooki.
Resident Santa.
(THP)

User avatar
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.)

Post by Abbysynth » 02 Jul 2015, 19:08

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.

User avatar
TopHatPenguin
Community Contributor
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.)

Post by TopHatPenguin » 02 Jul 2015, 19:46

Abbysynth 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.
All i can say is well done :D
Shit cm memes: Image
Image
Image
Image
That guy called Wooki.
Resident Santa.
(THP)

User avatar
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.)

Post by MrGabol100 » 02 Jul 2015, 19:53

Nice, because the i drop a light while having other in my other hand and now i'm fucking pitch back thing, was on.

User avatar
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.)

Post by LordeKilly » 02 Jul 2015, 20:02

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.
Image

User avatar
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.)

Post by Juninho77 » 02 Jul 2015, 20:12

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.
I've actually fixed that a few days ago...
Image
"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.
Image

User avatar
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.)

Post by MrGabol100 » 02 Jul 2015, 20:25

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.

User avatar
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.)

Post by LordeKilly » 02 Jul 2015, 21:25

Yeah, it's still an issue for me as well.
Image

User avatar
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.)

Post by Juninho77 » 03 Jul 2015, 03:24

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.
Image
"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.
Image

User avatar
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.)

Post by Abbysynth » 03 Jul 2015, 13:03

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.

User avatar
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.)

Post by Juninho77 » 03 Jul 2015, 13:13

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.
Oh, THAT too? And I thought I was bad at coding.

Anyway, I don't have access to the alpha code, so I'll just wait for the release.
Image
"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.
Image

Locked