shadowmage45 / AncientWarfare

Updated Ancient Warfare mod for Minecraft 1.5.2+
http://ancientwarfare.wikispaces.com/
Other
10 stars 7 forks source link

Feature Request: Add "warp to home" option for hung NPCs? #28

Closed keenerb closed 10 years ago

keenerb commented 10 years ago

I have NPCs that get hung on the corners of fences and places like that perpetually and end up getting killed.

Is there any temporary workaround for that? I would suggest that an NPC just "warp" to their home point if they're near the home point but pathfinding has broken/they're unable to make progress to their goal.

shadowmage45 commented 10 years ago

I've been trying to avoid implementing any 'warp'/'teleport' function in to the NPCs, but instead relying on the pathfinding for it....mostly to avoid any potential exploits that people may come up with.

However, you do have a good point -- pathfinding/navigation isn't perfect, and there needs to be some compromise between playability and realism. If I cannot solve the issues in the pathfinder/navigator, I will look into implementing a 'if stuck, teleport to destination, with delay based on range' functionality...or perhaps just 'teleport home'....we'll see.

keenerb commented 10 years ago

Yeah, I'd rather have NPCs that wander back properly themselves, but pathfinding is incredibly complex in Minecraft.

I'd say that only returning home should enable any sort of warp-functionality. If an NPC fails to path to their work site, it's not as potentially deadly as failing to return from a work site when night approaches. If they can't teleport TO a work site, can only teleport to home point, it should limit any abuse potential.

If a fail-safe is needed, perhaps they could repack themselves into the town hall if they experience a "pathfinding failure". A tick monitor for any npc pathing to a work site that fails to make any progress over... five AI checks could just poof into the town hall's storage as a repacked npc parchment icon.