DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Curated user bug reports with enough information to reproduce issue. Moderators will move topics here from Help & Support once a bug is confirmed and enough information has been provided.
Post Reply
User avatar
Interkarma
Posts: 5037
Joined: Sun Mar 22, 2015 1:51 am

DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by Interkarma » Tue Oct 24, 2017 12:03 pm

The space surround stairs is not blocked out on navgrid. Will correct during a future pass on mobile NPCs in 0.5.

User avatar
pango
Posts: 1780
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by pango » Sun Jan 27, 2019 3:01 am

This issue still exists in dev build (and probable 0.7.32)
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

hello
Posts: 26
Joined: Sun Jan 20, 2019 8:18 pm

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by hello » Mon Jan 28, 2019 7:47 pm

confirming it happens in 0.7.32 ;)

User avatar
Hazelnut
Posts: 1832
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by Hazelnut » Mon Jan 28, 2019 8:00 pm

I may fail, but going to give this a try since I learned a bit about this area of code when doing my optimisation work recently.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
LypyL
Posts: 514
Joined: Sun Mar 22, 2015 3:48 am

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by LypyL » Mon Jan 28, 2019 10:37 pm

They do the same at Castle Wayrest I believe

User avatar
Hazelnut
Posts: 1832
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by Hazelnut » Mon Jan 28, 2019 10:58 pm

So turns out the reason is that the staircases are not shown in the map data. The easiest fix would be to alter the source DF datafile to add them, but we can't do that. For now I'm going to try a special case for these stairs. Definitely wishing there was a command to find the name of the block player is in... just took me an hour to find the blockname for the Sentinel palace!
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Hazelnut
Posts: 1832
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by Hazelnut » Mon Jan 28, 2019 11:40 pm

Thanks for the info about Wayrest. Wonder if there are any others?

What I plan to do is have a mapping of blockname -> array of Rect's. Each Rect defines a rectangular area where NPCs are forbidden in x,y coords within the block. In future this could be contributed to by mods, but for now it will simply forbid rectangles containing these stairs.

Anyone think this is not the way to fix this, please say before wednesday as that's when I will implement this. I prototyped it tonight and seems to work okay with a hardcoded conditional for Sentinel palace stairs.

(won't be doing it tomorrow evening because going out for a fancy meal with other half to celebrate 26 years together so a higher priority! :D )
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
Interkarma
Posts: 5037
Joined: Sun Mar 22, 2015 1:51 am

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by Interkarma » Tue Jan 29, 2019 1:51 am

When I got around to this, I was just going to add a simple rayast to prevent mobile NPCs from bumping into stuff. It would help them avoid any geometry not blocked out by navgrid. It won't be expensive at all, the mobile only needs to check when seeking next grid position. I'm happy to look at other solutions too.

And congrats on 26 years together! :D

BansheeXYZ
Posts: 533
Joined: Fri Oct 23, 2015 8:19 pm

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by BansheeXYZ » Tue Jan 29, 2019 1:54 am

What about a more broad solution involving collision checks? If moving sprite hits a solid wall, then turn it around.

Edit. Interkarma posted same time as me.

User avatar
Hazelnut
Posts: 1832
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: DragonBreak #89: Mobile NPCs will path through castle stairs in Sentinel

Post by Hazelnut » Tue Jan 29, 2019 9:01 am

Interkarma wrote:
Tue Jan 29, 2019 1:51 am
When I got around to this, I was just going to add a simple rayast to prevent mobile NPCs from bumping into stuff. It would help them avoid any geometry not blocked out by navgrid. It won't be expensive at all, the mobile only needs to check when seeking next grid position. I'm happy to look at other solutions too.
You can do that if you'd prefer. I was looking at it from the point of view of altering the nav grid since that's the current way npc navigation works. A raycast would be a more general solution to the issue, so I'll leave this unless you ask me to do my way due to unexpected complications or something. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply