Lumberjack gets confused with large trees
SyberSmoke opened this issue · 19 comments
Minecolonies version
version 0.6.1908
Expected behavior
- The lumberjack will go to a tree and try to chop it down. Larger trees like Dark Oak and Junglewood will be chopped from top to bottom.
Actual behaviour
- On large trees like dark oak or Junglewood, the lumberjack will cut the tree down from the bottom up. Once he gets to a sufficient height (about three blocks) he will have an issue with finding the tree again and will walk in circles around the tree. Or just stand in one place looking to patch to the tree.
Steps to reproduce the problem
- Have a Sawmill with a Lumberjack.
- Grow a large tree like Dark Oak or a 2x2 junglewood tree.
- After one day, he will lose track of the tree and not continue chopping wood.
- Profit
@Raycoms seems your pathfinding broke this? We always path to a floor block right?
Well...one other thought comes to mind, set a time per block to break, then multiply that by a number of blocks in the tree and just chop it all down at once. That way you get the whole tree in one shot, but it takes far more time for the lumberjack to achieve.
Then there is a big tree and people complain because the LJ is chopping for too long. Or people give axes with 1 durability and should we just chop one wood oder the whole tree? :D
And changing hatchets while he is chopping could be an abuse too, because you use your best hatchet to make it fast and change it with a wood one to ensure to not loose durability.
Changing the hatchet resets the process.
The hatchet would lose one durability per block of the tree removed at once. So if the hatchet has 100 durability, it can remove a tree up to 100 blocks. AND the Lumberjack need to have a tool that can handle the entire tree. So if he has a hatchet with 50, and a tree is 100...he will ignore that tree as to large.
How about that? He will only chop down trees that he has the tools to chop down in one felling. Well or he will try to replace the hatchet...trash it...may be merge used hatchets into one (20 used stone axes can be crafted into a single one.
Thing is, all these things introduce too many edge cases we either handle all (costs time and cpu) or ignore and get abused.
There are always edge cases...there will always be exploits in any system. All you can do is figure out if those cases are worth the time. Right now...all people see is that the lumberjack flakes when certain things happen...and well they have to interrupt what they are doing to fix it. So what do you prioritize?
I mean I understand what you're saying...I am just tossing out some thoughts is all.
I mean...may be you can also limit the types of trees the lumberjack looks for based on his lvl. So that he will only chop down small Oaks, Birch, and Spruce to begin with. Then as he gets more competent...and faster he chops down other trees. (shrug)
Yeah I am thanksfull you are doing it :)
The from top to bottom approach is really good as it will help ensure the LJ continues on server restart f.e.
Chopping down a whole tree at once is something we could do. Maybe as a config or a funny thing. Where the LJ charges his energy over time and when he gets to a tree where his energy is enough to chop it he one hit crashes it with a huge sound and stuff raining 😆 that would be fun, definitely! I'd consider a patch for that immediately if you want to implement it 😉
That is up to people other than I. Hehe, But I would be happy to test out the options.
The test version works well. I tested it with all of the trees except large oak because that is random. But the Lumberjack had no issues returning to the tree and continuing his work as he felled it from the top down.
Yeah I was just messing about with the Lumberjack and it gets weird with large trees. As I said after they cut down 3-4 blocks in height, something starts to go a little haywire. It is like the Ai knows where it needed to go, but then can not find an object to work on and keeps searching.
So as a suggestion you may want to look at wood chopping from the top down. So it goes to the tree, finds the wood, then starts removing the blocks at the highest point and works down instead of working from the bottom.
That may be unintuitive for the player to see but prevents us from having orphaned trees on server restart too @Raycoms
Maybe add either Vein Miner or Treecapitator mods to this mod. Both have methods of removing an entire tree and applying the correct durability loss on the tool used.
@kedamono that is not the problem :) The problems are edge cases
Well, my colony, Sandpiper, on the Minecolonies server is one of those edge cases. I have a couple of floating trees because I set up next to a very tall spruce and oak tree forest. At some point my LJ can't see the tree anymore and ignores it.
Also, since you're working towards Tinker's Construct compatibility, will that include a Lumber Axe? One chop and down the tree comes.