How to add lighting to classic maps legally?
- Trusty McLegit
- Posts: 264
- Joined: Sun Feb 07, 2016 8:42 pm
How to add lighting to classic maps legally?
With all the new lighting based effects surfacing in GZDoom, I figure it's time for a fully dynamic lighted version of the classic DOOM maps. I was wondering how I could make and release such a thing legally? Some system like what the new version of Brutal Doom (I know, sorry ) is using for it's map enhancement system? I assume I can't just release the modified versions of the maps legally.
- Caligari87
- Admin
- Posts: 6174
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: How to add lighting to classic maps legally?
Add light definitions to existing map objects (the lights.pk3 included with GZDoom already does this), use ZScript to iterate over the map sectors / linedefs and place lights where appropriate based on textures or existing lighting. In theory it's pretty simple to do this at runtime without any modification / redistribution, even simpler that Brutal Doom's awful hardcoded method (see DarkDoomZ for example). In practice it's going to take a fair bit of experimentation because the IWAD maps are not lit consistently, and there are sane limits required for dynamic lights to avoid performance/rendering issues.
- Trusty McLegit
- Posts: 264
- Joined: Sun Feb 07, 2016 8:42 pm
Re: How to add lighting to classic maps legally?
I have zero knowledge of zscript, if you have time, could you explain how to do this?Caligari87 wrote:use ZScript to iterate over the map sectors / linedefs
Well I mostly want to light E1 to start with, and that shouldn't be too bad as it's mostly indoors.Caligari87 wrote:In practice it's going to take a fair bit of experimentation because the IWAD maps are not lit consistently, and there are sane limits required for dynamic lights to avoid performance/rendering issues.
Re: How to add lighting to classic maps legally?
I'd throw in a map checksum check first too before "patching" in the additional lights.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: How to add lighting to classic maps legally?
Ideally this could be done as an official but optional part of the engine itself. I wonder if we can manage to get lighting setups for all the IWADs and maybe even some of the popular PWADs together...
Re: How to add lighting to classic maps legally?
While I appreciate this idea and am definitely up for it, I'm a little curious what performance would be like once the vanilla maps get filled with dynamic lights... ?Graf Zahl wrote:Ideally this could be done as an official but optional part of the engine itself. I wonder if we can manage to get lighting setups for all the IWADs and maybe even some of the popular PWADs together... ;)
Re: How to add lighting to classic maps legally?
With their simplistic architecture and small map size? Should still be fine. Bigger, far more complicated maps have been heavily loaded with dynamic lights without any major issues. And if someone is in a situation where they can't play the light-enhanced maps because their computer isn't up to it, then they have only missed out on an extra. Nothing has been broken for them.
[edit]
Of course, another, possibly even easier, method to do this (at least from the perspective of the person making the changes) would be to edit the maps in an editor (that's the easy part) then provide a patch made with one of the readily available patching tools so that people could modify their own copies of the maps.
[edit]
Of course, another, possibly even easier, method to do this (at least from the perspective of the person making the changes) would be to edit the maps in an editor (that's the easy part) then provide a patch made with one of the readily available patching tools so that people could modify their own copies of the maps.
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: How to add lighting to classic maps legally?
I like this idea. With ZScript it should be pretty simple work thanks to map checksums.
Plus it could be packed into a "maplights.pk3", like the other additions.
Plus it could be packed into a "maplights.pk3", like the other additions.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: How to add lighting to classic maps legally?
Depends on the computer. If we do this I'd go for targeting hardware as is on sale now, i.e. Geforce 1030 and up. With that, you can do lots of lights, i.e. several 1000 spread across the map.Nash wrote: While I appreciate this idea and am definitely up for it, I'm a little curious what performance would be like once the vanilla maps get filled with dynamic lights... ?
Being an optional part I see really no point catering to low end systems which cannot handle it. Yes, there's people out there still using such systems but they are a) the minority of users and b) their number is decreasing.
Worst case would be that they just have to run the engine without it.
It's the same with shadowmaps. You need a somewhat beefy system to be able to use them, and an even beefier system to have them work without affecting performance. Did that deter anyone developing and improving the feature?
Re: How to add lighting to classic maps legally?
Yeah, true. Sounds good at any rate. :) Hope it comes to fruition!
- Chris
- Posts: 2940
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: How to add lighting to classic maps legally?
There's something to be said about efficiency too, though. We've long gone past the days of single-task systems, the game isn't the only thing that's going to put a load on the CPU and GPU. Just because a modern piece of hardware can theoretically handle 1000s of lights, is it necessary to use that many if you can use half that number with next to no visual degradation? "Just throw more hardware at it" and "use every ounce of hardware as if we're the only thing using it" is the circular pattern unnecessarily driving up hardware requirements, to where even over 3 billion bytes of memory isn't enough to run a minimal graphical OS and have a comfortable web browsing experience. Where no matter how much you upgrade your system, it feels like everything's on the brink of starvation.
When I was learning programming growing up, there was a coveted skill in doing as much as you can with as few resources as you can. Nobody seems to really care about that anymore these days. For sure it can be quite bumpy when there's a paradigm shift in how you design for efficiency (e.g. the advent of multi-core processing made it so optimizing for type of system worked against the other type). But if it comes to using twice as many hertz and rams to get 10% more flashy lights, is that something worth taking considering you're not the only thing that's running on the hardware? That whole diminishing returns thing.
When I was learning programming growing up, there was a coveted skill in doing as much as you can with as few resources as you can. Nobody seems to really care about that anymore these days. For sure it can be quite bumpy when there's a paradigm shift in how you design for efficiency (e.g. the advent of multi-core processing made it so optimizing for type of system worked against the other type). But if it comes to using twice as many hertz and rams to get 10% more flashy lights, is that something worth taking considering you're not the only thing that's running on the hardware? That whole diminishing returns thing.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: How to add lighting to classic maps legally?
Ouch!
You do not run games in parallel with costly background tasks. That aside, the lights are 95% GPU side, there is very little CPU load on them, especially when I finally find the time to optimize the data structures to make them less redundant.Chris wrote:There's something to be said about efficiency too, though. We've long gone past the days of single-task systems, the game isn't the only thing that's going to put a load on the CPU and GPU.
Of course not. But I firmly stand on the "If we do it let's do the best we can" standpoint. If a map needs lots of lights to look right you do not want to cut back just because of such concerns.Chris wrote: Just because a modern piece of hardware can theoretically handle 1000s of lights, is it necessary to use that many if you can use half that number with next to no visual degradation?
If we are a game, we are the only one using it! For me that's the end of the story. Once you cannot assume that anymore, gaming would be a lost cause.Chris wrote: "Just throw more hardware at it" and "use every ounce of hardware as if we're the only thing using it"
This is a vaild concern when you talk about resource consumption in a desktop environment. But like I said: You cannot develop games under such a premise. Games have always been written under the assumption that they own the system's resources and I do not expect that to change in the future.Chris wrote: is the circular pattern unnecessarily driving up hardware requirements, to where even over 3 billion bytes of memory isn't enough to run a minimal graphical OS and have a comfortable web browsing experience. Where no matter how much you upgrade your system, it feels like everything's on the brink of starvation.
Of course not. This type of optimization costs time and money - and in most cases does not really improve matters. I'd make an exception for web browsers which have become the bane of computing: Every iteration increases system requirements more, and by now they have reached a state where even 8 GB are no longer sufficient to run them at standard settings. I had to disable all multiprocess "optimizations" in Firefox to get it down to reasonable memory levels again. But that doesn't translate to a game that doesn't fill the RAM with useless clutter. Of course, if you run a mod like BoA, you just need at least a GB of free RAM - but that's not really the engine's fault.Chris wrote: When I was learning programming growing up, there was a coveted skill in doing as much as you can with as few resources as you can. Nobody seems to really care about that anymore these days.
How did you come up with these numbers? The reality is different: On modern graphics hardware the GPU is actually mostly idle when running GZDoom. So the choice is not 10% more effects for twice the horsepower but 10x as many lights without having any performance impact at all. Unless, of course, you are the proud owner of an OpenGL 3 graphics card and would be shut out. But like I said, those cards are the past. Even a low end graphics card of the most recent generation would still run circles around the data given to it by GZDoom on an IWAD level.But if it comes to using twice as many hertz and rams to get 10% more flashy lights
Re: How to add lighting to classic maps legally?
Two problems I see:
1. The classic Doom maps don't follow a realistic lighting model. By this, I mean that there aren't nearly enough lamps (be it actors or textures) and whatnot that would light the rooms properly.
2. How are areas under the sky supposed to be lit? I wish there was some kind of simulated sunlight system for sky sectors.
1. The classic Doom maps don't follow a realistic lighting model. By this, I mean that there aren't nearly enough lamps (be it actors or textures) and whatnot that would light the rooms properly.
2. How are areas under the sky supposed to be lit? I wish there was some kind of simulated sunlight system for sky sectors.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: How to add lighting to classic maps legally?
True, but what you can do is add some light to existing light textures to enhance the look a bit. It should be obvious that "throw as many lights at the problem as possible" is not the correct approach.
Re: How to add lighting to classic maps legally?
@ Chris:
You are one of the people on this forum that I greatly respect and admire because of all the work you've done towards creating a competent sound backend which not only competes with FMod but did so competently so we could replace it with your system - which in turn allowed us to relicense the engine to a standardised OSI license which is far more familiar to us and more well-studied than a vague mix of commercial and proprietary and BSD/MIT licenses - and not only that, you actually helped us do it! - so please don't take this the wrong way.
But lately when I see a lot of your posts, they seem to be of fear about anything other than whatever may presently be the status quo at the present time. If it's someone who complains about a change that's already been implemented you frame it in such a way that people don't like progress - but if it's a change that's yet to be made you have what seem to be strong concerns about it before it happens.
@ Graf:
Chris does have a valid point, however, that the game isn't the only thing running the GPU. As you already pointed out, web browsers do it, but also to some extent the OS does, too. While Windows 8 and 10 are far less consuming of GPU resources than 7 was for obvious reasons, the same is not said of the Linux world. I don't know what kind of resources KDE and Cinnamon use, but they do seem GPU-heavy to me, and I have no idea if this plays well with games. It's poor design, of course, if they consume more than 5% of GPU resources, but like I said I don't use them regularly. There is of course, browsers, and whatever half a dozen Electron apps that a user has running in the background (such as game launchers, Twitch, or whatever else). Boggles the mind how Electron became such a prominent platform to develop this crap on. (And a lot of it is crap - let's be honest)
Of course, my opinion about that is - if you run such costly GPU things in the background - that's all on you. Disable hardware acceleration where-ever you can if you have a weaker GPU. Or avoid running them at all. That's not GZDoom's fault.
You are one of the people on this forum that I greatly respect and admire because of all the work you've done towards creating a competent sound backend which not only competes with FMod but did so competently so we could replace it with your system - which in turn allowed us to relicense the engine to a standardised OSI license which is far more familiar to us and more well-studied than a vague mix of commercial and proprietary and BSD/MIT licenses - and not only that, you actually helped us do it! - so please don't take this the wrong way.
But lately when I see a lot of your posts, they seem to be of fear about anything other than whatever may presently be the status quo at the present time. If it's someone who complains about a change that's already been implemented you frame it in such a way that people don't like progress - but if it's a change that's yet to be made you have what seem to be strong concerns about it before it happens.
@ Graf:
Chris does have a valid point, however, that the game isn't the only thing running the GPU. As you already pointed out, web browsers do it, but also to some extent the OS does, too. While Windows 8 and 10 are far less consuming of GPU resources than 7 was for obvious reasons, the same is not said of the Linux world. I don't know what kind of resources KDE and Cinnamon use, but they do seem GPU-heavy to me, and I have no idea if this plays well with games. It's poor design, of course, if they consume more than 5% of GPU resources, but like I said I don't use them regularly. There is of course, browsers, and whatever half a dozen Electron apps that a user has running in the background (such as game launchers, Twitch, or whatever else). Boggles the mind how Electron became such a prominent platform to develop this crap on. (And a lot of it is crap - let's be honest)
Of course, my opinion about that is - if you run such costly GPU things in the background - that's all on you. Disable hardware acceleration where-ever you can if you have a weaker GPU. Or avoid running them at all. That's not GZDoom's fault.