8
\$\begingroup\$

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?

\$\endgroup\$
3
  • \$\begingroup\$ What's the question exactly? \$\endgroup\$ Oct 30, 2011 at 2:33
  • \$\begingroup\$ @JonathanHobbs I'd like to know the best way to make day light difference. \$\endgroup\$
    – Luke Vo
    Oct 30, 2011 at 3:54
  • \$\begingroup\$ New sprites that suit a lightning condition that doesn't have anything to make those windows and roof shine. \$\endgroup\$ Oct 30, 2011 at 3:59

3 Answers 3

10
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 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! \$\endgroup\$
    – Luke Vo
    Nov 2, 2011 at 5:45
2
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ 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. \$\endgroup\$
    – Luke Vo
    Oct 30, 2011 at 3:55
  • \$\begingroup\$ @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. \$\endgroup\$
    – dlras2
    Oct 30, 2011 at 14:36
  • \$\begingroup\$ (Any explanation for a downvote?) \$\endgroup\$
    – dlras2
    Oct 30, 2011 at 14:37
1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ Can you give me the color code you experienced with? \$\endgroup\$
    – Luke Vo
    Oct 30, 2011 at 3:55
  • \$\begingroup\$ @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. \$\endgroup\$
    – Nicholas
    Oct 30, 2011 at 9:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .