Dynamic shadows to show time of day

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

ViciousVinnyD
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Nov 30, 2020 2:09 pm
Contact:

Dynamic shadows to show time of day

Post by ViciousVinnyD »

So I noticed the game uses black silhouette sprites on the ground to emulate shadows cast by the sun. By scaling the sprite horizontally you could probably mimic the sun crossing the sky with little cost to the game.

Also since this game likes animated machines so much why not make the solar panels tilt left to right with the sun?
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Dynamic shadows to show time of day

Post by Klonan »

ViciousVinnyD wrote: Thu Dec 03, 2020 11:57 amBy scaling the sprite horizontally you could probably mimic the sun crossing the sky with little cost to the game.
If only it were that simple :)
KeepResearchinSpoons
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Tue Dec 01, 2020 6:57 pm
Contact:

Re: Dynamic shadows to show time of day

Post by KeepResearchinSpoons »

At best it would probably come to changing alpha chan of the shadow sprite depending of the surrounding light level; but meh is it too costly for each of the shadow to calc? Shortcut depending on the sun level for low cost logic? Meh it's waaai too SHADY stuff...

We still have that bright moon that shines over the nauvis since forever.
Especially true with cave scenarios like diggy where the time is actually locked to midnight :>
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 429
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Dynamic shadows to show time of day

Post by kirazy »

Imo, just having the shadows fade to almost invisible at night would be a marked improvement. But I think trying to simulate a proper day-night cycle with static sprites is asking a lot.
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: Dynamic shadows to show time of day

Post by adamwong246 »

I don't think it's possible to do this with sprites? Without some sort of 3d representation, how could you make a shadow of, say, a telephone pole? Every item in the game would need a whole new set of sprites and not just one. Maybe you could come up with some sort of compressed representation of a shadow for each item but that sounds like a ton of work too.
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 429
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Dynamic shadows to show time of day

Post by kirazy »

adamwong246 wrote: Fri Dec 04, 2020 2:45 am I don't think it's possible to do this with sprites? Without some sort of 3d representation, how could you make a shadow of, say, a telephone pole? Every item in the game would need a whole new set of sprites and not just one. Maybe you could come up with some sort of compressed representation of a shadow for each item but that sounds like a ton of work too.
Most structures already have their shadows as separate sprites that are drawn on a shadow layer, so adjusting the alpha probably (?) wouldn't be too much trouble. Shifting them throughout the day would probably look bad, as the shadows are cast from a light source to the west, so even if you project the shadow to the west as though the sun is rising, it would look wrong.
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: Dynamic shadows to show time of day

Post by adamwong246 »

Are you saying that objects in the game already have shadow layers? I don't think that's right but I really don't know. (I don't know that much about pixel art) If you had the art assets, yeah, it would be do-able. But to make those shadow layers would require a ton of art-work.

Here's an shim idea: Instead of a pixel perfect shadow for each item, just cast a gray oval with some alpha effects in the correct direction. Give each item a shadow-size between 0 for nothing, 1 for really skinny things like telephone polls and 10 for full size assembly machines and that determines the size of they grey oval. That _might_ look ok. It also might look like poop.
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 429
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Dynamic shadows to show time of day

Post by kirazy »

adamwong246 wrote: Fri Dec 04, 2020 3:07 am Are you saying that objects in the game already have shadow layers? I don't think that's right but I really don't know. (I don't know that much about pixel art) If you had the art assets, yeah, it would be do-able. But to make those shadow layers would require a ton of art-work.
Yes, that is what I am saying. Pipes and belts have their shadows baked in (and a few other entities that haven't received recent love and attention) but in general structures have separate shadow layers.
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: Dynamic shadows to show time of day

Post by adamwong246 »

Wow I had no idea. I'd want to take a closer look at these shadow layers first but yeah I guess it is possible.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Dynamic shadows to show time of day

Post by ssilk »

This suggestion is very old.
viewtopic.php?f=6&t=64483 [0.16.51] more natural shadows

viewtopic.php?f=6&t=44149 Better environment

viewtopic.php?f=6&t=2287 3D rendering

viewtopic.php?f=6&t=1089 Some thoughts about light in general (2013!)

Also related:

viewtopic.php?f=5&t=43661 Unsolved mysteries
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
User avatar
adamwong246
Fast Inserter
Fast Inserter
Posts: 148
Joined: Tue Dec 01, 2020 5:01 am
Contact:

Re: Dynamic shadows to show time of day

Post by adamwong246 »

This is a nice visual flourish but if it incurred any amount of FPS/UPS degradation, I would ask for the option to disable shadows. I've already disabled animations all together to preserve RAM.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Dynamic shadows to show time of day

Post by Deadlock989 »

KeepResearchinSpoons wrote: Thu Dec 03, 2020 11:53 pm We still have that bright moon that shines over the nauvis since forever.
Especially true with cave scenarios like diggy where the time is actually locked to midnight :>
Since 0.18 any scenario/mod can do a lot more than the default with day and night light intensity and colour. You can have pitch black darkness or a hot pink sunset if the mod/scenario sets those night light levels and brightness visual weights.
adamwong246 wrote: Fri Dec 04, 2020 3:07 am Here's an shim idea: Instead of a pixel perfect shadow for each item, just cast a gray oval with some alpha effects in the correct direction. Give each item a shadow-size between 0 for nothing, 1 for really skinny things like telephone polls and 10 for full size assembly machines and that determines the size of they grey oval. That _might_ look ok. It also might look like poop.
"Poop" would be a kindness.
posila
Factorio Staff
Factorio Staff
Posts: 5409
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Dynamic shadows to show time of day

Post by posila »

Graveyar Keeper does something like oval with very smooth fade out and it works pretty well for them, I think https://www.gamasutra.com/blogs/Svyatos ... e_made.php

Our art direction is to have sharp shadows, changing their "darkness" during day-night cycle would be possible too (but they are supposed to be visible during night, as they are the most important element of making entities look grounded)

Skewing them a little bit might work without noticable problems, but IMHO the effect would not be interesting enough to make it worth go through fixing all the issues where shadows are composed of different sprites with different offsets. Artist are more interested in having dynamic shadows moving light sources (player, trains, cars ... or even lamps) during night, rather then just for shadows casted from sun/moon. However, in the end, it was deemed that having completely static shadows is less distracting to players than some kind of approximation of dynamic shadows that would often fail to be convincing.
Post Reply

Return to “Ideas and Suggestions”