-
Notifications
You must be signed in to change notification settings - Fork 183
Branch decay [Simple Implementation] #2334
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
|
We still got issues for large thin birch trees. |
I don't know if this is what @Argmaster meant here, but this is how I understood it, and what I think would be a nicer approach: Branches can (or maybe must) depend on a neighbor. So, in the branch rotation data, in addition to the 6 bits required for each possible connection, there would be 3 additional bits* for defining which one of its neighbors a branch depends on, if any. A valid neighbor for a branch to depend on would be either a full block or a branch which connects to it. With this approach, decaying branches would just require a simple local update rule. You could allow branches to have no dependency and thus never decay, although I think that would just make things unnecessarily complicated, without much benefit. *3 bits for 2^3 = 8 possibilities; we need 6 or 7. |
Yup |
I'm not sure what exactly you're referring to, and I don't really understand how a branch would need to depend on more than one neighbor, unless you had two branches coming together and merging into one? Edit: If you mean like the dead branches on the ground, I'm not sure exactly how they are generated, but I suppose it would be a good example of where having no dependencies (i.e. never decay) would be desirable. |
Editted my comment just before I saw your response. |
|
yeah, anyway way to complicated without any benefit, |
|
Ok, just to clarify: And to keep this PR clean of any of those alternatives that would require a >>complete rewrite<< of this PR, To keep this PR only about this implementation. |
|
I think the Merge might have broken some stuff, going to fix that when i have time ,not now |
| .tags = .{.choppable, .wood}, | ||
| .onUpdate = .{ | ||
| .type = .Decay, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if they should decay. They are really not like normal trees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I only did this, because carrie requested it: #2334 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@careeoki what do you think now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't have to decay if we don't want them to. My main concern was palm branch and cactus arms
forgot to stage this file oops (look commit above)
|
Don't merge this jet, there are two issues: first: @Argmaster s optimization #2334 (comment) that i implemented in b42d73e is in principle good, but it works under the assumptions, that branches are not faulty. Like for example issue: #2368 . Because of that, branches only decay half way or never. second: when breaking a thin birch tree, only the middle part decays, not the branches on top, i haven't figured out yet why, investigation on going.. (or when i have time), |
|
Found the cause of issue 2:
I see two possible solutions:
or what do you guys think? should i use solution 1 or 2 |



Introduces a two tiered system of decay.
This means that breaking the logs of a tree is already enough for the whole tree to decay.
This would fix #2331 (comment)
Downsides:
The log search algorithm is more expensive now, since it compares tags instead of the decayProhibitor attribute
Things i also had to introduce: