Culley-Studios / ProQuests-Documentation

The most customizable and immersive quest plugin.
1 stars 2 forks source link

Large Chunks of Land being removed because of TOKEN_ENCHANT_BREAK_QUEST #275

Closed AtomixCM closed 5 years ago

AtomixCM commented 5 years ago

Spigot Account Provide a direct clickable link to your user profile.

Example: https://www.spigotmc.org/members/1

Spigot account - {https://www.spigotmc.org/members/cm_lectric.232281/}

Plugin Version Provide the ProQuests version you are running (support is only provided for the latest version).

Example: 2.0.7.1

Plugin version - {2.1.1.5}

Spigot Version Provide the Spigot version you are using (as stated in startup). If you are using a fork such as PaperSpigot this should also be noted here.

Example: git-Spigot-93e20b3-f8500c0 (MC: 1.12.2)

Spigot Version - {1.8.8}

Log File Provide a clickable url to a plain text website (https://pastebin.com, https://hastebin.com) with your ENTIRE LOG FILE this includes from startup to now. Partial log files or specific errors you deem "relevant" will not be accepted.

Example: https://hastebin.com/iyugokawux.cpp

Link to log file - {https://hastebin.com/kusocogabe.md}

Addition Information Provide as much additional information explaining the issue. This can include but is not limited to an explanation of the "error", the steps to produce/reproduce the "error" in question, and if in reference to an external plugin hook the version of the hooked plugin.

Example: After reloading the plugin a quest created using the in-game creator does not load properly and is throwing errors in console. Upon investigating the produced quest file it appears it is being saved improperly with invalid formatting. All changes to the quest have been made using the in-game creator

Steps to reproduce:

  1. Use the plain text quest file referenced below and put them in your quests folder
  2. Attempt to reload the plugin using /proquests reload
  3. Notice that numerous errors are thrown and they don't load properly

Additional information - { When mining with a pickaxe enchanted with Excavation (a tokenenchant enchantment), while having a TOKEN_ENCHANT_BREAK_QUEST active, massive chunks of land are being removed, and the items are being sent to inventory. The chunk of land being removed is far larger than what the enchantment removes. The TOKEN_ENCHANT_BREAK_QUEST is being completed, but at the expense of losing massive areas of structures in the process.

When I disable proquests, this does not happen.

I am not using the latest version of tokenenchant, but I will try it out and see what happens.}

Additional Media Provide any configuration files, links to images, or videos which better explain the "error" you are encountering. All provided media must be accessible online, download links will not be accepted

Example: This link provided contains the configuration for the quest causing the error https://hastebin.com/iyugokawux.cpp

Additional media - {}

Please keep issues relevant to the "error" in question and try to refrain from opening more than (1) issue per day

AtomixCM commented 5 years ago

Error persists with latest version of tokenenchant. Error still occurs even when using a plain diamond pickaxe.

AtomixCM commented 5 years ago

This error is actually nuts lol

JCulley commented 5 years ago

Hi,

I’m going to say to begin with ProQuests doesn’t alter the block state of any blocks whatsoever. There is no need for the plugin to perform such a function (for any of the features).

So having said this I’m going to close it and action it as no action. In the future when opening issues please include as much information in the initial post as even though I am certain this is unrelated to ProQuests I still don’t even understand what the difference is between the original and “far larger” is. This is why there is a section to include media such as images or videos. Additionally please don’t post multiple times within a short period of time especially if it doesn’t add anything to the issue such as “This error is actually nuts”.

Thanks, Jacob

AtomixCM commented 5 years ago

I believe the problem to be the way the TOKEN_ENCHANT_BREAK_QUEST handles counting the blocks that is causing the server to lag and create an issue.

https://ibb.co/LRYJBN0 - Here is a picture of a chunk that was removed when ProQuests was enabled and a block is mined. The largest mining enchantment on my server removes 11x11 bits of blocks. As you can see, the chunk removed is much larger, therefore being unrelated to any action of tokenenchant. As stated above, this error is happening even with an unenchanted pickaxe.

This error only occurs when ProQuests is enabled. I believe it to have to do with the method that counts the blocks mined towards the TOKEN_ENCHANT_BREAK_QUEST.

Please don't assume that this is not from ProQuests. I understand there may not be any part of the plugin that removes blocks. However, it only occurs when ProQuests is enabled.

I would very much like to use your plugin on my server. I obviously can't use it if massive chunks are being removed while the plugin is enabled.

This error does not occur when tokenenchant is disabled and proquests is enabled. This error does not occur when tokenenchant is enabled and proquests is disabled. This error ONLY occurs when ProQuests is enabled AND tokenenchant is enabled.

The server gets a lag spike everytime you break a block, which leads me to believe this has to do with when ProQuests is tracking blocks broken.

Please install tokenenchant and proquests on a test server and observe this issue for yourself.

JCulley commented 5 years ago

I stated when the quest type was initially implemented it may have performance issues as you are manipulating a large number of blocks regardless and the quest needs to attempt to track each and every block occurrence. I do not possess a copy of TokenEnchant as the author refused to provide me a copy. ProQuests simply listens to events for quests, I cannot control how the events are handled/maintained that is the responsibility of the respected plugin developer. I never assumed, I stated this is the case, ProQuests does not in any way modify block states in any way.

AtomixCM commented 5 years ago

Thank you for replying.

I do recall you mentioning the quest type may have performance issues when you implemented it. However, I do believe the error lies in how the quest is attempting to track each block.

JCulley commented 5 years ago

There is no other way to track the blocks, I don’t understand what you’re trying to get at. The event provides X blocks in a list and the quest has to go through every single one and perform any validation necessary, this means if you have allowed/required types, specific worlds, specific items it must be broken with etc, these are all validated for every block. There is no way to optimize this quest further.

AtomixCM commented 5 years ago

The reason I am mentioning that I believe the error to lie in how the quest tracks the blocks broken is because the server is experiencing a lag spike when proquests is enabled and a block is broken.

I think if you see test issue for yourself you will be more open to searching for a fix!

How to replicate: Install tokenenchant and proquests on a server. Upload these quests: Quests.zip Break any block with your hand or a pick or anything you would like.

JCulley commented 5 years ago

The event provides X blocks in a list and the quest has to go through every single one and perform any validation necessary, this means if you have allowed/required types, specific worlds, specific items it must be broken with etc, these are all validated for every block

Do you not understand what I am saying, there are a numerous amount of operations being run for every single block broken, there is no way to get around this. A 11x11 area is 121 blocks, not only is the server handling the block breaks it also is running a number of validations for the quest now too. World manipulations are all done on the same thread, so if you overrun it with operations it will bottleneck.

AtomixCM commented 5 years ago

I don't understand what the validations are. The only thing I do know is that EZBlocks tracks the number of blocks broken without issue...

Would you consider looking into ezblocks sourcecode and seeing the method they use to track blocks? You are talking with someone who doesn't develop, so please excuse me if my assumptions are premature.

AtomixCM commented 5 years ago

https://hastebin.com/roloyereso.java ^EZBlocks break handler class

JCulley commented 5 years ago

this means if you have allowed/required types, specific worlds, specific items it must be broken with etc

I understand you’re not a developer which is why I’m trying to explain this as simply as possible. EzBlocks doesn’t have any validations to worry about it simply counts the number of blocks regardless of type, world, tool used to break etc. As I have stated ProQuests has to do any number of validations to ensure that every single block broken matches the quest criteria.

So as I have said, there are no additional optimizations which can be performed, if you are simply making a quest which is only for total blocks broken without any other conditions you will only have the noticeable performance issues from TokenEnchant itself.

AtomixCM commented 5 years ago

I would just like to believe that there is something you can do to alleviate this issue instead of just drawing the line and saying Proquests has to do validations for each block to make sure it matches the criteria. There must be a way to get the bulk number of blocks broken and run one single validation, as compared to running a validation for each block broken.

Can you try to brainstorm some sort of fix/hack?

JCulley commented 5 years ago

Any validations which can be done in bulk are, however there are specific ones which must be done individually. The major ones include material and location, both of which are highly intensive. It is impossible to do these in a batch. I’m not drawing a line, the capabilities of the game itself are drawing the line. As I said, if you want a basic quest which simply tracks just the number of blocks regardless of any other factors (such as EzBlocks) then you won’t have any issues.

It’s kind of aggravating that you’re continually asking me to perform something which is not possible, as I have stated. If there was a way sure I would implement it, but there is not.

AtomixCM commented 5 years ago

The quest I am in search of is meant only to track the number of breaks a player makes in their lifetime on the server. Some of these breaks will come from enchanted pickaxes that break more than one block at a time... what should I do now to implement this?

JCulley commented 5 years ago

As I said, if you want a basic quest which simply tracks just the number of blocks regardless of any other factors (such as EzBlocks) then you won’t have any issues.

Then do that? You’re making me repeat myself, if you don’t have any conditions then it won’t have anything to validate. I’m going to lock this as it’s just the same things being repeated over and over.