ADenton's Forum Posts

  • 7 posts
  • Player.x, player.y provides a regularly updated set of coords to the enemy to track the player down. Those coords are where the player is at every point in time. So rather than pointing the enemy at where the player was a point in time that has past, it points them at where the player is presently.

    Thinking out loud here - but maybe I need to continuously track player x and y coords all the time. And have the enemy move to that most recent set of stored coords (in an instance variable?) which are made available to it only when the proximity threshold has been reached.

    But how....? How to make the enemy move to a specific point (X,Y) once and only once the player has come within so many pixels....

    I can't quite crack it, but I reckon it'll be so obivious a solution once it's sorted

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • keepee - yep, on pathfinding. Thanks. Along those lines - how how might you specify the X and Y coords for the enemy to "find path to" as the point in 2D space where the player tripped the proximity threshold around the enemy.

    Maybe another way of asking the question is - how do you get the enemy to find path to a point where the player was - but no longer is?

  • Any thoughts on the following would be kindly welcomed.

    Working on the AI for a top-down stealth outing. I'm looking at a pattern of behaviour for a resident of a house who - on "hearing" something moves to that location. What I have in mind is an enemy AI - who being in proximity to the player, moves slowly / cautiously to the point in 2D space where the player came within a particular proximity to them - say 100 pixels. Moving cautiously should give the player time to evade. Once the enemy reaches the point where the proximity routine is tripped / noise is heard - they'll wander about, look around, and if the player is not in line of sight - they'll resume their duties.

    Problem is working out how to get to that point in space - so they can wander about / look around as opposed to acquire the player and chase.

    Cheers

  • Nimtrix - Really like your solution - but can I ask a followup? Anyone have any theories on you might make a sprite who's rounding the waypoints sensitive to the presence of a player - and respond? I'm thinking there's a patrolling guard moving between waypoints, who, either by line of sight, or proximity is alerted to the presence of the player and respond by moving toward.

    Then resuming the routine of rounding waypoints should nothing be found. It's doing my head in - there are many nice solutions in C2, but can't figure how to blend that waypoint-ing behaviour with a player detection/chase mechanism.

    Any thoughts would be most welcome...

    Cheers

  • mattb - Really like your solution - but can I ask a followup? Anyone have any theories on you might make a sprite who's rounding the waypoints sensitive to the presence of a player - and respond? I'm thinking there's a patrolling guard moving between waypoints, who, either by line of sight, or proximity is alerted to the presence of the player and respond by moving toward.

    Then resuming the routine of rounding waypoints should nothing be found. It's doing my head in - there are many nice solutions in C2, but can't figure how to blend that waypoint-ing behaviour with a player detection/chase mechanism.

    Any thoughts would be most welcome...

    Cheers

  • Jayjay - many thanks =) I was looking at this form of behaviour as a way to solve an issue of developing patrolling behaviour internal to a room. What I've been ultimately trying to solve is how to develop patrolling behaviour between rooms with walls as obstacles. For instance - if we had a guard patrolling rooms in a house viewed from a top down POV, how would you solve the issue of pathfinding a route around obstacles like walls? Without figuring that, I thought I could locate guards inside one room, set waypoints as per your examples and have them rotate through that space.

    Any ideas about pathfinding around obstacles to reach and move through a series of waypoints?

    Any thoughts would be much appreciated...

    Cheers

  • Alucard - can you share how you solved it? I'm trouble with that too...

  • 7 posts