Pathfinding + "breaking walls over time"?

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi everyone!

    I'm planning to have a survival game of sorts with enemies pathfinding to the player. There's going to be walls that the player can place down to build a base. I want the enemies to stop on the wall and progressively break it down over time.

    My first idea was to have the enemies not account for the walls in their pathfinding, and simply on collision, freeze them until the wall breaks.

    I was wondering if there's a better approach to this, or if someone's done something of the sort in the past.

    Thanks!

  • Your solution should work fine. I would suggest one thing to make it a little better. Give the walls a path cost. A path cost doesn't stop the pathfinding from trying to go through the object. What it does is try to find an "easier" route that isn't too much of a detour. If there is a clear path, it will use that path. If there isn't one, it will try to go through it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It sounds like you wouldn't need pathfinding at all for your original approach, since they're ignoring the walls and attacking through them anyway. You would used a fixed path with moveto and maybe invisible helper sprites as waypoints in that case.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)