[Tutorial] A real dynamic light system

Discussion and feedback on Construct 2

Post » Fri Mar 04, 2016 1:09 am

newt wrote:Lol I'd settle for shadow casters that weren't additive like in Thomas was alone.
http://store.steampowered.com/app/220780/


I agree.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
78
S
21
G
19
Posts: 1,932
Reputation: 17,316

Post » Fri Mar 04, 2016 7:59 am

Edit. Thinking about this - what would be great is having an ability to create (during runtime) a combined shadow + colour sprite, that behaves as one object and fades over a defined distance as per Ashley's demo.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
69
S
18
G
65
Posts: 2,195
Reputation: 41,465

Post » Fri Mar 04, 2016 10:14 am

eli0s wrote:@Ashley , The trick with multiplying the background on top of the lights is clever indeed. However I'm not sure how it will work with multiple layers, like when we want to achieve parallax, or other z ordering effects.


It is impossible to use this technique and parallax layers - or am I missing something?
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
69
S
18
G
65
Posts: 2,195
Reputation: 41,465

Post » Fri Mar 04, 2016 10:32 am

@Colludium i got a problem too with parallax i make some changes but still when in parallax shadows are in different places so an idea will be helpfull.
B
18
S
3
G
1
Posts: 248
Reputation: 2,348

Post » Fri Mar 04, 2016 10:40 am

@spy84 - it appears to be impossible because of the way the layers are rendered, but I await advice from anyone with more experience of doing this than I have. I suspect that we will need to be able to render a group of layers together before then rendering that on top of layers we want to appear behind.... I might try some experimenting with the Canvas plugin to see if I can get that to work.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
69
S
18
G
65
Posts: 2,195
Reputation: 41,465

Post » Fri Mar 04, 2016 11:15 am

newt wrote:Lol I'd settle for shadow casters that weren't additive like in Thomas was alone.
http://store.steampowered.com/app/220780/


With only one light source you can easily achieve this look by putting the light/shadow caster into a separate layer, have the light have 100% opacity and lower the layer's opacity.

See the following example.

https://www.dropbox.com/s/gatskbxmb1ogo ... .capx?dl=0

You can achieve similar result with the alpha threshold effect also, but the first method is much easier.
composer - multimedia artist
www.eli0s.com/en/
B
67
S
26
G
4
Posts: 1,145
Reputation: 9,622

Post » Fri Mar 04, 2016 11:55 am

Yeah that's a viable solution.
Interesting that 100% doesn't mix.
Thanks @eli0s
Image ImageImage
B
166
S
49
G
154
Posts: 8,105
Reputation: 100,231

Post » Fri Mar 04, 2016 1:29 pm

@newt , you are welcome!

Since the shadow caster draws shadows and the 100% light is drawing pure black, there aren't any values mix. So, we get a matte black value. lowering the layer's opacity simply makes the matte black shapes see-trough...

By the way, @Ashley, have you noticed that if you apply a sine behavior to two or more lights everything break? If the sine is active that is. Pinning the light on a sprite that has the sine works fine!
And thanks for the tutorial!
composer - multimedia artist
www.eli0s.com/en/
B
67
S
26
G
4
Posts: 1,145
Reputation: 9,622

Post » Fri Mar 04, 2016 2:59 pm

Hi everyone. I have recently begun to do some prototyping for a game that is going to be based a lot around light and darkness. I did some research with Construct2 and realized both the potential and limitations of the Shadow Light object.

I did some experimentation and came up with almost identical solution as in Ashley's tutorial. And weirdly enough I posted my findings and suggestions to Scirra the same day as the tutorial was posted... Some kind of omen? Perhaps, but I rather believe in creepy coincidences.

As I have already posted my suggestions to Scirra I thought it could be a good idea to post them here as well, to get feedback from you end-users.

Following Ashley's principle of "putting light in the darkness", rather than putting "shadows in the light", would it not be the best solution if the Shadow Light object produced an opaque layer with the falloff gradient already in place inside the object? If the shadows and the falloff are just one object it becomes very easy to blend several lights together. You just Screen or Add/Dodge them and they will blend nicely on just one single layer. And this single shading layer is all that you need to blend with your background. Removing (or adding) shadows manually from unwanted areas becomes very easy by just placing something bright or dark on top of the Shadow Light objects in the same layer.

The advantages of this is:

• Only one single layer is needed for shading your levels.
• No need for nested layers.
• The amount of Shadow Light objects is not dependent on how many layers you have. This allows for easy dynamic creating and destroying of an arbitrary amount of Shadow Light objects.


If the falloff is (internally inside the object) multiplying the shadows, that could lead to interesting effects. Like if the falloff had a bitmap like the Sprite object, that would allow for a custom shaped falloffs, like tinted colours and shapes. For example, imagine if you have a mounted lamp on a wall, and you want to place a light source on it, you would want the lamp to cast shadows on the wall. You could then have a customized falloff that matches your lamp sprite, creating the illusion that the lamp is also casting shadows on the wall. Perhaps even play animations, which would be handy for flickering light sources such as torches.

Do these suggestions make sense?
If you users out there would create a game with shadows and light, would you prefer a method similar to what I have described here?
Would these features be helpful, both technically and artistically?

At least I think so, but I'd love to hear other's opinion on this.
B
3
Posts: 5
Reputation: 185

Post » Sat Mar 05, 2016 3:02 pm

Anything that'll allow me too use multiple light sources and many shadows without WebGL is all I need. Been asking for this since 2014, along with an update to Sprite Font.

Instead, we get more exporters which are removed months later.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
79
S
12
G
7
Posts: 961
Reputation: 10,717

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests