Why we cannot have multistored houses by now (and other good things)

Here’s some parts of dialogue with developer about zlevels in the game.

mib_lte01g So, I’d wish to ask how can I define multilevel map area.
21:51 mib_lte01g How are z-levels handled by now?
21:52 kevindroid erm, are you adding a new map region in mapgen.cpp?
21:53 mib_lte01g Well, as usual for a single-level map.
21:54 kevindroid Are you asking about a map site that has a surface as well as underground components?
21:55 mib_lte01g But all calls of m.ter[…][…]=… (or set_ter(…) by now) add terrain to the current z-level
21:56 mib_lte01g Are there different APIs for defining underground and aboveground terrain components?
21:56 kevindroid map::generate() is called on a particular z-level
21:57 kevindroid you need to arrange for an undrground version of your site to be placed on the appropriate z-level in overmap::generate()
21:57 kevindroid let me see if I can point you to an example
21:58 mib_lte01g I looked at missile site example, but it is about underground.
21:58 kevindroid it looks like that is handled in overmap::generate_sub(), it scans through an underground level looking for places to place underground features
21:59 kevindroid or are you asking about a second story to a building?
22:00 mib_lte01g Have you noticed that there are no buildings higher than 1 level?
22:00 kevindroid yes I’m aware
22:00 kevindroid there are several infrastructure issues that keep that from happening
22:01 mib_lte01g Well, I’m asking about second story to a building.
kevindroid the main thing being that you generally expect to be able to see lower levels in that case, and we don’t have code to do that
22:01 kevindroid you could be able to make a second story, but it couldn’t have working windws
22:03 mib_lte01g As I see, it would be a pitch black room at the 2nd floor, even if all walls are replaced by windows, am I right?
22:04 kevindroid Shades has been working on the underlying infrastructure for it, but it’ll take a lot more work before it happens
22:04 kevindroid well we could have it lit, but we don’t have any way to draw the stuff outside on the ground
22:04 kevindroid because the lower level of map tiles won’t be loaded
22:05 kevindroid we need to add code to keep a reference to other z-levels around, and do it in a way that doesn’t kill performance
22:05 mib_lte01g And there’s no convenient interface (something like m.ter[…][…]) for referencing another z-levels terrain objects from the current zlevel, am I right?
22:06 kevindroid correct
22:06 kevindroid that’d be easy if we were actually holding on to that other information
22:06 kevindroid but since we aren’t it’s a problem
mib_lte01g kevindroid, may I post some parts of our dialogue about zlevels on forum?
22:10 kevindroid veryinky: yea that’s nothing
22:11 kevindroid mib)lte01g: feel free
22:11 mib_lte01g I think it may be useful for other "wannabe coders"
22:12 kevindroid Shades has adjusted the overmap to carry around all of the z-level info at once already
22:13 kevindroid I THINK we can do something similar with the map grid as well, but we’ll have to be more careful with that one
22:14 kevindroid and then we have to update the draw code to potentially show things from multiple z-levels, which will be a smaller amount of code, but much trickier

It looks even more trickier to add towers and skyscrapers to the game than I supposed before…

I have one question. Where exactly did you get this info?

At IRC channel, #Cataclysm-DDA. Take a look at the main page.

how do other rogue likes handle multiple z levels? any open source ones we can pull code from? Or would this a be a significant re-write to the game engine?

so it looks like the game has 2 z levels. above ground and below ground right?

It actually has a few. Above ground > below ground > deeper > deeper > deeper > even deeper still.

That said they couldn’t just rip the z level code from say Dwarf Fortress because loosing is fun they treat z levels differently. One big problem is that above ground (floors 2+) could not have windows or would and they would seam very odd because you couldn’t look down through them. Take for example the missile silo. There is empty space between the ledge and the missile but you can’t see how far down it goes until you are at the bottom.

That isn’t the only problem with it but it’s the easiest to explain. But worry not, people are looking into a way to make it work… or they were and gave up hope. One or the other anyway.

Having z-levels above the ground is just as simple as having z-levels below the ground. The game even already has checks in place for above ground levels. Everything is already in there, it took me just about 10 minutes to make the shelter have another level on top instead of the basement, for example. Multi-store buildings will be in my next Cataclysm: Metal Gear Solid release.

Ah, badass. In this case disregard me previous statement.

Why do you think they couldn’t have windows, why wouldn’t you be able to look through them?

You have an option to show the ground just as if you were on the ground level, or perhaps show all the blue tiles outside representing the sky. I think the first choice is better, so I’ll make it all look the same as if you are on the ground floor, except there will be no doors leading outside and if you try to go out through the window you’ll get Y/N no prompt asking you whether you really want to jump down. And that’s all there is to it. The hardest part is to “draw” those floors in C++, as it is done now, but if there was an editor people could be making new buildings and other terrain features in a matter of minutes.

Terrain and item editor is one of the first things I would make if I was making this game from scratch. There are so many of these items and terrain features it took days and months to make them and clear the bugs out, but if only several hours was invested to make an editor all that content could have been created in 100x less time, there would be consistent format easy to maintain, control and change if necessary, without risks of screwing data structures and other things in the code itself.

Take for example the missile silo. There is empty space between the ledge and the missile but you can't see how far down it goes until you are at the bottom.

That isn’t the only problem with it but it’s the easiest to explain. But worry not, people are looking into a way to make it work… or they were and gave up hope. One or the other anyway.

How is that a problem? That hole around the missile is black because it’s dark down below and it wouldn’t look much as a hole if you were to draw lower level tiles there instead. Given the resolution of the game I think it actually looks pretty good.

I was just daydreaming of having an apartment building…so many rooms…imagine making a loud noise like knocking something over and hearing doors being bashed in a few levels above you. dozens of doors, dozens of zombies suddenly fill the halls as they all come munching for you.

now imagine a room for each type of item! an entire apartment unit filled with guns. oh yessss

As said disregard my previous statement. (now two of my posts back)
The information I had was likely old and thus not accurate.

As for why I said showing another level would be a problem is that the game (or at least when i read it) doest load z levels that you aren’t on the same way it does for the active one. I believe it was to help keep loaded info to a minimum at the time.

And I agree the missile silo would look rather odd if it did show the bottom floor instead of just an open gap.

I’m not a coder so I can’t… entirely follow this thread.

But I have to say, nothing would change this game (in a good way) more than simply having multiple Z levels above ground. The possibilities are basically endless, and it will make towns more interesting to explore, shelters more interesting to set up, and bring in the possibility of genuine cities full of office blocks and apartment buildings (and a truly terrifying density of enemies). Right now we’re stuck with basically smalltown USA. Which is fine for now, but there’s so much more we could be doing. And honestly, even smalltown USA has second storey houses.

So if there’s any way to make this work, I hope it’s on the way.

If/when this feature gets implemented, I’m almost certain there’s going to be problems with all the zombies in an office building trying to path out of it through the windows as soon as someone makes noise. That’s sort of terrifying to think about, actually.

If/when this feature gets implemented, I’m almost certain there’s going to be problems with all the zombies in an office building trying to path out of it through the windows as soon as someone makes noise. That’s sort of terrifying to think about, actually.[/quote]
And for some reason I also find this image kinda amusing, the thought of zombies just smashing windows up high and then falling to their re-death(?).

You hear a loud thud to the [direction]
You hear a Splat to the [direction]

well if it’s doable I would LOVE to have giant termite mounds! drools

but yeah that might be a bit laggy one way or another,

Why do you think they couldn’t have windows, why wouldn’t you be able to look through them?

You have an option to show the ground just as if you were on the ground level, or perhaps show all the blue tiles outside representing the sky. I think the first choice is better, so I’ll make it all look the same as if you are on the ground floor, except there will be no doors leading outside and if you try to go out through the window you’ll get Y/N no prompt asking you whether you really want to jump down. And that’s all there is to it. The hardest part is to “draw” those floors in C++, as it is done now, but if there was an editor people could be making new buildings and other terrain features in a matter of minutes.[/quote]

you could do it like dwarf fortress and just have dots (that are the same color as the tiles below them) represent faraway ground

that really would be a problem. right now, with an I7 processor I see a slowdown when I have +30 zombies and a fire and there’s a smoker etc etc, what would +100 do?

Problems hhhhhooooo!!!

[quote=“Hyena Grin, post:11, topic:694”]I’m not a coder so I can’t… entirely follow this thread.

But I have to say, nothing would change this game (in a good way) more than simply having multiple Z levels above ground. The possibilities are basically endless, and it will make towns more interesting to explore, shelters more interesting to set up, and bring in the possibility of genuine cities full of office blocks and apartment buildings (and a truly terrifying density of enemies). Right now we’re stuck with basically smalltown USA. Which is fine for now, but there’s so much more we could be doing. And honestly, even smalltown USA has second storey houses.

So if there’s any way to make this work, I hope it’s on the way.[/quote]

It’s nice for variety in itself, but to make it interesting you have to make it interesting, that is different, but you also have to have some reason to go there, risks and rewards that needs to be balanced accordingly.

Take megastores and hospitals for example. It’s nice to have them, but is anyone actually going there?

I think multi-level buildings are opportunity to make some interesting new additions to the game. First of all there should be noticeable difference in combat tactics with limited space and options to run away on upper floors. But I’d like to make these buildings different in the gameplay itself. I think new actions for jumping and sprinting could make a real difference here, to jump from balcony to balcony, from roof to roof, jump over something, or jump of the building with a parachute or glider, or jump in a pool as someone mentioned previously. Hanging of the edge, hiding there or jumping from wall to wall, like in some jumping puzzle platformer, like Prince of Persia or Shadow of the Colossus. I think that would fit well with this game.

By the way, does anyone know if there is any roguelike where you can jump or do any of that stuff I mentioned above?

DF has some basic climbing mechanics. Nethack has a jumping skill.

Not sure otherwise. That sounds kinda cool, but I’m not sure I’d ever actually need to use it :stuck_out_tongue:

If/when this feature gets implemented, I’m almost certain there’s going to be problems with all the zombies in an office building trying to path out of it through the windows as soon as someone makes noise. That’s sort of terrifying to think about, actually.[/quote]

Flying zombies.
Goddamn it, as if we didn’t have enough things to worry about. >.>

If/when this feature gets implemented, I’m almost certain there’s going to be problems with all the zombies in an office building trying to path out of it through the windows as soon as someone makes noise. That’s sort of terrifying to think about, actually.[/quote]

Flying zombies.
Goddamn it, as if we didn’t have enough things to worry about. >.>[/quote]

Death From Above! Imagine a hulk landing on you as you make your way past a building …

Dwarf Fortress Adventure Mode, but not until the next release.