How to prevent NPCs from overlapping?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

Bob the Hamster wrote: I think changing this would definitely affect the way "walk NPC" and "NPC is walking" interact, which might be a back-compat problem, but I am not certain.
EDIT: This did actually lead to another issue which I won't explain but I was able to overcome it by making the puzzle turn-based.

Interestingly I figured out a workaround solution that seems to work so far.

Instead of using walk npc I used npc pathfinding to the adjacent tile and I changed the map settings to pathfinding ignore npcs. This fakes a direct pathfinding to the adjacent tile and the npc doesn’t move if there’s an npc in the way. No npc overlapping seems to occur.

I think maybe you don’t have to fix the bug with walk npc since it’s to involved. It might be easier to add an option for “npc pathfinding to� to be setup as direct pathfinding rather then the current smart pathfinding withought having to set my map up to ignore npcs during pathfinding.
Last edited by sheamkennedy on Sun Feb 18, 2018 2:35 am, edited 2 times in total.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Post Reply