0 Favourites

How do I generate procedural path?

  • 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

  • >

    > > 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!

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
187 45,121
Yann's avatar
Yann
Unread hot topic
99 10,127
karshinkoff's avatar
karshinkoff
Unread hot topic
0 Favourites
Path Movement Behavior
98 52,468
R0J0hound's avatar
R0J0hound