New Labs & maptile stuff

Labs right now are kinda boring. I like procedural generation for dungeons, but since the grammars are so simple in DDA, the game ends up creating only three or four types of maptiles in labs. There’s the big open room, the hallway intersection with four rooms, and those rooms with the annoying diagonal doors. I also really like the premade maptiles, but there aren’t enough of them. After you’ve seen them, you’ve seen them. Beyond the maptiles themselves, is the way they connect. There is always a wall running along the edge, giving you a clear idea as to where the tile is. And since there are always doors at all four faces, it’s really easy—barring turrets—to walk straight across an entire lab with no interruptions.

So my idea is to make a stock of premade tiles that can fit together in interesting ways. Rather than put walls along the borders, there will be partial rooms at the edges of the maptiles. When adjacent tiles connect, those rooms will combine into novel shapes. The tiles can be rotated to increase the number of possible combinations (and even flipped horizontally and/or vertically). Hopefully, those combo-rooms will keep the labs somewhat fresh even after a player becomes familiar with the tile set. And although the labs will still be on a fairly obvious a grid, by adding T-junctions, gates, turns, and dead ends to hallways, it should be a bit more maze-like.

Here’s a picture to illustrate:

These are two of same tile side-by-side; it’s just they’re rotated to different degrees. At the corners you can see the partial rooms for this maptile, and down the middle how they join together seamlessly.

I’ve already made a starter stock of about twenty maptiles for anyone who wants to look them over.!fJMDDZzR!z-A4vtFPHsxR6WBBmp2V2ErIBJu7gk2dbV1ZbxtEDk0

The terrain and furniture for these are done, but I’m still playing around with item frequencies and monster placement and traps and such. And there are no doubt mistakes in there since I’m still figuring out the jsons. I can handle that part OK, but the mapgen code is beyond me. So, it’s really up to someone else to decide if they want to make use of this stuff. If it works, I could also make sets for other buildings like mansions/bunkers/whatevers.

Yes please, that fits in quite well with how we like to do things, but lab mapgen hasn’t gotten any love in a long time now.

Actually that’s a wonderful idea, good job.

Looks cool and sounds like a great idea, I like it.

Above ground buildings would require a little more work to place correctly. They’ll need edge, center, and corner pieces, and those will only be able to go in their respective slots rotated/flipped.

This is just a quick template/example with carpeting so you can see the tiles easier.

Even though I could mess around with the inner rooms and halls, the outer walls would always have the same shape so they’ll line up when stacked vertically. Stairs will also have to line up. Probably stairwell tiles would be tagged ‘upstair’ or ‘downstair’, and then those would get placed over each other.

It will need 3 tile types, however, it might not need separate tiles for z-level depth. Like I could label everything outside as a # on the map. Then, depending on the z-level, the game would interpret the # as open space, grass, or solid stone. It could make mansions of arbitrary height or depth. (Although i guess it would need to do the same with windows/doors too. Otherwise your basement would have windows looking out to solid rock.)

So as you can see they’d need more work to get working, and they would be less random than an underground dungeon, but above ground buildings might also be OK.

These are amazing!

This is a lot like what I was describing with the framework for the variable shape/size specials. I might have you make up a few test cases for me to use when (if) I get around to implementation.

Yeah. If there’s some kind of algorithm that makes paths I could make better tiles.

What I made so far is for really simple and ‘dumb’ generation. Like, the game doesn’t have to do anything but slap the tiles next to each other. That’s the easy way to do it, but it ends up kinda samey and grid-like. It’s also possible for there to be rooms that are completely sealed off, or even whole sections of the map if the RNG is being mischievous. That would kinda suck for someone going into a lab, but it would really suck for a lab start if a player spawned in a closet that was only connected to another closet. (My answer was to put telepads in areas that might get sealed off, so they could at least get out, if not get back in again.)

Also, because every tile has to connect to every other tile, there is only one type of ‘plug’ at the edges. That really limits how much you can vary the rooms on a 24x24 grid. If you look through the example jsons, you can see they’re variations on just a few themes. But if there was a network of tunnels, I can make different types of edges, and thus more types of rooms/more expansive rooms.

Here’s an example pic to show what I’m talking about:

I could make a set of tiles for main hallways that go straight, T intersection, 4-way intersection, dead end, and curve. Each map tile would have one type of edge allowing passage (marked here in green carpet) and another type for blocked edges (marked in red). In this pic along the north and east faces those edges would just end very abruptly, so there would also have to be another set with a red edge and an outer/rock edge.

So, a hallway might look like this. (t)unnel (L)ab (e)dge and edge with (c)orner.

cec ceLec eLtLe eecLtLceeeeeeeeec LLLLtLLLLLLLLLLLec ttttttttttttttttLe LLLLLLLLLLLtLLLLec eeeeeeeeecLtLceec ceLec cec
That makes for a pretty huge lab. We could make it more compact, but then I’d have to figure out every combination of red/green/rock edges a tile could have -which is probably a lot. Or I could add more deadspace to the tiles, making a lab that’s spread out over a big geographic area, but which is made up of tight tunnels and smaller rooms embedded in solid rock.

Here’s a better/more compact way to do the same thing.
(t)unnel, (e)dge and edge with (c)orner.

cec ete ete eeeectceeeeeeeeec tttttttttttttttte eeeeeeeectceeeeec etc etc

ANd a picture. Green and red edges for tunnel tiles. Red, purple, and white edges for the outer labs.


Keep going would love to see you do alot more, bunkers need some love.

Could this also be applied to mega-malls? I have yet to find one ingame for some strange reason, but hey. Very, very cool.

The malls right now are pretty good. I think real-word places look best when they’re handmade like that. Things like houses, malls, airports, stadiums, and other mundane places should look like the player expects or it breaks immersion. Procedural generations works best on weird places where you don’t have any expectations, like labs, temples, robotic factories, or any kind of ‘dungeon’.

There could be a less dramatic set of tiles for malls. Like, the mall stays pretty much the same, but it swaps out one type of store for another. Maybe one mall has a movie theater and another has a food court. Things like that.

Yeah, nothing nearly so drastic, just dumb block style replacing for different stores. That’s pretty much how malls work anyway - one store goes out of business, another moves in and occupies the exact same footprint/floorspace. The main idea would just be to keep people from taking two lefts and a right, to skip all the other rooms and head right for the liquor store any time they find a mall. That sort of thing.

I like your thinking though, regarding ‘dungeon’ style buildings. Well-thought, and I completely forgot about temples.

I was thinking about how to use maptiles for more mundane things like houses. One thing CDDA lacks at the moment are downtown areas where the buildings are close enough to touch. Using pretty much the same idea for labs, we could make a block and then fill it in with the appropriate type of tile.

F=store front




or weirder shapes…



Then the buildings would touch. The interiors could have weird shaped rooms, but the outer walls should be regular so that we can stack them up 4 or 5 stories and they’ll always line up vertically.

So here’s a quick pic of what it could look like.

I just made one corner, but you can see two different types of storefront: one that juts out and one that’s a little recessed. Then there are two alleys giving access to the hollow interior to the block where there would be fire escapes and dumpsters. The bottom floor would be retail and above that would be small apartments.

Looks pretty cool.

Also, having tiles like that could help with adding buildings with more than one z-level.

And then some skyscrapers in between!
Probably not more than 15 floors high and 3 floors deep.
Maybe subway on multible levels.
Let`s create megacities!

One potential problem I’ve noticed with trying to structure buildings like that is if one shop is spread across two tiles you have to make sure the items are consistent. You could make it to where things like offices and bathrooms are the only things split across multiple tiles, that way they can fit into any shop or restaurant.

Yeah I thought it would have some type of generic retail space for those edges. Sorta like pawn shops. Probably all of the maptiles would be labeled, ‘historic downtown’, or something, because you wouldn’t know exactly what would be in it.
Also, there have to be foyers and stairwells leading to the upper levels, so I might try to work those onto the edges somehow.

Yeah, as long as there aren’t too many of then, as each wall-shape would require a whole different set of tiles. But that’s good for multilevel houses where you could have a collection of sets, where in each set the floors, and rooftops, line up vertically.

And then swap maptiles from that set depending on the floor. So, on the horizontal plane it wouldn’t have any variation or connections, but vertically you would never know what you’d find on the second floor or in the basement.

That might be the easiest thing to add, since it would take less mapgen magic. Also once Z levels are in, new multilevel houses will need to be made anyway.

I downloaded the HOTLABS file, how does it work?

It doesn’t yet. It’s just for perusal so far. You can debug them in with the map editor if you wanna look at them.