Hammerwatch Forum

Custom mapping and Mods => Editor Discussion => Topic started by: rpc190 on July 15, 2014, 01:50:07 AM

Title: Enemy Pathfinding Question/Issue
Post by: rpc190 on July 15, 2014, 01:50:07 AM
I ran into an issue today with enemies trying to fit through smaller openings. When a 2 square (64x64) opening is left the enemies pass through fine as seen in the first screenshot. However if you move the two boxes in even one notch on the smallest grid scale the enemies are reluctant to go through unless herded as seen in screenshot 2. They will happily wait outside if you run inside the closed area even though they could easily fit. I imagine this is because something in the path finding works on a 32x32 scale and considers a space occupied even if it is only partially so? Wondering if this would be a lot of work to change / if you would consider it or if you have a solution.

Screenshot 1: Fine Pathing
(http://i.imgur.com/Ief8Zqa.jpg)

Screenshot 2: Enemies Sleeping
(http://i.imgur.com/SDDNu7U.jpg)
Title: Re: Enemy Pathfinding Question/Issue
Post by: Hipshot on July 15, 2014, 06:39:28 AM
You can see the path finding if you type shownavigation in the console, if you play using the dev version.

(http://hammerwatch.com/forum/index.php?action=dlattach;topic=2093.0;attach=290;image)
Title: Re: Enemy Pathfinding Question/Issue
Post by: CrusaderDeleters on July 17, 2014, 01:57:53 PM
As I thought. He uses a grid system to see which blocks the enemy can go through. :)
Title: Indeed!
Post by: shiftyBOT on July 17, 2014, 05:47:10 PM
Hello again :P
I've been lurking on this thread:D
and you would assume the enemy AI work on a grid system.
and I have a decent question.
would the enemy AI have any trouble if wall wernt the normal straight design?
(sorry for no picture, i have no way to share one, other than through steam but that would be a spoiler of the very closed pre pre alpha of my current map):D

EDIT: ~shiftyBOT(i used the wrong account name, :P
(also does anyone mind if i do a text signiture?)
Title: Re: Enemy Pathfinding Question/Issue
Post by: CrusaderDeleters on July 19, 2014, 01:23:32 AM
Hello again :P
I've been lurking on this thread:D
and you would assume the enemy AI work on a grid system.
and I have a decent question.
would the enemy AI have any trouble if wall wernt the normal straight design?
(sorry for no picture, i have no way to share one, other than through steam but that would be a spoiler of the very closed pre pre alpha of my current map):D

EDIT: ~shiftyBOT(i used the wrong account name, :P
(also does anyone mind if i do a text signiture?)
You mean a wedge-shaped wall section? Pretty sure that would screw it up. If you keep 2 spaces between each walling section, you should be able to make a snake path, which the AI /might/ go simply diagonally.
Title: Re: Enemy Pathfinding Question/Issue
Post by: shiftyBOT on July 19, 2014, 04:15:34 AM
ok :P

thats the answer i expected:/
just didnt know if some wierd thing would happen.