Night and Day?

Talk about anything related to Platinum Arts Sandbox here!
The Writer
Member
Member
Posts: 51
Joined: June 21st, 2011, 10:02 am

Night and Day?

Postby The Writer » November 10th, 2011, 3:00 pm

Is it possible to make day and night in sandbox? Like after a certain time elapse it goes from day to night, and the sun and moon move? If so, how do you do it?
evrything fades, but nothing ever really ends.

User avatar
Tony
Member
Member
Posts: 113
Joined: November 13th, 2011, 5:04 am
Name: Tony
Location: Cincinnati, Ohio, USA

Re: Night and Day?

Postby Tony » November 14th, 2011, 1:20 pm

I dunno man... night time is when the *really* scary monsters come out.

I suppose you could go to a cutscene, and have the skybox switch while you were away.
Or, you could teleport to an identical map where the skybox was the only difference.
Or some such craziness. To make it feel realistic though, you'd want to switch it several times in increments of dusk/dawn, to twilight, and night/day.

I dunno man, I am new around here. I am still trying to get past the flowerpot. (Mario Bros. reference)
Rockin' the Web for All the Right Reasons

Image Mind Reading Mastered
Image Canonize Juan Valdez and his Burro

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Night and Day?

Postby arcones » November 14th, 2011, 2:47 pm

Tony is correct. It would be possible, be extremely hard to create a day/night cycle.
Image
Want a user bar like this one? PM Leo!

User avatar
kid matthew
Developer
Developer
Posts: 468
Joined: August 11th, 2009, 5:28 pm
Name: Matthew
IRC Username: Kid_matthew
Location: Land of Sandbox.

Re: Night and Day?

Postby kid matthew » November 14th, 2011, 4:55 pm

If some one was brave enough you can try do this http://www.youtube.com/watch?v=1YWiovHk ... re=related or http://www.youtube.com/watch?v=L4yK-0Ny ... re=related
The guy already offered some help.
He is usually in the Sandbox IRC.

Cheers,
Matthew
Lost Lands Work In Progress <3 viewtopic.php?f=10&t=2522 <3

Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Night and Day?

Postby Hirato » November 14th, 2011, 10:06 pm

Cube 2 was never made for day/night cycles. You'd need realtime lighting or at least several batches of lightmaps corresponding to set stages of the day (note there is a soft limit of 255 lightmaps per map before weird stuff happens)
Neither of which will likely be done.
The second can be achieved with using an otherwise near identical map for a different part of the day (dusk, dawn, afternoon, night). but this has the extra obstacle of transferring the player and all the other creatures seamlessly. I can probably see if I can make this easier somehow (but this will require otherwise identical maps)

As for the videos matthew posted, they're a rather poor way to go about it.
Basically you light the map and then cycle ambient depending on the part of the day, this has obvious caveats. You can only light the map for one stage of the day (this will probably be night time) and when outside that time, you will literally have no contrast or detail in the lighting (as you can see in the video, everything looks really flat and otherwise bad)

If you want to go this route, experiment using (co)sine curves defined by manipulating lastmillis at first. (note, trig functions use degrees)
For an RPG map you'll probably want the time to be consistent and be at a certain time when you start the game, so use a global variable for that and increase it by curtime on each of the player's update cycles.
This is not a url, clicking it is pointless

The Writer
Member
Member
Posts: 51
Joined: June 21st, 2011, 10:02 am

Re: Night and Day?

Postby The Writer » November 16th, 2011, 8:02 pm

to everyone but hirato who replied: thank you for the ideas... i will try it out.
to hirato: can you say that again?... mabey in english?... sry but i have read your post several times and you always lose me at... you'd need real time lighting... and so on... yeah would you be willing to explain?
evrything fades, but nothing ever really ends.

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Night and Day?

Postby arcones » November 16th, 2011, 9:21 pm

To dumb down Hirato's incredibly smart post :P

Hirato wrote:Cube 2 was never made for day/night cycles.
Cube 2 was not made for day/night cycles and therefore won't support it.
Hirato wrote:You'd need realtime lighting or at least several batches of lightmaps corresponding to set stages of the day (note there is a soft limit of 255 lightmaps per map before weird stuff happens)
Neither of which will likely be done.
Realtime lighting basically is lighting in real life. From dawn till dusk essentially. It's what you would see in a real day. In order to do that, you would need batches or groups of lights set at the correct stages for each part of the day (in order to create the right atmosphere, i.e. morning, noon, and night).

Hirato wrote:The second can be achieved with using an otherwise near identical map for a different part of the day (dusk, dawn, afternoon, night). but this has the extra obstacle of transferring the player and all the other creatures seamlessly. I can probably see if I can make this easier somehow (but this will require otherwise identical maps)
Hirato is essentially saying that the day/night cycle can be faked by creating identical maps for each part of the day. However, transferring the player and all the entities necessary for each map would be a problem (NPC's, objects, items, etc).

Hirato wrote:As for the videos matthew posted, they're a rather poor way to go about it.
Basically you light the map and then cycle ambient depending on the part of the day, this has obvious caveats. You can only light the map for one stage of the day (this will probably be night time) and when outside that time, you will literally have no contrast or detail in the lighting (as you can see in the video, everything looks really flat and otherwise bad)
After watching the videos, I see what Hirato is talking about. Essentially, the "light" from the sun, or in the case of the day/night cycle, is ambiance which does not create the proper lighting at all, which in turn produces REALLY flat looking maps (despite the fact that there is supposed to be light).

Hirato wrote:If you want to go this route, experiment using (co)sine curves defined by manipulating lastmillis at first. (note, trig functions use degrees)
For an RPG map you'll probably want the time to be consistent and be at a certain time when you start the game, so use a global variable for that and increase it by curtime on each of the player's update cycles.
Hirato will probably have to explain this one clearer even though I know what he is talking about :P

I hope that clears some things up a bit Writer ;D
Image
Want a user bar like this one? PM Leo!

User avatar
Captain_Ahab
Member
Member
Posts: 98
Joined: June 10th, 2009, 5:12 pm
Name: Richard

Re: Night and Day?

Postby Captain_Ahab » November 17th, 2011, 9:08 pm

because the problems stem from the way sunlight casts shadows as opposed to SB's static lightmaps, the most obvious solution might be to cycle day/night for an overcast day where directional shadows are minimized.
Change light levels as the day progresses with gamma and fog values
an overcast skybox and moving cloudbox and cloud layer to add to the effect of a cloudy stormy day... occasional lightning effects and thunder sounds??

with rain particles ( or snow for overcast snowy days ) and careful use of lighting and glow/spec maps, some nifty atmosphere/mood settings should be possible
Image

The Writer
Member
Member
Posts: 51
Joined: June 21st, 2011, 10:02 am

Re: Night and Day?

Postby The Writer » December 17th, 2011, 7:40 am

Arcones: thanks for dumbing that down for me it makes so much more sense now!
Captain _Ahab: interesting suggestion, though i'm not entierly sure how to execute it... if you are saying that in order to give a somewhat day/night experience there must alwas be some form of percipitation then that kinda sucks... if not then i gues i don't get what you are saying.
evrything fades, but nothing ever really ends.


Return to “Sandbox General Chat”

Who is online

Users browsing this forum: No registered users and 2 guests