It's ugly, but it exists!
Well, I created a simple puzzle game to test the power of my search-and-reroute algorithm. Here it is: AdaptAmaze (1.3 megs).
This is a proof of concept. It isn't a game by any stretch of the imagination. But it is good to see the algorithm work. (It's actually slowed down a bunch here, for debugging purposes.)
You control your little blue token with WSAD controls, trying to get to the little green token. In a transparent attempt to make it more "gamelike", there's a fog limiting your visible range. Press "F" to toggle it.
The maze starts completely random. It probably cannot be solved as it stands. I have given you the power to choose your destiny. "P" finds a path and modifies that path towards the difficulty level you've specified.
The two text boxes in the upper left control size (smaller is more tiles) and difficulty (higher is more steps). Don't worry - modifying them prints a clear message, so you don't have to remember.
All you need to remember is WASD, F, and P.
By the way, the game has a hardcoded 10 iteration limit. This is fine in most situations, but in the most extreme situations (such as being 3 steps away and setting the difficulty to 30, or visa-versa) it can simply not work. Repeatedly re-engaging the path engine can usually "drill" a more suitable solution into the game.
In a game with more complex constraints, this wouldn't be a problem. The "space" between you and your target would stretch. Also, it would be passably easy to create special cases for the extreme situations.
But I didn't. :)
This is a proof of concept. It isn't a game by any stretch of the imagination. But it is good to see the algorithm work. (It's actually slowed down a bunch here, for debugging purposes.)
You control your little blue token with WSAD controls, trying to get to the little green token. In a transparent attempt to make it more "gamelike", there's a fog limiting your visible range. Press "F" to toggle it.
The maze starts completely random. It probably cannot be solved as it stands. I have given you the power to choose your destiny. "P" finds a path and modifies that path towards the difficulty level you've specified.
The two text boxes in the upper left control size (smaller is more tiles) and difficulty (higher is more steps). Don't worry - modifying them prints a clear message, so you don't have to remember.
All you need to remember is WASD, F, and P.
By the way, the game has a hardcoded 10 iteration limit. This is fine in most situations, but in the most extreme situations (such as being 3 steps away and setting the difficulty to 30, or visa-versa) it can simply not work. Repeatedly re-engaging the path engine can usually "drill" a more suitable solution into the game.
In a game with more complex constraints, this wouldn't be a problem. The "space" between you and your target would stretch. Also, it would be passably easy to create special cases for the extreme situations.
But I didn't. :)



