Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

My game has a day-time association with the scene, that the morning light will be different from the afternoon and the night. But I don't know how to make this difference.

Here is an example in Pokemon game:

enter image description here

I have an idea that put a layer on the top of the game with the transparency about 10 - 20%, and change its color depends on the time, but I don't know which color is good.

Are there any other mechanisms to do some kind of day/night cycle in a game of this style?

share|improve this question
    
What's the question exactly? –  doppelgreener Oct 30 '11 at 2:33
    
@JonathanHobbs I'd like to know the best way to make day light difference. –  DatVM Oct 30 '11 at 3:54
    
New sprites that suit a lightning condition that doesn't have anything to make those windows and roof shine. –  doppelgreener Oct 30 '11 at 3:59

3 Answers 3

up vote 9 down vote accepted

There are two ways to do this. The easy way and the way that will actually look like it's dark.

The easy way is exactly what you said: throw down a full-screen quad that darkens the scene. But:

I have an idea that put a layer on the top of the game with the transparency about 10 - 20%, and change its color depends on the time, but I don't know which color is good.

That's because there is no "good". There are only varying levels of bad. It will always look like what it clearly is: a bright scene that has been darkened. Real nighttime is not simply a bright scene that has been darkened. Different areas are darker in different ways.

The best you can do is run a bunch of tests and find the color that is least offensive. Nobody can give you a "good color", because such a thing does not exist. There is only "what you personally can tolerate for your particular scene".

The right way to do this is to have your artists redraw all the sprites for a darker scene. Obviously this is labor intensive, which is why most sprite-based games don't have day-night cycles.

Indeed, sprite games that did do some night-time scenes also had the advantage of using paletted sprites. In those cases, they simply created a special "night" palette for the sprites. This gave them the opportunity to tweak the colors for the best visual effect.

You could try something similar to this, but it would require you to use paletted sprites yourself.

share|improve this answer
    
Thank you very much! It's bad that we don't have much time for our artists. So maybe we have to accept the least offensive color! –  DatVM Nov 2 '11 at 5:45

From my very limited experience doing this type of thing in a couple games that I've done, to make it "darker", i.e. night time, I would do just like you said and add a black layer over the game, and make it closer to transparent than opaque.

For evening time, I would do the same thing, but with an orange color to give it a "dusk-y" feel.

If you want to make it get darker (or orange-er) gradually, then just gradually raise the opacity on the color over time.

That's what I would do anyway. I'm sure there may be a better way out there.

share|improve this answer
    
Can you give me the color code you experienced with? –  DatVM Oct 30 '11 at 3:55
    
@W.N I don't have any code on hand at the moment. What I would try is, make a black image the size of the screen. Load it into your game in front of everything else. Now if you increase the transparency of the black image, it should make everything behind it visible, while adding a dark shade over everything. If you cannot change the alpha values of the image in the framework/language that you are working in, decrease the opacity before you save the image in your image editing software, and make sure to save the image as a png as well. –  Nicholas Oct 30 '11 at 9:02

I have an idea that put a layer on the top of the game with the transparency about 10 - 20%, and change its color depends on the time, but I don't know which color is good.

Trial and error is a great thing. You've got the idea of it - an overlay of some sort would be the easiest. The suggestion to use orange for dusk, and black for night, is also a good one. But nobody here can tell you what colors to use to make your game look good - that's entirely up to you and your sense of design.

A much more complicated way to change the time of day is to generate an entirely new set of sprites for each period of the day. Most of these sprites would be simply shaded differently, as if you were using the above overlay, but this would allow other effects like streetlights and such.

share|improve this answer
    
Hmm, tried some colors but the result isn't very good. I'm very bad at graphic design. Can you give me some good color (RGB and alpha)? Thank you for replying. –  DatVM Oct 30 '11 at 3:55
    
@W.N. - "[N]obody here can tell you what colors to use to make your game look good." That includes myself. See Nicol Bolas' answer for why this isn't possible. –  dlras2 Oct 30 '11 at 14:36
    
(Any explanation for a downvote?) –  dlras2 Oct 30 '11 at 14:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.