Page 1 of 1

Night Effects Slow down game.

PostPosted: Wed Jun 04, 2008 1:22 am
by Rux
In my game it will read your clock, and depending on what time it is a black transparent block makes it night time. But it always slows down the game a lot! No matter what. Is there away to simulate night effects without the slowdown?

Re: Night Effects Slow down game.

PostPosted: Wed Jun 04, 2008 2:32 am
by DST
Any fullscreen transparency will kill your fps, for the most part. It does slightly depend on how much of a hue/brightness change occurs, (white wispy clouds aren't too bad) but black...that's a 100% shift from the current values. The best way is to dim the rgb of some components, and have a different animation for background.
Taking the background out of the transparency equation will help a LOT.

I'd down the red and green by maybe 50 or 80 pts, and the blue by only half that, since moonlight often appears blue (even though its not). Your main character and powerups don't really need dimmed.

Sometimes you can get away with transparency, i dunno....what res are you using? In my 640x480 game, a red overlay flashes when you get hit, then fades out in about 1/3 of a second. When this happens, my cpu goes from its idle or active speeds of 12-50% up to 94%. This isn't optimal, but it didn't max the cpu, so i can handle it. Run your task manager in the background, with the game in a window so you can see the cpu. If your game idles at more than 20%, and is active at more than 60%, then transparency isn't your biggest issue.....

Re: Night Effects Slow down game.

PostPosted: Wed Jun 04, 2008 3:50 pm
by Rux
ok.... wow that a lot of animation changes..... :? I'll try

Re: Night Effects Slow down game.

PostPosted: Wed Jun 04, 2008 9:05 pm
by DST
well see if you can use rgb first, that would be much easier...

Re: Night Effects Slow down game.

PostPosted: Sat Aug 02, 2014 9:44 pm
by Zivouhr
DST wrote:Any fullscreen transparency will kill your fps, for the most part. It does slightly depend on how much of a hue/brightness change occurs, (white wispy clouds aren't too bad) but black...that's a 100% shift from the current values. The best way is to dim the rgb of some components, and have a different animation for background.
Taking the background out of the transparency equation will help a LOT.

I'd down the red and green by maybe 50 or 80 pts, and the blue by only half that, since moonlight often appears blue (even though its not). Your main character and powerups don't really need dimmed.

Sometimes you can get away with transparency, i dunno....what res are you using? In my 640x480 game, a red overlay flashes when you get hit, then fades out in about 1/3 of a second. When this happens, my cpu goes from its idle or active speeds of 12-50% up to 94%. This isn't optimal, but it didn't max the cpu, so i can handle it. Run your task manager in the background, with the game in a window so you can see the cpu. If your game idles at more than 20%, and is active at more than 60%, then transparency isn't your biggest issue.....


Interesting. Thanks.
I'll have to check the CPU monitor while playing my game as it included a day/night cycle, though I'll see if that affects the speed, as so far I think it's likely the fact the game is 100 MB that would affect the top speed. The game speed is where I want it, though it's adjusted to compensate for the giant game.