ToroQuest

ToroQuest

2M Downloads

Update Guards and Sentries to only attack entities in their line of sight

frodare opened this issue ยท 5 comments

commented

Would it be possible to have the guards not path find through walls.
It is annoying having all the guards getting stuck in one place because of a mob in a cave.
~PureStone9

https://minecraft.curseforge.com/projects/toroquest?comment=94

commented

I know that Creepers and Skeletons need to have line of sight to the target to shoot and explode, respectively. So if you haven't already then you should look into their AI.

I think you could also have your NPCs "give up" on pursuit of a target (aggro on a target). While your NPC is aggro'd on a target, record how long the NPC continuously stands still without moving (still time). If the still time exceeds a certain quota, the target is put on a cooldown list. When entities on the cooldown list would trigger the NPC's aggro, check if the path to the entity is navigable; if no then ignore the target (give up) for some time, if yes then allow aggro.

commented

@NekoAmps That is pretty much what I was thinking too. I know there is a line of sight check in the targeting AIs, so I plan start playing around with that.

The give up target is a good idea.

commented

Will this be fixed anytime soon?

commented

Well, in the meantime, you can try using my Dynamic Stealth mod alongside. It will give the guards (and most other creatures) LOS and FOV checks. "Most" meaning that you can configure it, and by default some mobs don't use LOS and FOV, like the ender dragon. My config is not for the faint of heart though.

I was actually just here to look at (or rather look for) something else in the tracker, but figured I'd make it known that there is a way of doing this.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.