Random Path Creation

KrakenCMTKrakenCMT Member Posts: 22
edited June 2012 in Working with GS (Mac)
Hey guys! I didn't find what I needed in a search and I always seem to get a lot of good responses here from the gurus for any questions I have.

I have an idea for a new game, but it involves creating a random path from one side of the screen to the other. It will have an underlying grid, so it will be like calculating a path from one side of a checkerboard to the other. Does anyone have an idea of how to do that or is there a place where I can find info like that? If I can't figure this out, I can just lay out a lot of layers by hand, but it would be insanely cool for the game itself to generate them.

Answers

  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Just a few questions:

    * Does it have to work its way around objects or is it just left to right (or right to left..lol)?
    * Does it have to work out a shortest route or will any suffice?

    I may have an idea as to how to do this (on paper, not actual rules) which may help.
  • KrakenCMTKrakenCMT Member Posts: 22
    Hey Robert! I guess I should have added some parameters to the question. :) Yes it will have to go around obstacles and it's mainly from a random spot on the left edge of the screen going to the right. It could change direction several times, but will eventually start going back to a random location on the right edge. And it won't be overlapping itself.

    I'm mainly looking for the basic idea of how to set up the logic, but actual rule setup for Gamesalad isn't necessary. I figure if I can understand the logic, then the rule setup will become clearer to me.
  • robert.mccarthyrobert.mccarthy Member Posts: 165
    Also do you want it to hit the obstacles and then re-route or just work it out and miss it before it gets near?
  • KrakenCMTKrakenCMT Member Posts: 22
    The game will randomly place the obstacles, then the path will steer clear of them, but it would be OK if the path went right up to the square right next to the obstacle, but it doesn't have to.

    I'm also trying right now to work out some of the logic myself to see if I can do it, but it's trial and error for me. Progress is slow. I'm mainly an artist and just now learning some of the more complex logic needed to do things like this. I'm not quite there though.
  • KrakenCMTKrakenCMT Member Posts: 22
    Rethinking this a bit, I feel that the paths should be able to overlap and cross over itself and perhaps that would be better for the game anyway.

    Still working on a possible solution, I could be way off base with it, but if I can get it to work, I'll share with the community.


Sign In or Register to comment.