Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

[1.17] Light is not updated #40

Closed
toficzko opened this issue Mar 25, 2021 · 9 comments
Closed

[1.17] Light is not updated #40

toficzko opened this issue Mar 25, 2021 · 9 comments
Labels
bug Something isn't working fabric Fabric version of the mod

Comments

@toficzko
Copy link

toficzko commented Mar 25, 2021

After migrating my minecraft 21w10a vanilla server to fabric with latest starlight from releases (happens when Compiled locally too) The light is getting corrupted , What i mean by that is all light sources only illuminate one block , this happens on a clean server too

Here are some screenshots:

Vanilla:
vanilla2

[NOTE:] Sometimes the light fixes itself is some entities are around it. [Screenshot 2] it fixed near the glow squids this time but it’s not always the case

Starlight :

light

[EDIT: Updated the screenshots to look like they are supposed to]

@Spottedleaf Spottedleaf added bug Something isn't working fabric Fabric version of the mod labels Mar 25, 2021
@Spottedleaf
Copy link
Member

Looks like #25

Spottedleaf added a commit that referenced this issue Mar 28, 2021
- Completely rewrite how lighting is loaded in for clients
 Attempts to fix #25
 and #40
 The old hook was vulnerable to mods doing unexpected things, especially
 serverside. The old method also relied on unreliable ordering of events
 inside packet handling. New method just hooks directly into the
 packet handling methods to avoid conflicting behavior with mods and
 to create more reliable hooks.

- Completely rewrites internal scheduling of light tasks
 Old scheduling was very vulnerable to block updates completely
 overloading everything. The old scheduling was also incapable of
 indicating to the chunk system whether block updates or other
 light modifying tasks were pending for a chunk. The new
 scheduling now groups tasks by chunk (light update, needs lighting,
 edge checks) and simply drains tasks by chunks. In the event
 that there are a lot of block updates, they no longer pile up
 in a queue since they are just grouped onto their chunk, which
 will eliminate duplicate updates. And since it's a FIFO by chunk,
 the maximum latency for a light update to happen is simply the
 number of chunks queued. The new queue also tells the chunk
 system to not unload chunks until any lighting task is fully complete
 for that chunk and its 1 radius neighbours. This will eliminate
 problems where the light engine was never able to complete tasks
 before server shutdown. This also officially kills light suppression.
 Before you ask, no I'm not going to re-add lighting _bugs_ to my light
 engine. I want lighting to work, which means I need to fix it when
 it clearly doesn't work.

- Mark the vanilla light engine fields in LevelLightEngine as null
 This will break any mod expecting them to be non-null. But since
 we replace the light engine, it's better this way since it forces
 an explicit break rather than a silent break.
Spottedleaf added a commit that referenced this issue Mar 28, 2021
- Completely rewrite how lighting is loaded in for clients
 Attempts to fix #25
 and #40
 The old hook was vulnerable to mods doing unexpected things, especially
 serverside. The old method also relied on unreliable ordering of events
 inside packet handling. New method just hooks directly into the
 packet handling methods to avoid conflicting behavior with mods and
 to create more reliable hooks.

- Completely rewrites internal scheduling of light tasks
 Old scheduling was very vulnerable to block updates completely
 overloading everything. The old scheduling was also incapable of
 indicating to the chunk system whether block updates or other
 light modifying tasks were pending for a chunk. The new
 scheduling now groups tasks by chunk (light update, needs lighting,
 edge checks) and simply drains tasks by chunks. In the event
 that there are a lot of block updates, they no longer pile up
 in a queue since they are just grouped onto their chunk, which
 will eliminate duplicate updates. And since it's a FIFO by chunk,
 the maximum latency for a light update to happen is simply the
 number of chunks queued. The new queue also tells the chunk
 system to not unload chunks until any lighting task is fully complete
 for that chunk and its 1 radius neighbours. This will eliminate
 problems where the light engine was never able to complete tasks
 before server shutdown. This also officially kills light suppression.
 Before you ask, no I'm not going to re-add lighting _bugs_ to my light
 engine. I want lighting to work, which means I need to fix it when
 it clearly doesn't work.

- Mark the vanilla light engine fields in LevelLightEngine as null
 This will break any mod expecting them to be non-null. But since
 we replace the light engine, it's better this way since it forces
 an explicit break rather than a silent break.
Spottedleaf added a commit that referenced this issue Mar 28, 2021
- Completely rewrite how lighting is loaded in for clients
 Attempts to fix #25
 and #40
 The old hook was vulnerable to mods doing unexpected things, especially
 serverside. The old method also relied on unreliable ordering of events
 inside packet handling. New method just hooks directly into the
 packet handling methods to avoid conflicting behavior with mods and
 to create more reliable hooks.

- Completely rewrites internal scheduling of light tasks
 Old scheduling was very vulnerable to block updates completely
 overloading everything. The old scheduling was also incapable of
 indicating to the chunk system whether block updates or other
 light modifying tasks were pending for a chunk. The new
 scheduling now groups tasks by chunk (light update, needs lighting,
 edge checks) and simply drains tasks by chunks. In the event
 that there are a lot of block updates, they no longer pile up
 in a queue since they are just grouped onto their chunk, which
 will eliminate duplicate updates. And since it's a FIFO by chunk,
 the maximum latency for a light update to happen is simply the
 number of chunks queued. The new queue also tells the chunk
 system to not unload chunks until any lighting task is fully complete
 for that chunk and its 1 radius neighbours. This will eliminate
 problems where the light engine was never able to complete tasks
 before server shutdown. This also officially kills light suppression.
 Before you ask, no I'm not going to re-add lighting _bugs_ to my light
 engine. I want lighting to work, which means I need to fix it when
 it clearly doesn't work.

- Mark the vanilla light engine fields in LevelLightEngine as null
 This will break any mod expecting them to be non-null. But since
 we replace the light engine, it's better this way since it forces
 an explicit break rather than a silent break.
@Spottedleaf
Copy link
Member

1.0.0-RC1 has some fixes in the suspected area, can you re-test?

@toficzko
Copy link
Author

toficzko commented Mar 28, 2021

I re-tested it now

These are the results on a vanilla client with starlight for 21w11a from releases on the server:

issue

These are the results on a fabric client with the same version of starlight , as on the server:

light

The results sadly are the same

[ I forgot to mention that the mobs spawn there because of the lightning in the issue description]

@toficzko
Copy link
Author

toficzko commented Mar 28, 2021

And when switching back to vanilla on the server, the chunks get relighted and look like they are supposed to, with proper light

And the screenshots in the issue description , are very brightened up and i don't know why, but the other screenshots are ok , i need to update them

[EDIT: Updated]

@Spottedleaf
Copy link
Member

This is certainly very odd. I produced it locally and will check it out.

I'm very unsure about why this is happening on the dedicated server and not the integrated; all of my 1.17 testing has been on integrated and I never saw any of it but my first dedicated test showed it.

@Spottedleaf
Copy link
Member

This does not occur in 1.16.5.

@Spottedleaf
Copy link
Member

I see where the problem is. The block light recalculation is incorrect in 1.17, as it's not using an offset.
Given it's a snapshot build, I'll simply update the artifact in the release page.

@Spottedleaf
Copy link
Member

Update to the new version on the release page to fix

@toficzko
Copy link
Author

toficzko commented Mar 28, 2021

I already Compiled the latest commit myself and the light issues are fixed , thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fabric Fabric version of the mod
Projects
None yet
Development

No branches or pull requests

2 participants