A Map that changes from Day to Night.

So I recently was thinking to myself about coding a new RP gamemode for Garry’s Mod and I was thinking that it would be sweet if I could make a map where it goes from day to night.

I stumbled across a fallen project on Facepunch where users attempted to code a program which would change the map from day to night. The code had worked at one point, but never to the extent I had hoped. It didn’t get very dark and apparently didn’t look good indoors. With the latest Garry’s Mod updates, it doesn’t work at all anymore.

I’m new to mapping, but is it at all possible to make a map that has a changing skybox and lighting to make it go from day to night?\

The lua code I mentioned before can be downloaded here. The original was taken off garrysmod.org apparently but this is a reupload. http://www.garrysmod.org/downloads/?a=view&id=75912

The original topic for the code can be found here as well. http://www.facepunch.com/showthread.php?t=298007

In my amateur knowledge, no.
Keep in mind I don’t know everything.

Sure, give me boxes, at least I know I’m dumb when it comes to this topic… :colbert:

Not properly, no. You can fake it with various lua scripts but they’re all fairly hacky and don’t look very good overall. Most of the ones I’ve seen/tried wrecked the lighting of the map.

You can’t do it well without making a mod and writing quite a few lines of code.

The thing is that before the “Day/Night” program that I ran into, people thought that changing the map from day to night was simply impossible. So something tells me that it is possible (by possible I mean possible to make a day to night feature), but difficult.

Does anybody have any ideas on how I could tackle this? I’ve taken two years of computer science and I’m actually really good with code (despite the fact that I have yet to code anything besides a homework assignment), but I’m stumped on how I could go about doing this.

It would be possible to have the skybox change to a night one after a set time (timed with the Lua day and night script) but the lighting wouldn’t be able to be changed though.

Pretty much what he’s saying
I’ve tried it before; makes the lighting look horrible and on big maps it destroys framerates

Well in TS the lighting was ‘hacked’ into a day/night plugin, by changing the serverside brightness, this lowered all lights, inside and out. Never got a good effect there either.

Could work fine in a smaller map, by building it into the map, but never in a full scale rp map.

Well, the final option would be to make two version of a map, and have a map change every 12 hours or so. Using color_correction entities, you possible could give some illusion of evening/morning.

If you had a script that would save player values/locations/door ownerships/props and whatnot, you could re-initialize everything in the new map.

Couldn’t imagine though, I don’t know squat about Lua.

Its possible, I have seen it done, will see if I can find out how he did it.

PERP 2 had this effect and i think it looked fairly good, but yet agian i never got much time to experience it.

There’s code still available which still works. I’m using it in my RP map, and I’d consider it a big map, what with it being stacked on top of itself 3 times.

http://www.adamncasey.co.uk/upload/image/2276/d/t http://www.adamncasey.co.uk/upload/image/2278/d/t http://www.adamncasey.co.uk/upload/image/2280/d/t http://www.adamncasey.co.uk/upload/image/2282/d/t http://www.adamncasey.co.uk/upload/image/2284/d/t http://www.adamncasey.co.uk/upload/image/2286/d/t
http://www.adamncasey.co.uk/upload/image/2277/d/t http://www.adamncasey.co.uk/upload/image/2279/d/t http://www.adamncasey.co.uk/upload/image/2281/d/t http://www.adamncasey.co.uk/upload/image/2283/d/t http://www.adamncasey.co.uk/upload/image/2285/d/t http://www.adamncasey.co.uk/upload/image/2287/d/t

There’s not very much impact on FPS at all, and even on slower PC’s there’s only a few seconds of lag then it all clears up. Downsides are that it screws up static model lighting, but I don’t really mind.

You can toggle an environment light on and off, but it will look rubbish due to the absence of reflection.

I always thought venetian did a REALLY good job of it’s day/night cycle. Maybe see how that was done with Entspy or whatever.

I wish… Global dynamic rad.

ok find a way to make this dynamic

Where is the confusing rating?

I just gave him a box instead. :v:

I have been thinking about this for a while, it would be great if somebody could perfect this idea.

I wish source had real time ray tracing. :3: