I didn't too much today, but I do have a sample random curve:
My algorithm is recursive. Breshamn (misspelled and verbified!) a line between the two points. Unless the line's shorter than a threshold, then find the center and project a third point perpendicular outwards a little bit. Then draw two lines, instead. It certainly does produce... unique paths, perfect for the level style I have in mind. The problems:
- Gonna have to modify my current border() cellular automata method to handle paths this thin. I don't quite remember why I ever wanted " . " to not become "#.#"
- Sometimes the path isn't continuous, and I'm not sure why there are breaks. My guess is rounding errors; grid's limited to integers
- The path can end up crossing itself because the angles and amplitudes permit this. Actually, I guess that's technically permissible -- not for a curve-generating algorithm, but within the context of the maps they'll be used in, it'll add flavor.
No comments:
Post a Comment