Oriented light disapears when entity moves offscreen

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Oriented light disapears when entity moves offscreen

Post by Dark »

When entity that has "oriented" light moves beyond the visible area (or screen zooms-in leaving entity outside) the light disappear, even if light directed to the center of the screen.
Petty wired I can say, I do understand that it was done for simplicity but still weird.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by slpwnd »

What entity are we exactly talking about? Shouldn't happen for the train or the car (as of 0.10.3). It can happen for the character (though that is not a regular scenario because character is usually in the middle of the screen - unless disconnected) and couple of other entities (lab for instance - but those don't have an oriented light by default).

Also if the light is "big" then it will disappear eventually. The mechanism is such that there is a rectangle of about 15 tiles wider than the screen that is searched for lights rendering. Yes, this is a simplification but necessary one. We cannot go through all the entities in the world to check for light rendering :) Another thing is that some entities don't have the mechanism of rendering lights explicitly implemented (like lab for instance).
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by Dark »

Tested with both "car" and "player" types, everything seems like you said :)

Light is about 40 tiles long (its planned to be possible even bigger), when testing with "player"-type it disappears almost immediately, with "car" - about 15-20 tiles off-screen before it turns off.

Can this rectangle search for light-cone textures within player view instead? Or had a range setting in config file?
Right now a workaround is: place a "car" in the middle of a light cone, or even on it tip, but it will look kinda weird when light starts to position in certain direction.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by slpwnd »

Dark wrote:Can this rectangle search for light-cone textures within player view instead? Or had a range setting in config file?
Right now a workaround is: place a "car" in the middle of a light cone, or even on it tip, but it will look kinda weird when light starts to position in certain direction.
I have fixed this for all the entities that produce any light for 0.10.4 (that includes the character, the lab, the assembling machine, etc.). The rectangle search for entities producing light does happen in the player view.

What exactly are you trying to do? :) I suppose this is for some mod, right?
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by Dark »

Yes, It is a mod, a screenshot can say more :)
screenshot
Spotlights can be rotated at any angle, not just 8 default direction. But if center of rotation is not in the same position as light source - it will look weird, and I have no means to disable car's light until rotation is finished.
I'm planning to release beta version of mod somewhere today.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by slpwnd »

Nice. Maybe in the future we could have like "always draw" flag. For entities like this - that produce very big light and there are not that many of them. Moving it to minor issues till then. You will also be able to use character, assembling machine, lab or any other entity for this in 0.10.4.
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by Dark »

Only rotatable entities are usable for the purpose, otherwise I would had to draw 360*number_of_colors textures just for light cones and it would eat all video memory, "player" type is not usable for another reason - you can's keep him at certain angle, he snaps to 8 directions. So only a car and a locomotive are left, but loco is not quite useful for obvious reasons.
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: Oriented light disapears when entity moves offscreen

Post by Dark »

Follow up: If something like "always draw" flag is implemented it would be essential to have ability to toggle it during runtime.
I would write an intelligent drawer for semi-statical objects: player's view does not teleport around (usually), camera moves only one tile up or one tile left at a tick - when camera moves enough we only need to scan border (1 tile line, not rectangle) for entities to show.
Post Reply

Return to “Minor issues”