MineColonies

MineColonies

57M Downloads

Ranger completely stop attacking if stuck while triying to get away from mob

GanthorPrime opened this issue ยท 12 comments

commented

Minecolonies version

Version: minecolonies-1.12.2-0.10.310-ALPHA-universal.jar

Expected behavior

Archers attack and try to avoid attackers, but, if for any reason they get stuck and cant change current position, keep shoting like crazy

Actual behaviour

In latest alpha i notice many archers start diying. After cheking behaviour closely, notice they completely stop shoting if a mob reach them and, for any reason, they cant move from his current position (ex, getting cornered, a cobweb, a 1x1 water, etc). Its seem we need a mechanism to keep them shoting at the target or the closest attacker (99% of the time, the same mob), to the avoidance routine do not compromise so badly his survivavility.

Steps to reproduce the problem

  1. Check a ranger behavior, in a sceneario they not 1 shot target
  2. Put some cobwebs or obstacles to get them stuck while fighting a mob
  3. See him completely stop shoting, lost some armor parts by being hit and die miserably.

PS: i do not change jet the config file to activate latest alpha mob-citizen hostility.
Thanks in advance and keep the great job!

commented

It's not just rangers. Knights also stop attacking for a bit when struck.

commented

After being struck by an attack, both rangers and knights stand still and will not fight back for several seconds. They even seem to stop following the player if on follow duty (they stop glowing).
A knight equiped with a shield, at least defends itself with it in that period. The ranger just takes hit after hit until they die or recover about 5-10 sec later.
Check the following video for clarification:
https://youtu.be/cmi2tmC4r90

commented

Maybe related to this PR #3953. I will test now

commented

Yeah I read through the stuff you and Orion changed in the commit. :) Nicely done for my issue at least. Just didn't want to hijack Ganthor's issue ;)

commented

Fix #3953 looks good on both ranger & guard! awesome work! <3

commented

Awesome

commented

Uh, did not want to prematurely close Ganthor's issue tho. @GanthorPrime is it fixed for you as well?

commented

The avoidance task was manually disabled for the guard now, it was not supposed to run, that was a bug =D he was supposed to only run 1-2 blocks and if not able switch back to attacking shortly after.
But, he ran into the avoidance AI task we improved for the citizen a bit later.

commented

sorry for not post before. Is solved in my side. Archers are performing flawesly now. thanks

commented

I can sorta understand the cobwebs but what other obstacles we talking here?

commented

in general, any situation where normal pathfinding shows trouble, i.e:
mob attacks and push archer to: a corner, a water source / current, a 1 block tall hole filled with water, a cobweb, a place where there are leaves at the head level, etc. usually in this situations, is the attacker who do not let the guard to move, and survival can be asured just by keep shooting.

i think the idea here is to keep shoting while triying to get away

commented

I have the same issue, even if the ranger is not blocked.