Wednesday, June 16, 2010

Well, something

Another day with an ample magnitude in the time category. Camp got me thinking about collaborative diffusion (an old pathfinding technique) in a new way at least... the concept of ghost zones and "adaptive mesh refinement" sound suspiciously like fancy terms for things I've ended up figuring out for myself in previous years.

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.
So that's about all. I have a vague idea in my head to use cellular automata (or similar) to produce a random curve, but only time will reveal how useful this may be.

No comments:

Post a Comment