What is the best way for an enemy to get around walls in a Top Down game? [SOLVED]

0 favourites
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Well for the last example some parts derived from R0J0 example that modified with approach & feature I had in mind. Most examples I shared in forum made by me.

    Take your time to grasp how things work. It's really rare in my experience executing an idea in one take.

    Thanks, man. I'm still doing many tests with my game, but I've no progress until now.

  • I often hit barrier that stop the progress and turn me down a bit. Yet I learn and try something new; alternatives way or workaround. It is an adventure for me to discover and un-puzzle mechanics under the hood.

    When things got worse I just switch to another project and eventually comeback to troubleshoot the game.

  • I often hit barrier that stop the progress and turn me down a bit. Yet I learn and try something new; alternatives way or workaround. It is an adventure for me to discover and un-puzzle mechanics under the hood.

    When things got worse I just switch to another project and eventually comeback to troubleshoot the game.

    The problem with Construct is that we have to rack our brains to manually implement its behaviors that don't work well in practice. In this case, it is Pathfinding and Line of Sight.

    Because of this, I had to program the AI ​​having to recognize the axes (X and Y) and make the enemy move reactively based on the behavior of 8 directions.

    This is why users like R0J0hound often provide solutions based on mathematical calculations, not through the engine's behaviors.

  • Still unsolved. :(

  • The easiest way possible to make enemy chasing player while avoiding building is just mimick player movement with sort of delay. When player moves he will drop kind of trace/trail as waypoint for the enemy to follow through. Waypoint can be spawned when player make a direction turn or timed every x second.

  • The easiest way possible to make enemy chasing player while avoiding building is just mimick player movement with sort of delay. When player moves he will drop kind of trace/trail as waypoint for the enemy to follow through. Waypoint can be spawned when player make a direction turn or timed every x second.

    Hi Alex! You're are a true ray of light in the Scirra community. :)

    It's a good solution, and I haven't tried it yet.

    I'm making one last attempt using Pathfinding and Line of Sight (but I still don't understand their malfunction).

  • I just love to think about possibilities to achieve something. Maybe the case you brought fascinate me to actualize the idea. Hopefully I can work on it in weekend.

  • I just love to think about possibilities to achieve something. Maybe the case you brought fascinate me to actualize the idea. Hopefully I can work on it in weekend.

    If I had your expertise, I would do the same too. It's amazing to see a no-code engine make independent projects viable for designers, beginners and enthusiasts.

    I sent you an email if you have time and can help (more than you already do). :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since the logic you are going for is enemy following the player then use the Pathfinding behaviour. The enemy won't get stuck on walls with this.

  • Here's an example I made using the pathfinding behavior.

    It has some extra stuff to add a bit of polishing that you may find useful.

    The code is fully commented to great detail, so it should be easy to understand.

    drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view

  • Since the logic you are going for is enemy following the player then use the Pathfinding behaviour. The enemy won't get stuck on walls with this.

    I've tried many times and it's bugged. :(

  • Here's an example I made using the pathfinding behavior.

    It has some extra stuff to add a bit of polishing that you may find useful.

    The code is fully commented to great detail, so it should be easy to understand.

    https://drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view?usp=drive_link

    Thanks, dude!

    I'll test and study it right now! :D

  • I made a small improvement to fix an issue where they would still get stuck in the wall sometimes. Use this version instead:

    drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view

  • I made a small improvement to fix an issue where they would still get stuck in the wall sometimes. Use this version instead:

    https://drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view?usp=drive_link

    Thanks again! Already downloaded! :D

  • I made a small improvement to fix an issue where they would still get stuck in the wall sometimes. Use this version instead:

    https://drive.google.com/file/d/1nDI-BU8huVVyZSzPvkEFd0nZLw6xFY-e/view?usp=drive_link

    Do you think it works well with the enemy moving in 4 directions?

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