How do I generate procedural path?

0 favourites
  • 7 posts
From the Asset Store
Move around the rectangular and travel as much as you can!
  • Hello,

    I'm experimenting with procedural generation, but can't figure out how to generate just one path, square grid based, from point A to point B, not straight, but with some turns and such, but also without any sideways, but can't figure out how i could get it done. Any suggestions folks?

    Cheers

    M

  • A common way to do this is to create a 'walker' object, which will step forward once every loop, and will have a set of rules dictating when it's allowed to turn 90 degrees. These rules will depend on your implementation.

  • A common way to do this is to create a 'walker' object, which will step forward once every loop, and will have a set of rules dictating when it's allowed to turn 90 degrees. These rules will depend on your implementation.

    Hey, yeah, Iv'e got that far XD Those rules are the problem, not sure how to build them in some nice way.

  • > A common way to do this is to create a 'walker' object, which will step forward once every loop, and will have a set of rules dictating when it's allowed to turn 90 degrees. These rules will depend on your implementation.

    >

    Hey, yeah, Iv'e got that far XD Those rules are the problem, not sure how to build them in some nice way.

    You could try using the built-in pathfinding behaviour (or the Astar pathfinding plugin) and use the nodes from that to navigate paths around obstacles, then build corridors or whatever along that route. Take a look at this linear pathfinding example I posted a while ago, you might be able to fiddle with it to generate routes.

    https://dl.dropboxusercontent.com/u/106 ... nding.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • >

    > > A common way to do this is to create a 'walker' object, which will step forward once every loop, and will have a set of rules dictating when it's allowed to turn 90 degrees. These rules will depend on your implementation.

    > >

    >

    > Hey, yeah, Iv'e got that far XD Those rules are the problem, not sure how to build them in some nice way.

    >

    You could try using the built-in pathfinding behaviour (or the Astar pathfinding plugin) and use the nodes from that to navigate paths around obstacles, then build corridors or whatever along that route. Take a look at this linear pathfinding example I posted a while ago, you might be able to fiddle with it to generate routes.

    https://dl.dropboxusercontent.com/u/106 ... nding.capx

    Cool stuff man <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> Thanks. It's getting closer. Togenerate obstacles but making also sure that there always will be path, will just write a condition to not spawn any other obstacles within a grid range from current obstacle.

  • No worries. My game uses procedural generation too (check devlog link in my sig ) It's frustrating at times, but incredibly rewarding when you get it working right. Give me a shout if there's anything else I can help with!

  • No worries. My game uses procedural generation too (check devlog link in my sig ) It's frustrating at times, but incredibly rewarding when you get it working right. Give me a shout if there's anything else I can help with!

    Sweet man, will surely do. thanks a lot

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