Commit Graph

6 Commits

Author SHA1 Message Date
Spottedleaf 3e75d90810
Fix more cases of Bedrock breaking
This is still covered under the setting to re-enable this.
2020-06-20 14:54:17 -04:00
Aikar 3dc5ad343f
Improvements to chunk priority / bug fixes
ensure we add missing player tickets even if already full status
remove the player ticket throttler entirely... causes a lot of issues and
our system handles the role that it was serving now too.

increase max delays on farther out chunks load delay

remove -5 priority delay for distant chunks seemed it applied at weird times.

ensure if delay distance manager tick ever got left lingering it unsets on a chunk load.

Fixes #3572
2020-06-20 02:38:59 -04:00
Aikar 92d1247ee3
Improve light optimizations and fix bugs
Rewrites the Threaded task logic to no longer use 2 queues and instead
keep a single prioritized queue and do all of a chunks light tasks in a single batch

Fix a math issue in one place (Thankfully didn't seem to really be a common place since didn't notice anything)
2020-06-19 19:10:38 -04:00
Aikar 64666dc8b6
Improve Chunk Priority, Frustum Priority and Load Speed Algorithms
Fix bug where mojang has a -90 modifier in yaw resulting in us calculating
chunks to the players left rather than in front of them.

Drastically improve Frustum Prioritization function to reduce lag from its
calculations (Found it was being spammed really heavy on world add/teleport)

Also improved the logic behind choosing chunks to prioritize.

Add Priority tickets to a radius of 3 on any login, world chnge or teleport

This should help improve world load / chunk sending upon a player changing
locations by loading those chunks faster.

Improved the Player Ticket Delayer to be a little bit smarter about delays to
let closer chunks load a bit faster and only delay the farther out ones more.

This update will provide significant improvements to priority of chunks and
reduce the cpu cost of doing these calculations.

Fixes #3530
2020-06-10 01:20:57 -04:00
Aikar b2d81e21c5
Improve Chunk Prioritization and Internal Scheduler
In previous MC versions, we had a rather simple internal scheduler
for delayed tasks that would just keep pushing task back until desired
tick was reached.

The method it called to schedule the task changed behavior in 1.14, and now
this scheduler is not working nowhere near what it was supposed to be doing.

This was causing long delayed task to eat up CPU (In Oversleep for example)

Rewrite this to just use the CraftScheduler for scheduling delayed tasks.

Once this was fixed, it became quite clear the code that delayed ticket
additions for chunks based on distance was clearly not right, as it was
tested on the previous broken logic.

So the ticket delay process has been vastly revamped to be even smarter.
Chunks behind the player can load slower than the chunks in front of the player.
We also can delay ticket adding until one of its neighbors has loaded, as
this lets us get a smoother spiral out for the chunks (minus frustum intent).

Additionally on frustum previous commit inadvertently broke frustum trying to
fix an issue when the real fix lied elsewhere, so restore chunk priority so
it works again.
2020-06-09 03:17:25 -04:00
Aikar f0409edcd7
Drop Close region files patch, doesn't add any value.
Upon further knowledge of the system, it is known that region files
are closing properly, as well as this didn't help native memory use anyways.

This patch also caused issues compiling on a newer JDK being able to
release the jar to java 8 users.
2020-06-08 17:07:23 -04:00
Renamed from Spigot-Server-Patches/0538-Optimize-Light-Engine.patch (Browse further)