MineColonies

MineColonies

57M Downloads

Improved behavior: Smarter Lumberjacks/janes [$15]

kedamono opened this issue · 13 comments

commented

Minecolonies version

version 0.6.2879

Expected behavior

  • Lumberjacks/janes do not stand directly on top of a sapling while cutting down a tree.

Actual behaviour

  • Lumberjacks/janes routinely stand on top of a sapling while they harvest another tree. Then the sapling grows and kills the lumberjack/jane.

Steps to reproduce the problem

  1. Put down one sapling in the lumberjack's area.
  2. Bonemeal it to full size.
  3. Plant three more saplings next to the tree to make a square.
  4. Wait for the lumberjack to harvest the grown tree.
  5. Sapling under lumberjack grows and kills him.

Did you help close this issue? Go claim the $15 bounty on Bountysource.

commented

I had asked myself how to handle this.
We could mark saplings as not passable but that would make lumberjacks not pass the saplings anymore which might be dump because they could get stuck with 8 saplings around them.

The other option would be making it similar to the stuck method.
If more than 2 seconds over a sapling -> run away from place and try to approach the target from a different place.
What do you think @Kostronor ?

commented

Why not exclude saplings as safe stand, but still have them be passable? The LJ is always looking for a place to stand, we just have to make this explicit.

commented
commented
commented

Yeah because you implicitly set it to null in walkToBlock

commented
commented
commented

I tested the new build in a very woody biome. I planted saplings everywhere before hiring a lumberjack.

She would initially stay one block away from a sapling, but after clearing away leaves, she then stood on the sapling. However, she would walk away about every 8 to 10 seconds, and then walk right back on to the sapling. For one tree, she found a safe location to work from, so if there is a clear area with no saplings, that's where she will go.

As a test to see what she would do around a jungle tree, I planted and bonemealed a 2x2 sapling group to grow a giant jungle tree. Then I planted more jungle saplings all around it. What she did was climb up into the tree and to cut it down from the top.

Screenshots of Hayley in action:
2017-03-02_14 31 48
2017-03-02_14 32 18
2017-03-02_14 33 14
2017-03-02_14 33 28
2017-03-02_14 33 33
2017-03-02_14 33 54
2017-03-02_14 34 33
2017-03-02_14 34 41
2017-03-02_14 34 57
2017-03-02_14 35 20
2017-03-02_14 37 22
2017-03-02_14 40 11
2017-03-02_14 40 28
2017-03-02_14 42 39
2017-03-02_14 51 51
2017-03-02_14 52 40

commented
commented

Better behavior with build 1.10.2-0.6.3016, the lumberjack will walk back and forth if the spot that they want to use has a sapling on it. But, they will continue this behavior until the sapling turns into a tree or another sapling grows and blocks the area with leaves.

However, the LJ will stand on a sapling while breaking leaves on a tree. They will stand on the sapling for 8 to 10 seconds, go back to the hut, then stand back on it to break more leaves. Once enough leaves are broken, they will either go into the loop of walking back and forth, or if there is a way on top of the tree from a neighboring tree, they will climb up on the tree and cut it down from the top.

In my test, my LJ climbed a tree and cut the tree directly beneath. Eventually the leaves decayed and she fell down and was surrounded by logs and leaves. A sapling grew and blocked her from getting out and she never left the tree after 7 minutes of waiting. I finally broke her out and removed the tree she was climbing up. So instead, she cut a couple of logs and climbed up and began cutting the tree down from inside the tree.

commented
commented

Well, this time with build 1.10.2-0.6.3045 I succeeded in getting the achievement "I am Groot!", but in this case, it was due to such an artificial situation that I think this build is one of the better ones.

In most cases the LJ stayed away from the saplings, though I did catch her standing on them twice while breaking leaves.

The Groot 'chieve was gotten due to me literally covering a 16x16 area in saplings with some gaps. It formed a maze of trees and saplings, and clear spots that the LJ navigated and found the clear spot to work from. When she died, she had tried to get to the safe spot from a different direction and got herself caught in a dead end. Then the saplings grew and she subsequently had the sapling underneath her grow and suffocate her.

The new LJ found the safe route in to the block of trees and stayed safe while she cut down the trees. So, I give this a 4.5 out of 5 for keeping the LJ safe. It's not perfect, but if it was perfect, you'd never get the Groot 'chieve.

commented