Spaghetti_Inc's Forum Posts

  • No, a larger cell sizes requires less processing, but less resolution. For example if you make the cell size too large pathfinding might not be able to find a path through a small gap.

    Ok so I tested it and doesn't have to big on an effect also the enemies seem to get stuck when the player goes in to the top corner. Here is an example

  • No, a larger cell sizes requires less processing, but less resolution. For example if you make the cell size too large pathfinding might not be able to find a path through a small gap.

    Ohhhhhh I get it now! ok thank you so much I'm going to go set my cell size to something bigger then

  • It's less about your viewport size and more about how much space you have between obstacles.

    Ok so if all my invisible walls and stuff like that are just mostly around the edges of my map I should make my cell size smaller then

  • So it was just taking them a while to find a path? Consider doing something to ease the burden of the pathfinding algorithm. The A* algorithm should be very fast to the point it is unnoticeable on modern devices.

    Things like increasing your cell sizes or limiting the area and distance of pathfinding can do a lot for performance.

    Yeah it was taking a while. I have never messed with cell size. What would you say is an appropriate cell size for a viewport size of 463x270?

  • Is the delay happening when finding the path before the pathfinding path found triggers?

    You can visually fudge it by spawning them invisible, and enabling visibility on pathfinding path found.

    If they're still getting stuck after pathfinding path found and not moving, you might have some other events interfering with their movement or state.

    Thank you this helped so much!

  • Give them a push: dropbox.com/s/4tjnro8xiy4j6tm/sesame_instance.capx

    This worked but sometimes the enemies still stood still before coming after the player and I'm not sure why.

  • My enemies sometimes will stand still after they spawn before either moving toward the player or getting stuck. Anyone know what to do?

  • Ok so it seems to happen when the timer hits 0. Still don't know why

  • youtu.be/TSsLkX1Lt_U

    This is my problem, and I don't know how to fix it

  • youtu.be/TSsLkX1Lt_U

    Tagged:

  • Alright problem has been fixed! All I had to do was get rid of this piece of code that was setting the enemies to visually be behind the top wall. I only had that there for a test piece of code I forgot to get rid of it. Thanks for your guys help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright I have been still trying stuff like changing around enemy settings and they are still going through walls.

  • Ok so everything works except now the enemies are walking through the invisible walls I have set up. I have been messing around trying to get it to work and its still not working.

  • To approach this efficiently, think about when you would actually need to update pathfinding. For starters, if an object has line of sight, you don't need pathfinding at all.

    When line of sight is broken, run pathfinding for that instance only.

    Upon reaching the first node or corner, check again if you have line of sight or not, and run pathfinding again if not.

    Basically during the whole time the object is traveling to that first waypoint, running pathfinding again is useless because the result will be the same anyway.

    Oohhhhh I get get! Thanks for the help! That should fix my problem. One problem I was having with my current code was when there got to be to many enemies on the screen some of them would just no longer move.

  • So if I want the enemies to be constantly chasing the player I shouldn't be updating it every tick. Would I want it to update every like 10 ticks or so and use some wait commands to achieve that? Thanks for the help.