DRAFT - First version of a GameInfo lightmode

Moderator: GZDoom Developers

Post Reply
User avatar
merlin86
Posts: 153
Joined: Tue Jan 29, 2008 4:02 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: nVidia with Vulkan support
Contact:

DRAFT - First version of a GameInfo lightmode

Post by merlin86 »

Hello everyone!
Before making a draft PR I would like to discuss what I made : a (hopefully) working MAPINFO Gameinfo section for lightmode, instead of the map definition. ( IIRC Xaser wrote something about this on Doomworld forums, but I don't know if something like that has been made)

I modified the method getRealLightmode with the following logic:

// The rules are:
// 1) if the map sets a proper light mode, it is taken unconditionally.
// 2) if someone sets a light mode in the gameinfo, this is used.
// 3) if the user sets gl_maplightmode, this is being used.
// 4) if not for 3D use lightmode Doom. This is for the automap where the software light modes do not work
// otherwise use lightmode Doom or software lighting based on user preferences.

and then updated where this method is called.

Being my first C++ contribution I might have got something wrong ( I admit I used Copilot and read some documentation for fixing why I had a nullptr while calling GameInfo->LightmodeFromGameinfo (derp)).

Anyway here my dev branch : https://github.com/LuciferSam8086/gzdoo ... omGameinfo

For testing it just create a MAPINFO with something like that:

Code: Select all

gameinfo 
{ 
	lightmode=3
} 
I tested a bit and seems to work.

So before I make a PR I would like to discuss, and if you want I can make a draft PR and keeping the conversation on Github.
Thank you :)
User avatar
Rachael
Posts: 13913
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: DRAFT - First version of a GameInfo lightmode

Post by Rachael »

merlin86 wrote: Fri May 16, 2025 4:59 pm
// The rules are:
// 1) if the map sets a proper light mode, it is taken unconditionally.
// 2) if someone sets a light mode in the gameinfo, this is used.
// 3) if the user sets gl_maplightmode, this is being used.
// 4) if not for 3D use lightmode Doom. This is for the automap where the software light modes do not work
// otherwise use lightmode Doom or software lighting based on user preferences.
I don't have a strong opinion here, mostly because others have quite vociferous opinions and I'd rather not argue with anyone on this subject, it's way too contentious for my taste.

However, from a developer perspective, you might consider that gl_maplightmode is strictly for testing purposes. I personally wouldn't mind if it gets cheat-locked, because it is intended to take precedent over everything else - for the simple reason that, it's meant to be a way for you (as a mapper) to see how your map will look in different light modes in case you want to adjust it. But there's my two cents.
User avatar
merlin86
Posts: 153
Joined: Tue Jan 29, 2008 4:02 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: nVidia with Vulkan support
Contact:

Re: DRAFT - First version of a GameInfo lightmode

Post by merlin86 »

Hi Rachael,
I mean the original was without my point, I just added a step.
I think my point 2) is for modders / level designers too, so they can setup a standard light mode for 99% of their maps except maybe 1 or 2 with a specific lighting mode for their artistic vision.

I think it could be even expanded with a LightModeForced and being put in 0) but with a giant warning everytime someone starts a new game, something like
"You are forcing the light mode of the game but there are light modes setup on MAPINFO, you might ruin your experience / artistic vision with this. Press Y to continue"

IMHO in this way we make happy
1) Modders
2) "Power users" they want to play with such thing but with a giant warning so they cannot complaint if the map looks bad

And I think some people are happy too even without implementing the LightModeForce setting.
User avatar
phantombeta
Posts: 2159
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: DRAFT - First version of a GameInfo lightmode

Post by phantombeta »

Isn't this already possible for modders? Wouldn't defaultmap or adddefaultmap work?

Code: Select all

adddefaultmap {
    lightmode = 4
}

map MAP01 "Test" {
}
This works fine here.

IMO modders shouldn't get to force a light mode on the user, either, only mappers. That's a big can of worms, and people would very much abuse it to force their personal choice on others.
User avatar
merlin86
Posts: 153
Joined: Tue Jan 29, 2008 4:02 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: nVidia with Vulkan support
Contact:

Re: DRAFT - First version of a GameInfo lightmode

Post by merlin86 »

Welp, I was so focused on learning how the engine works I didn't notice that was possible.

My idea behind this was for a modder to setup a light mode only if there's none without overwriting the original MAPINFO and , of course, if there's already present one to not overwrite it.

But if that's already possible my bad. At least I've dipped my toes on GZDoom code and learned one thing or twos :)
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”