Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize ender dragon respawning #618

Closed
soulsoiledit opened this issue Jan 25, 2025 · 4 comments
Closed

Optimize ender dragon respawning #618

soulsoiledit opened this issue Jan 25, 2025 · 4 comments

Comments

@soulsoiledit
Copy link

soulsoiledit commented Jan 25, 2025

Is your feature request related to a problem? Please describe.

Ender dragon respawning is notoriously laggy, and this prevents the usage of fast end stone farms that utilize the mechanic of end stone regenerating under the exit portal during dragon respawning.
From what I understand, the lag is mainly caused by the search for exit portal blocks.

Describe the solution you'd like

Carpet AMS Addition and Optimized Dragon Respawn provided an implementation of a fix, through caching previously found portal block locations. It was mentioned that vanilla parity could not be ensured within the documentation. Since the latter is no longer updated, it would be nice to have a more vanilla friendly version of this optimization within Lithium for newer versions.

Describe alternatives you've considered

Using Carpet AMS.

Additional context

Examples of farms requiring this optimization:
https://www.bilibili.com/video/BV1iC4y1f7iX
https://www.bilibili.com/video/BV1nj411r7zr

@2No2Name
Copy link
Member

Can you link a world download directly so I can profile it

@soulsoiledit
Copy link
Author

I wasn't sure what would be the best example, so I've uploaded a few files. The first is a simple setup with a command block to remove the end crystal placed by the player, which is sufficient to demonstrate the problem when performing continuous placement. Second is the end stone farm from SciCraft's Blitz series. The third is the second end stone farm linked in the original description, which operates much faster. To turn on the latter two, there's levers near the center of the farm above the exit portal.

dragon-respawn-simple.zip
dragon-respawn-blitz.zip
dragon-respawn-fast.zip

@2No2Name
Copy link
Member

2No2Name commented Feb 1, 2025

Made a new optimization that shortcuts most of the search if not enough bedrock blocks are present in a certain cuboid volume. This could be improved further, but is probably already very acceptable. In the case of lots of bedrock nearby, lithium's optimization might not yield any speedup, but slow down the game even more.

It doesn't seem to change vanilla behavior: I placed a huge bedrock cube and placed the last crystal, then replaced the endstone with air. The resulting structure is the same as vanilla when using lithium's new optimization.

Image

In your dragon-respawn-simple (a normally generated end without the huge bedrock cube), I measure 420-520 milliseconds of lag when placing the last crystal when using vanilla.
With lithium, I get 7-12 milliseconds of lag when placing the last crystal.

2No2Name added a commit that referenced this issue Feb 1, 2025
Useful during ender dragon respawning when placing the last end crystal
#618
@soulsoiledit
Copy link
Author

I've tested the optimization, and it's more than sufficient for the fastest farm that I've tried running. I'm not sure if there's any practical applications of adding more bedrock during respawning, so that behavior does seem fine to me. Thanks for your work!

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

No branches or pull requests

2 participants