Pocketmine-mp: Make server-sided lighting optional (1.2)

Created on 18 Aug 2017  路  4Comments  路  Source: pmmp/PocketMine-MP

Issue description

In MCPE 1.2 lighting is computed by the client. This already means significant reduction in network overhead due to light not being sent anymore. However, this can be used far more to servers' advantage than it currently is.

Server-sided lighting is needed for the following:

  • Mob spawning (not implemented)
  • Grass & crop growth
  • Ice melting
  • Daylight sensors (not implemented)

If your server doesn't use any of those things, you can safely ditch server-sided lighting. This offers the following benefits:

  • Chunk memory footprint reduction of ~40%
  • Faster I/O for McRegion and Anvil worlds due to not needing to convert light
  • No lag spikes when placing/breaking light sources

This issue is here as a self-reminder to implement this feature.

Core Obsolete

All 4 comments

Can't wait :)

@dktapps Isn't it already an option? chunk-ticking.light-updates

No, that only controls chunk light repopulation on chunk load, nothing more.

I'm going to close this since all of the mentioned benefits can be achieved without disabling lighting.

Disabling lighting entirely is undesirable due to the number of things that depend on it. It's not possible to have everything working correctly if lighting is not populated (for example crops always dying/always growing in dark caves), so I don't think carving out this needed information is a good idea. It's not possible to find some "middle ground" lighting where everything works as expected without it.

To rebut the above listed points:

  • Memory usage reduction benefit can be achieved without carving out lighting (see #2527)
  • Faster I/O is a red herring since it's already so fast that nobody cares (with ChunkUtils). Additionally, future improvements to lighting within the core will involve dropping disk light caches anyway (that's all they are, caches).
  • Light propagation being slow isn't an excuse to hack it out. Instead effort should be focused on improving its performance, since it's quite needed. Work is underway to improve performance of various parts of lighting handling (see #2429, also f5c1ccd0afb5bd5228690c1b054f04831e021c30 and b9a2cf34c63d93aabcbf7091810dae5e3e8fd454).
Was this page helpful?
0 / 5 - 0 ratings

Related issues

SOF3 picture SOF3  路  20Comments

matcracker picture matcracker  路  17Comments

MisteFr picture MisteFr  路  18Comments

mal0ne-23 picture mal0ne-23  路  32Comments

zKoz210 picture zKoz210  路  27Comments