It’s been quite a while since the last post, where I detailed a simple method for creating a procedural but orderly cluster of connected rooms. The next logical step was to weave corridors between them, in as stylish a manner possible, ideally including some branches or diversions so that some exploration was encouraged.

This work lead me to a lot more than a solution, but before I explain that let me explain the process, pictured tastefully below.

struggle_screenshot_031

To create the corridors, I began by finding a path from the ‘deployment’ room to the ‘goal’ room, traversing only wall tiles. Next I created a list of all corridor subdivisions that needed to be made by iterating through this list, finding which wall of which room they belonged to, and earmarking that subdivision to be made, being careful to only let the same tile trigger two subdivisions if said subdivisions were perpendicular.

After making the subdivisions, it was simply a matter of knocking down the walls that separated them and placing doors to rooms.

The trouble began quite literally the moment I finished the system; I couldn’t imagine a way to decorate the interiors of these rooms with the type of careful design that a strategy game at what I like to call ‘intimate scale’ demands. In tactical games where one controls individuals in a battle where their units fall easily, it’s common to agonise over every detail of the environment; the environment shapes battles, and as such needs to be a design priority.

So as much as I liked building this system, I’m afraid it’ll have to be left behind. It’s not a complete loss of course; it’s reinforced what’s really important to me in level design for this project and help steer me towards the right path.

Which leads me to the most significant outcome of this little endeavor; redesigning this system somehow snowballed into redesigning the project, which had previously consisted of the almost aimless design and development of unrelated features, into something relatively original that’s achievable in scope, focuses on the kinds of gameplay that’s most important to me and is well-suited to our abilities.

We’ve begun prototyping and should have something to post pretty soon.

Project Struggle has become Project Salvage.

  • Mike

    Great post. I especially like the graphics :).
    Could You please give more specific (maybe in pseudocode) explanation of corridor subdivisions? How do You get a starting point for each subdivision line?

    • Stew Trezise

      Thanks! Corridor subdivision points are calculated by first determining which wall (n/e/s/w) the corridor was to be created along, offset by the width of corridor I wanted (in this case it was 3 tiles).

      The trick was keeping track of which tile ‘triggered’ the creation of the wall. To accomplish this I created a class to store ‘PotentialDivisions’ in a list, and as I walked the path of wall-tiles to the destination, before I’d add a new ‘PotentialDivision’, I’d make sure there wasn’t already an identical one before I added them to the list. I was also able to check that the same tile could only create two ‘PotentialDivisions’ if they were perpendicular (else you tend to get double-corridors everywhere).

      I’m actually working right now on a playable demo of our ‘evolved’ project with a new – but very different – generation system that allows us to actually design rooms to go into a pool. I’m hoping to write about it in a couple of weeks, maybe post a video.

      • Mike

        Thank You, I think I understand it now 😉

  • Mike

    Thanks again 😉
    I made it, not exactly like You, but it works! You can check my results if You want: http://scratchgames.ja24.net/generatormap/?BinaryPartitioning

    • Stew Trezise

      That’s excellent Mike! Great work! If you don’t mind, I think I’ll email you and talk shop.