Day/nigt in wads

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
samtam90
Posts: 33
Joined: Fri Sep 01, 2006 9:12 am
Location: Italy

Day/nigt in wads

Post by samtam90 »

Is there a wad with a working (or simulated) day/night cycle? Or something which actually shows that time flows from day to night and it has consequences on the map and/or gameplay?
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

Code: Select all

SCRIPT << 0 >> OPEN
{
   switch(timer())
   {
   case 0:
 		ChangeSky("SKY1NIGH","");
		fadeto(0,0,0,0.0,1300);
                break;
   case 360:
 		ChangeSky("SKY1DAWN","");
		fadeto(0,0,0,0.3,1100);
		delay(1500);
                break;
   case 600:
		ChangeSky("SKY1DAY","");
		fadeto(0,0,0,0.5,1000);
		delay(1500);
                break;
   case 960:
		ChangeSky("SKY1DAWN","");
		fadeto(0,0,0,0.2,980);
		delay(1500);
                break;
   }
}
Closest I could get to any type of 'Dynamic Day and Night', however, there are a few (maybe annoying) touches in it:

It works more by real time, so you'll have to wait a lenghty while for the sky to change.

It doesn't work for the whole game, as in a global script, it resets on each level.

The timer used for that is also included here:

Code: Select all

SCRIPT 302 ENTER
{
   int t;

   while(TRUE)
   {
      t = Timer() / 35;

      HudMessage(d:t/60, s:":", d:(t%60)/10, d:t%10;
                HUDMSG_PLAIN, 300, CR_RED, 0.95, 0.95, 2.0);
        delay(1);
   }
}
samtam90
Posts: 33
Joined: Fri Sep 01, 2006 9:12 am
Location: Italy

Post by samtam90 »

Thank you for that tutorial, but i'm searching a wad to play with a day/night. Or, at least, a map where i can see the effects of this.
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

ZDCMP almost had day and night. I don't think there are any wads which take advantage of this. Most of the maps I make have a day/night system, but I never finished them.
User avatar
Enjay
 
 
Posts: 27352
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Bio Hazard wrote:ZDCMP almost had day and night.
You mean the arena fight weather effects yes?

As another (and probably cruder example) I think I did something similar waaaay back on map 32 on my NJZD2001 wad. Dunno how it would look (or even work) these days.
User avatar
Belial
Posts: 1616
Joined: Wed Feb 09, 2005 3:09 pm

Post by Belial »

Zen Dynamics, map02.
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

Enjay wrote:
Bio Hazard wrote:ZDCMP almost had day and night.
You mean the arena fight weather effects yes?
No, I meant the day/night cycle I added with my part that Torm took out because he didn't want to control lighting over all the outside areas.
Seemed like a good reason to take it out to me.
User avatar
Enjay
 
 
Posts: 27352
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

I hadn't even realised that was in at any stage. :?
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

There should be a commented-out script in the scripts lump that took care of it.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Yeah, I remember trying to help get that working. It was a nightmare.
User avatar
Enjay
 
 
Posts: 27352
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post by Enjay »

Aha!

Code: Select all

//Commented Out by Tormentor667, Reason: It looks odd in outdoor areas, if the
//light of the sky changes, but the sectors light itself stays, someone might
//reactivate this feature, if he wants to apply this to 1000's of sectors :)
/*script 999 open // Time of day script
{
	light_fade (32,110,2625);
	delay (2625);
	light_fade (32,200,2625);
	delay (2625);
	Restart;
}*/
That'll be it then.
User avatar
Ultraviolet
Posts: 1152
Joined: Tue Jul 15, 2003 9:08 pm
Location: PROJECT DETAILS CLASSIFIED.

Post by Ultraviolet »

It's a lot easier if you don't detail stuff Tormentor-style. :P

Could be pretty good in GZDoom if you're primarily using dynamic lights and don't have any stepping-lit sectors. You keep the outdoor sectors at one light level, the indoor sectors that have light coming in from outside at a slightly lower level, and the closed indoor sectors at a very low light level. That's three tags for sectors without any other effects, and for each one with its own unique effect, you'd need another tag... But it ends up better than if you were using sector-based lighting.

It's too bad there's not a way to set up a flag system like DMFlags for determining sector effects. You could lay out a flag table in, I don't know, MAPINFO or something, with arbitrary help-text by each definition, and then have some special bit set that tells the sector to use what you've specified in the tag field as a flag sum instead. Then a plugin or config or whatever for whichever editor could make the various bits available as checkboxes with your arbitrary MAPINFO names beside them. Passing thought...
User avatar
Phobus
Posts: 5984
Joined: Thu May 05, 2005 10:56 am
Location: London
Contact:

Post by Phobus »

I've made a map that goes from being bright white to bright red and back again, as part of the sequence of events. It's not very big , but it's there. Shows how it could be done, but also just how many tags you'd have to use, even in such a small map.

White Light's the wad.
User avatar
Apothem
Posts: 2070
Joined: Sat Nov 29, 2003 7:13 pm
Location: Performing open heart surgery on an ACS compiler.

Post by Apothem »

I think that ZDCMP solution is probably the best out there. Unless you wanna add texture effects, which even then, wouldn't be that complicated. You'd just end up breaking up the delays into smaller pieces and modify a skybox accordingly.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Post by Project Shadowcat »

I thought about doing that through Ultra-Voilet's method all the way throughout my (20% complete) mod, but with a real time clock (and even a chronometer tucked away in the top-right of the screen). Time could step forward significantly through the author's ability to get a player from one area to another; however the author wants to do their intermissions.

It does sound easy, just a bit time-consuming and making sure all of the tags are correct.

I don't know. It seems cool on paper, but would one notice, even if the clock was slightly accelerated (ala The Sims, Grand Theft Auto III and beyond)?
Post Reply

Return to “General”