Mark Sachs (ksleet) wrote,
Mark Sachs

  • Mood:
  • Music:

"Aha," I thought, "perhaps the contents of this chest will be of value in my adventures!"

So what did I do after finally bending the new polygon clipper to my will? That's right: I decided not to use it.

See, here's the thing. I can now more or less clip any polygons I please, so I began the arduous task of integrating the new clipper into the map generation code. But then I had a thought. See, yeah, I can now clip all kinds of crazy non-convex shapes. But... do I actually need to?

...No. No, I do not. The ability to simply clip two polygons together, where one is known to overlap the other, is more than good enough for the actual task at hand. So instead of integrating the new clipper, I made some long-needed modifications to map generation, allowing it to mix and match different room and corridor types and read the whole mess from an XML file and thus making it hugely easier to create a variety of level types. For example:

Here's a map with fixed octagonal rooms and corridors of standard length. The result is quite regimented; this could be some sort of military base.

In contrast this map has large, irregular caverns and small square spaces, linked by short twisty corridors; it'd be a good mine, say.

There are a number of additional options I should add at some point, such as allowing corridors to branch off at something besides a 90-degree angle. Stitching together several in a row would make a nicely curving corridor. I'd also like to try attaching together several irregular polygons in a row to make an elongated cavern, and there are also some concepts I'm batting around for transitioning between different room types in different sections of a level. But all that aside, this is enough to do all the map generation I need.
Tags: neon galaxy
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.