Skip to content

Add comp_thingsectorlight property - #2393

Closed
elf-alchemist wants to merge 11 commits into
fabiangreffrath:masterfrom
elf-alchemist:comp_thingsectorlight
Closed

Add comp_thingsectorlight property#2393
elf-alchemist wants to merge 11 commits into
fabiangreffrath:masterfrom
elf-alchemist:comp_thingsectorlight

Conversation

@elf-alchemist

@elf-alchemist elf-alchemist commented Aug 30, 2025

Copy link
Copy Markdown
Collaborator

Test WAD:
transferred_sector_light.zip

As per the discussions on the cross port server:

Alongside the fake heights transfer (242), Boom also introduced two separate line specials that individually transfer floor and ceiling light levels (213 and 261) onto a tagged sector. Normally, in Boom and CL9, any Things present in said sector will be lit according to the sector's normal light level. MBF, however, changed this behavior to decide a Thing's light level using the average of the transferred floor and ceiling light levels, instead.

Not only is the MBF behavior is incredibly unpopular among mappers, the choice of which behavior is also widely inconsistent among ports. Some ports will only use the Boom behavior of defining a Thing's light level based on the true sector, some will only use the MBF behavior and others will only read the transferred floor light level, instead:

  1. Woof/DSDA on -complevel 09 -- real sector light
  2. Woof/DSDA on -complevel 11, or later -- average transferred light
  3. Eternity -- average transferred light
  4. Helion -- average transferred light
  5. Odamex -- average transferred light
  6. GZDoom -- floor light only
  7. EDGE-Classic -- real sector light
  8. KEX on boom2.02 -- real sector light
  9. KEX on complevel9, or later -- floor light only

This new compflag is an improvement on ID24 spec's comp_thingfloorlight, designed to supersede it.

comp_thingsectorlight, "Things are lit according to transferred light level"
Defaults to 0 on all complevels, unless modified by the OPTIONS lump

* 0, Boom model -- uses the true sector light level 
* 1, MBF model -- uses the average of the transferred floor/ceiling light levels
woof0047 woof0048

@elf-alchemist

elf-alchemist commented Dec 14, 2025

Copy link
Copy Markdown
Collaborator Author

Comment thread src/g_game.c Outdated
BIND_COMP(comp_friendlyspawn, 1, "Things spawned by A_Spawn inherit friendliness of spawner");
BIND_COMP(comp_voodooscroller, 0, "Voodoo dolls on slow scrollers move too slowly");
BIND_COMP(comp_reservedlineflag, 1, "ML_RESERVED clears extended flags");
BIND_COMP(comp_thingsectorlight, 0, "MObjs are lit according to the average of transferred light levels");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"MObjs" is an internal term used in Doom code. I think we should use "things" here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the value of comp_thingsectorlight be set to 1 by default? I think most MBF/MBF21 maps were tested using this lighting model.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of formalizing this is that mappers do not want that to be the default. I've discussed with a few mappers already and it seems exceedingly unlikely to cause any problems.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"MObjs" is an internal term used in Doom code. I think we should use "things" here.

Fixed in 74dfc8f, using "sprite" instead, as I don't like the use of "thing" for the in-world entities, it's too generic of a word

Comment thread src/g_game.c
comp[i] = *demo_p++;

// comp_voodooscroller
if (count < MBF21_COMP_TOTAL - 2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove MBF21_COMP_TOTAL?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it'd have to be updated on any PR that adds new comp_* properties -- DSDA just uses the plain numbers as well. Is the readability hindered that much?

Comment thread src/r_voxel.c Outdated
: (thing->subsector->sector->lightlevel >> LIGHTSEGSHIFT);
int lightnum = comp[comp_thingsectorlight]
? lightlevel_override
: thing->subsector->sector->lightlevel;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace formatting error?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 74dfc8f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants