New Labs & maptile stuff

I just read this and i want to add that it looks incredibly amazing. You are the hero cataclysm deserves, and the one it always needed.

Any update on progress here? Your work looked cool back then, and still does. We could use better labs!

It’s sort of stalled until some real coder decides to update mapgen, since that’s beyond me. I have a bunch of preliminary maptiles, but I didn’t want to do too much work on them if they won’t be used.

I also started to rework the item groups first to simplify making maptiles. So I might try to re-submit that to the github over the holidays.

I would love to see this entire idea happen; makes me wish I had the free time to burn learning to grok Cata’s code so I could pitch in. ^^;

Until that (probably distant) day comes, however, I can pitch in this idea:
This would also work great for creating another missing city feature: industrial districts.
Any town of reasonable size is always going to have at least a block or two of rundown industrial park- a whole district of things like large multi-building factory complexes, microbreweries, warehouses, chemical processing and storage plants, workshops, feed lots, lumberyards, and, of course, some vacant lots and buildings that were crumbling before the apocalypse. Maybe even throw in the occasional liquor store or strip club just for bonus “that part of town” vibe. X3

You could use the same outline template/code module that would generate the connected residental/commercial buildings to generate these: Just swap out the store and apartment tiles for industrial-themed tiles, scatter things like standing tanks of chemicals and storage sheds around the paved “parking lot” sections, and you’d get really nice organic-looking industrial lots instead of strip malls, row houses, and residential loft apartments over storefronts.

[quote=“Sunshine, post:23, topic:9789”]It’s sort of stalled until some real coder decides to update mapgen, since that’s beyond me. I have a bunch of preliminary maptiles, but I didn’t want to do too much work on them if they won’t be used.

I also started to rework the item groups first to simplify making maptiles. So I might try to re-submit that to the github over the holidays.[/quote]

Just curious, what’s the problem with mapgen?

^ It doesn’t work like this.

It’s sort of stalled until some real coder decides to update mapgen, since that’s beyond me. I have a bunch of preliminary maptiles, but I didn’t want to do too much work on them if they won’t be used.[/quote]I am frequently working on mapgens. What changes do you need so that your maptiles will work? From skimming the thread it seems like they would just be drop-in replacements for the existing system.

PS: Also, I’ve got a PR live for changing the overmap generator for labs, for the meta-lab layout. New build_lab, other underground overmap code cleanup by sparr · Pull Request #14475 · CleverRaven/Cataclysm-DDA · GitHub

[quote=“sparr, post:27, topic:9789”]I am frequently working on mapgens. What changes do you need so that your maptiles will work? From skimming the thread it seems like they would just be drop-in replacements for the existing system.

PS: Also, I’ve got a PR live for changing the overmap generator for labs, for the meta-lab layout. https://github.com/CleverRaven/Cataclysm-DDA/pull/14475[/quote]

I made that first batch so they would all just tile a plane and hook together on the edges. But there are two drawbacks. One, there’s no path checking. Like it would be possible to create sealed rooms or sections of the map that were accidentally cut off. Two, the edge of the lab would be really jarring, because there would be half rooms right up against the solid rock.

That was just a suggestion, though, I can make tiles for whatever.

Looking at what you’re adding for labs, I could make 5 types of tiles to cover all possibilities.
A=1 edge connected.
B=2 adjacent edges connected.
C=2 opposite edges connected.
D=3 edges connected.
E=all 4 edges connected.

But, it couldn’t just drop them in, it would have to figure out what type of tile to place and how to flip/rotate it.
Instead of this layout:

X
XXX
XX
X
X

It would have to figure out to make it more like this:

A
DDA
BD
C
A

and it would need to know that the C is a north-south tile, not an east-west, and rotate/flip it correctly.

If you want to make actual stairwells/elevators instead of the random stairs we have now, then that would add one more tile type, and the game would have to match up-stair tiles on one z level with down-stair tiles on the level above.

I don’t really know how hard or easy all that would be to program.

One thing that comes to mind, which would make both tile creation and the edge programming a lot simpler, is to do it in a larger-scale version of what you suggested for the conjoined buildings thing:

First it figures out the general shape like it does now:


X
XXX
XX_
X
X


And then it could just trace around it:
CAC
CBXBC
AXXXA
AXXBC
CBXA_
AXA
CAC
You’d only need two edge types that way: Straight pieces(the “A”'s ) and concave corners (the “C”'s ). The convex corners (the “B”'s ) could be filled in with regular tiles.

For something like stairwells, you could have it “drill” them into the lab in places certain conditions are met- say, a hallway on one floor intersects with a hallway on the floor below, or maybe when you have an edge tile over another edge tile. There’s already things like that in the code, like how it generates the metal bars-and-canal room when a sewer crosses a lab.

[quote=“Sunshine, post:28, topic:9789”]Looking at what you’re adding for labs, I could make 5 types of tiles to cover all possibilities.
A=1 edge connected.
B=2 adjacent edges connected.
C=2 opposite edges connected.
D=3 edges connected.
E=all 4 edges connected.

But, it couldn’t just drop them in, it would have to figure out what type of tile to place and how to flip/rotate it.
Instead of this layout:

X
XXX
XX
X
X

It would have to figure out to make it more like this:

A
DDA
BD
C
A

and it would need to know that the C is a north-south tile, not an east-west, and rotate/flip it correctly.

If you want to make actual stairwells/elevators instead of the random stairs we have now, then that would add one more tile type, and the game would have to match up-stair tiles on one z level with down-stair tiles on the level above.

I don’t really know how hard or easy all that would be to program.[/quote]We actually already have code for most of that. The road overmap generator checks for neighboring roads and re-assigns them to be “road_straight_ew” or “road_tee_nes” etc. It wouldn’t be hard to do that with labs. Alternately, there’s another sort of functionality in “road_fourway_nesw” that polls the adjacent types to decide whether it should be a plaza, and I’ve already greatly expanded that functionality in my road mapgen PR. If you make the 5 types of lab tiles you’ve suggested, I can make the mapgen smart enough to pick between them.

[quote=“Sunshine, post:28, topic:9789”]One, there’s no path checking. Like it would be possible to create sealed rooms or sections of the map that were accidentally cut off.[/quote]This part is much harder to solve. However, with the maps having more chokepoints, you could rely on those to give the necessary dead ends, and not make the tiles capable of producing unreachable areas.

My idea for improving labs would be that you designate tiles instead in the shape of hallways, and then it lays the hallways out like roads. I wrote a little more about it here: http://smf.cataclysmdda.com/index.php?topic=10460.0

I can make some. For testing, I might put up preliminary versions without monsters or items, because that’s really the really time consuming part. Making ASCII art maps is pretty fast.

Yeah, I made them have turns and dead ends so there wouldn’t be an easy way across a huge lab. But if the game generates halls and maze-like maps, instead of one big blob, I can make the tiles more open.

[quote=“scorpion451, post:29, topic:9789”]One thing that comes to mind, which would make both tile creation and the edge programming a lot simpler, is to do it in a larger-scale version of what you suggested for the conjoined buildings thing:

You’d only need two edge types that way: Straight pieces(the “A”'s ) and concave corners (the “C”'s ). The convex corners (the “B”'s ) could be filled in with regular tiles.

For something like stairwells, you could have it “drill” them into the lab in places certain conditions are met- say, a hallway on one floor intersects with a hallway on the floor below, or maybe when you have an edge tile over another edge tile. There’s already things like that in the code, like how it generates the metal bars-and-canal room when a sewer crosses a lab.[/quote]

Yeah, I like the idea of a separate kind of tile for edges. The weakest part of lab tiles is where they butt up against solid rock. And with aboveground tiles, they need some kind of outer wall. Very few houses have exposed bedrooms and kitchens on the outer edges.

Yeah, I made them have turns and dead ends so there wouldn’t be an easy way across a huge lab. But if the game generates halls and maze-like maps, instead of one big blob, I can make the tiles more open.[/quote]

What if these ideas were all combined with what I suggested about the edge tiles and stairwells?

We start off like I suggested, generating the basic blob of the lab, and surrounding that with edge and corner pieces. These could all be designed to create a ring of closed “low security” rooms around the outer edge of the lab that connect to the interior by a continous strip of open-sided hallway, sort of like this:

#= outer walls and room(s) with door(s) to hallway as needed
H = hallway
R = empty interior to be filled in with other stuff.

#### #### #### #### ####

#### #### #### #### #### HHH#

##HH HHHH #### H##H #### #### H#H#
##HH HHHH HHHH HHHH HHHH HHHH HHH#

##HH RRRR RRRR RRRR RRRR RRRR H#H#
##HH RRRR RRRR RRRR RRRR RRRR HHH#
###H RRRR RRRR RRRR RRRR RRRR H###
#HHH RRRR RRRR RRRR RRRR RRRR HH##

##HH RRRR RRRR RRRR RRRR RRRR H#H#
##HH RRRR RRRR RRRR RRRR RRRR HHH#
#HHH RRRR RRRR RRRR RRRR RRRR HH##
###H RRRR RRRR RRRR RRRR RRRR H###

and so on.

Then inside this outline, we place stairwells and elevators at random places.

Then we use Vache’s idea to lay out a web of walled-in, grid-style hallways connecting the outer ring and the stairwells and elevators.

We can spice this basic grid up with things like rows of offices and storage closets, and throw in some turret checkpoints and locked metal doors with keycard access panels or hackable computers, but the idea is that this core set of hallways is how people got around the lab when it wasn’t abandoned, so they could all be hypothetically cleared out and traveled all the way down to the lowest level.

So that would leave us with a grid of cleanly walled-off holes that can be filled in with dedicated “room” tiles. These are where Sunshine could really go crazy with the floor plans, because these areas will already be walled in on at least a couple sides. Give each a designated “this side connects to hallway” matched up to the hallway grid and the rest of the sides can connect (or not connect) however you want. Even if you have weird dead ends and places where you have to bash through an office wall into a lab room to make progress, it will still make sense because they’re all connected to the hallways … its just that the hallways might be guarded by a turret or a cave-in (aka rock wall in the middle of a hallway with rubble on either side) right now, so you have to take a half-life style detour through some bunk rooms and a quarantine chamber.

There are a million ways it could be done. In fact , there’s no need to pick just one. The game could use different methods for different types of dungeons or buildings. But in the end it’s really up to the people who are willing to code it. Whatever system people add in, I’ll make a stock of tiles for.

My one reservation is that there can’t be too many types of base tiles. Making, let’s say, 10 tiles each for 5 base-types is doable. But, if there are 15 or 100 base-types, that quickly becomes too much work.

https://mega.nz/#!aQ1GkaqQ!dKL_IRVNdit8ME6JjRxp5hmvOKJR5rY4RIpKlfftPSc

Here’s a set of maptiles for testing. But they’re not done yet, as they don’t have items or monster groups, and they probably need some further adjustments/TLC.

They’ll look something like this:

Notice that the corners are solid, so you’ll see those 4x4 pillars in the center of room clusters. I don’t know why the concrete floor is cyan. I might also change the hallways to a different color from the rooms just to help differentiate them.

I can make more tiles to match the ratio they are spawned. Presumably the middle pieces (with 4 edge connections) will still be the most common. But for now I just made 10 of each. Also, there’s nothing here for lab finales, which will need their own set.

EDIT:

It looks like it works fine with preexisting barracks/prisons from normal labs. They can work as dead end pieces.

This is looking really good.

I think the best part of this is that even just with this simple prototype build its already starting to look both more organic and more like a functioning facility.

I think I might pitch in with making the layouts myself once the templates get figured out, but I figure we don’t want too many cooks in the kitchen right now.

One idea that comes to mind are some including some minor setpiece/honeypot/miniboss rooms. Just brainstorming…

  • a room that has a bunch of electronics components and tools scattered around a few workbenches and maybe a CMB or two if you’re lucky (and maybe a bio-operator if you aren’t)
  • a room that has a bunch of broken glass and smashed equipment with intact vials of mutagen and serum scattered around…
  • dissection rooms which may contain some dead scientists, and maybe whatever killed them as well ala Independence Day
  • a hydroponic garden filled with dead plants (because no electricity) but also with some rare seed varieties and some gardening supplies…

One thing I might tackle is working up some unique lab-flavored enemies to enhance the unique vibe of the labs: “crazed mutant scientist”, “feral hybrid”, “mutant lab rat”, “Mutagen Addict”, etc. We couldn’t actually use the mutations themselves because the code isn’t there yet, but I think that it wouldn’t be excessively hard to create some stock enemies with pseudo-mutations that give them bite attacks, or claws, or tentacles, or what have you. It’d take the labs to a whole new realm if that pond room in your mockup occasionally hosted a fish-man playing kappa, and you could suddenly find yourself in a room that used to hold a bunch of mutagen and rat cages, and now holds a bunch of empty vials and several mini-chimeras.

Be pretty neat if one of the labs has its own faction of lab scientists unaffected by the cataclysmic events above.

Why the solid corners and pillars in some rooms?

Also, what’s the plan to cohesively item/monster-ize rooms that span across mapgens?

Shame this never materialized, any chance of a revival?