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

[Performance] Replace Removing & Adding entities with Updating entities #81

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JustAHuman-xD
Copy link
Contributor

@JustAHuman-xD JustAHuman-xD commented Mar 5, 2024

Currently cultivation whenever harvesting from a plant, will remove the entities representing the item, and when they grow it adds the entities. This is quite laggy when done many many times a second, which can be easily achieved with a macro on an afk player. To combat this, this PR replaces that system with its own. It hides the entities by setting the scale to be 0, 0, 0 when harvested, and then to its normal size when grown. Unintentionally this also fixes a couple bugs with the bushes, as they did not use the proper transformations or methods that were created for them. I have also included interpolation, so the drops actually "grow" and "harvest", its a nice visual touch that has no impact on the server as interpolation is purely client sided.

Below are some profiles with and without the changes:

  • I also placed a lot of entity heavy quaptic blocks as well to try and simulate having more entities on the server

With: https://spark.lucko.me/lXZ2NaOQZx
Without: https://spark.lucko.me/RJYgpWhhBL

This was also only done on a local test server, so the differences would be more dramatic on a production server. I say this cause on Meta tps would be at 20, and then 2 people would be macro farming cultivation (10 10 10 plants) and tps would drop to 8-12.

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.

1 participant