Enhancing Pathfinding Obstacle Behavior

In game development, the Pathfinding obstacle behavior is a valuable tool for creating immersive environments. However, many games feature diverse terrains such as mud, slime, sand, and ice, which can significantly affect player and mob movement speeds.

One suggestion to improve this behavior is to incorporate environmental effects directly into it. For example, implementing a feature where enemies receive buffs or debuffs when traversing these unique terrains could add depth to gameplay dynamics.

Currently, achieving this effect is possible through event-based systems, such as using the “OBJ1 Collision with OBJ2”, action adjust the speed of OBJ1. However, integrating this functionality directly into the Pathfinding obstacle behavior would streamline the development process and enhance overall gameplay experience.

I suggest adding a feature to the behavior like “Is this terrain speed-boosting?” Then, you could add a velocity option under the “Pixel per Second” bar.

By seamlessly incorporating environmental effects into the Pathfinding obstacle behavior, game developers can create more immersive and engaging gaming experiences for players to enjoy. What are your thoughts on this idea?

I am even thinking about to make an extension out of this? Would be useful?


Right the bath finding behavior is very bad

I don’t say it’s bad, it just do what it should do, but it can be improved, what are your suggestions?

I think your suggestions would be helpful for some folks, but what you are describing seems perfect fit for an extension, rather than natively part of the behavior.

My understanding on the standard behaviors is that they should be the highest level abstraction of a game concept, and more game-genre specific stuff should either be done in game logic using expressions from that behavior, or extended out using an extension (not every platformer will have a double jump or wall slide, so those are not in the platformer character behavior itself, but are available in an extension)

Environmental based modifiers and similar concepts are not going to apply to all games using pathfinding, so while it could be useful for some games, it seems like it would be best fit for an extension.

1 Like

I agree, in fact I was thinking about the same thing today and I think I’ll do an extension on it


I said that for me it is bad because many times I give tiled sprite obstacle behavior and make test the opjecte who must follow me It penetrates the walls and comes behind me without carelessness and when I add to the wall and the object action of separation make glich an the enemy He moves instantly to the other side of the wall and this is a very bad thing

The pathfinder doesn’t work right with rotated sprites. You can’t usually just rotate a wall to make a floor or ceiling. You need to resize it keeping it unrotated.

I was just looking at the source code. I don’t understand everything but it looks like it only uses the width and height instead of the actual bounding box. If so, that would explain why it ignores rotated objects. The width doesn’t change when you rotate an object.

From my understanding, the standard pathfinding algorithm used has to work off the bounding box due to needing squares, I think? So it’s not necessaroly gdevelop specific but specific to that pathfinding method.

That said I generally recommend people look at the pathfinding extension Davy made, it uses an alternate pathfinding algorithm and can work off the collision mask (to an extent).