Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Day to night cycle

Author
Message
Shaka
19
Years of Service
User Offline
Joined: 8th Sep 2006
Location: San Diego, CA
Posted: 9th Sep 2010 06:43
Hey every one, Ive done a little research and I've noticed that there hasn't yet been a fully functioning Day to Night cycle script. Or at least not that I have found.

The problem that people have faced is that the skybox is unable to change in the middle of a level, without having to go to a loading screen first. So here lies the problem. How do we seamlessly make the level switch from day to night without a loading screen and without making a drastic transition?

I might have found a solution to the problem, although I am not a scripter so I may be wrong. This may not be impossible, but then yet again, maybe it isnt. My idea is that what if you make a sky box that has sunrise, afternoon, eavening, and night time photos all in the same skybox. So if you were to just imagine making the skybox flat, you would see the color and objects in the sky slowly fade into the next. Then all you would have to do is make the skybox endlessly rotate at the speed in which the player desires.

For sunlight, now that we have the script to make a light basically follow a waypoint, you can have a long waypoint in which specific colored lights would follow in accordance to the sky box. Such as a white light for day time, orange-ish light for evening and a grey light for night. The lights would all move at the same rate the skybox rotates, making it seem as if the time of day is shifting right before the player.

I know this is a lot of very vague and imaginative ideas, but I think with a good group of scripters, this might be very possible. And this could open up a huge new element to our games.

rolfy
20
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 9th Sep 2010 14:20
You can change the skybox with a script in a trigger zone, I used this method a long time ago but only to change the skybox upon entering a new level, it had real problems though with the second skybox becoming fixed and you couldnteven change te skybox normally in the map editor afterwards, I didn't actually try to use it to change the skybox mid level but see no reason why it wouldnt work, you would still be left with the issue above though.
It would have to be a spherical skybox if your going to rotate it and the texture would be a big problem, though not maybe unfeasible.

Your main problem is that your asking for dynamic shadows on everyting, kinda defeats the purpose of lightmapping which is a huge factor in keeping down framerates. Its possible to bluff this a little and the player may not notice too much, might be easier to simply use lights with timers.

Thing is do you think you can create a level with enough gameplay in it to keep the player long enough for a whole day
Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 9th Sep 2010 19:41
I did this by creating a giant sky sphere and making it rotate around the player, with the ambience adjusting based upon a variable to follow the day/night pattern with the RGB colour of ambience changing with it.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Mr illusionest
17
Years of Service
User Offline
Joined: 5th Mar 2009
Location: Cairo , Egypt
Posted: 22nd Sep 2010 19:53
LOL Marc !!! What an idea !
I guess that changing the skyboxes is buggy , But Marc's idea seems the best right now .

Cheers

"I am the night visitor when everyone is sleep , and when the last light fades"
The illusionest

Login to post a reply

Server time is: 2026-07-26 05:22:26
Your offset time is: 2026-07-26 05:22:26