Skip to content
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

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

Open
frodare opened this issue Jun 27, 2017 · 5 comments
Open

Comments

@frodare
Copy link
Member

frodare commented Jun 27, 2017

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

@NekoAmps
Copy link

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.

@frodare
Copy link
Member Author

frodare commented Jun 28, 2017

@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.

@stale
Copy link

stale bot commented Aug 6, 2018

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.

@stale stale bot added the stale label Aug 6, 2018
@stale stale bot closed this as completed Aug 13, 2018
@frodare frodare removed the stale label Aug 14, 2018
@frodare frodare reopened this Aug 14, 2018
@frodare frodare added confirmed and removed stale labels Oct 6, 2018
@BugmanBugman
Copy link

Will this be fixed anytime soon?

@Laike-Endaril
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants