Randomly generated path

Hi there. I’m sorry if I sound a bit newbish, but well, I am a newbie here.

I want to develop a game where the player is running on a pathway in a forest. I want to know how, if there’s a way, to randomly generate the pathway with timely turns and objects on the path to avoid. Is there a functionality in JME to handle that? The basic design of the game is score-based so the game technically runs forever, given that you don’t ‘die’. So I can’t make a world map, I need dynamically created pathway. Where the player sees a never ending horizon. Hope you get what I mean. :S

Any help, guidance, tips would be much appreciated. Thanks.

A* (A-Star) is the most common algorithm to do that. As the actual implementation and use is quite specific to a game its best (and quite easy) to do this yourself really. Looking for the term in the forum here or on google should give you enough information.

I don’t think you quite got what I meant. Isn’t A* for path-finding? I am more concerned about how to create the random the random path (and generate the graphics). Like for example in the game ‘Temple Run’? :blush:

Well you nodes could be created with some randomness (the cost or node travels) but still you’d need some way to make an actual path no?

Well generally A* is used for pathfinding, the question is asking about dynamically created worlds.

I guess something like the various infinite terrain and infinite corridor things I’ve seen discussed a few times might help.

The problem you are going to have Neogeek is that for the sort of game you are describing the creation and positioning of the path is a lot of the game design - so even if you were able to take an existing system it wouldn’t give you a unique game of your own design. It would just give you a clone of that existing one.

True that Zarch.But I’m not looking for an existing system. I’m new to the game programming field so I just want an idea of how can I implement it? I was thinking in terms of block of the world generated and as soon as the player reaches the edge of that block, the same block is automatically generated on that side of the edge while the old one deleted, giving the perception of running on an infinite world. Is it possible? Or maybe you could suggest a better solution?

(I’m sorry, I’m from engineering background. I know I suck at even explaining it. Bear with me.)

Yes. The treadmill type approach can be done. Your best bet will be to google a few things like fractal terrain, procedurally generated terrain, infinite corridors, etc and see if you can find an algorithm you like the look of.

Also take a look at the terrain and height map stuff in jme and see if that will help you out.