Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upExperimental Z-Levels Mod(Ready) #7974
Conversation
This comment has been minimized.
This comment has been minimized.
|
Take a look at https://github.com/CleverRaven/Cataclysm-DDA/issues?labels=Bounty+Issue for a list of what we need to get it working. |
Frost-wood
added some commits
Jun 16, 2014
This comment has been minimized.
This comment has been minimized.
|
Everything seems to be working as I want, so it's done and ready for review and merge. I just wanted some positive z-levels, so I could create 2 or more story buildings, like we can do with basements. Once the base is in the master, other people(including me) can work on the list. |
Frost-wood
changed the title
Positive Z-levels(WIP)
Positive Z-levels(Ready for review)
Jun 16, 2014
This comment has been minimized.
This comment has been minimized.
|
OK. This looks like the Faux z-levels we had from Pet-A-Kitten and that are present in Cata2. We need folks to be able to climb up holes (or at least huck a grapnel up, etc and hope for the best) and shoot/throw stuff at lower levels, as well as be able to get a good idea what's on that lower level. Not to mention having reality-bubble processing on multiple levels. Allegory of the pancakes: Each Z-level is a pancake in the stack. If you put syrup on the top pancake in the stack, it soaks through and maple-izes lower pancakes. When you cut out a forkful (affecting part of every pancake in the stack), you can look and see multiple exposed z-levels at once. If you feel like it, you could spread butter/jam/etc on any given pancake, affecting that pancake whilst not affecting other pancakes. And despite the fact that you're only paying attention to that one pancake whilst spreading the spread, all the pancakes are nevertheless cooling, and are likely at differing--but similar--temperatures. Likewise, we need all z-levels to be monitored simultaneously, no matter what the character happens to doing or where xe is. |
This comment has been minimized.
This comment has been minimized.
|
I agree that the positive z-levels work the same as the underground z-levels, in that they don't effect other z levels. However, underground faux z levels are in the game, so I was hoping that positive z-levels would be added in the same way for now. I have seen the issue list to get z-levels working, and I understand what needs to happen, however someone has to start somewhere and I'm not going to be able to do this alone. To implement a SEEZ, there first has to be something to see, to implement cross-z level ranged firing there has to be something to fire from and underground z-levels aren't the best to test these things because a lot of underground is solid rock. My theory is once this is merged, and 3-d buildings are added, people will work on the 3-d issues naturally, as adding the stuff outlined in the bounty issue will seem less intimidating. |
Frost-wood
changed the title
Positive Z-levels(Ready for review)
Positive Z-levels(Ready)
Jun 17, 2014
This comment has been minimized.
This comment has been minimized.
|
I agree with Frost wood there, even if it's not much, having a small groundwork for zlevel will encourage other to take a shot at it to. |
This comment has been minimized.
This comment has been minimized.
|
I agree with @lain and the author of the PR. |
This comment has been minimized.
This comment has been minimized.
|
I would suggest, as part of this PR, to submit at least one building that takes advantage of positive z levels. Apartment/office/hotel towers are all buildings where it would make sense, or just add a simple two story home. |
This comment has been minimized.
This comment has been minimized.
|
Sooo...? Tonight I can shoot Frost-wood the second floor of the office tower that's been sitting around since last summer (I hope I still have it) to see how well it works. |
This comment has been minimized.
This comment has been minimized.
|
If you have it I will merge into this pr, it would be appreciated, as I have been looking forward to 3d buildings for a long time. |
This comment has been minimized.
This comment has been minimized.
|
I was thinking of doing the motel, as I am working on the Rivtech pr, and the z-levels on the motel are practically the same. |
This comment has been minimized.
This comment has been minimized.
|
You can implement whatever you like in your own working branches. By all means, test and implement your theories. If they work, you may end up with a paycheck from us. :-) But you don't get to use mainline as your testbed. You want your implementation merged, it had best address at least one of the core issues Kevin linked. |
This comment has been minimized.
This comment has been minimized.
|
This isn't really at all related to the actual engine-changes for z-levels(i.e. having multiple z-levels loaded into the reality bubble at once and all that stuff). It just extends the current z-level implementation to "above ground". I don't see the harm. Note: I also don't see the benefit. This doesn't get us any closer toward the desired z-level features. I'm just saying, it's pretty much an orthogonal feature at this point, and if that somehow improves the experience, why not? |
This comment has been minimized.
This comment has been minimized.
|
@acidia & @Frost-wood : That's great! @CIB: I say the office tower would greatly improve the experience. |
This comment has been minimized.
This comment has been minimized.
|
An alternate that would be workable would be to declare by fiat that all |
This comment has been minimized.
This comment has been minimized.
|
I would say that's even more incomplete. What happens if you blow up an outside wall on the second floor with an implementation like that? Also that creates an issue of having to modify a design to fit an awkward constraint, then having to modify the design again in the future to remove that constraint. |
This comment has been minimized.
This comment has been minimized.
|
Yeah this is way too hacky and feels really fake in situ. |
This comment has been minimized.
This comment has been minimized.
|
I fear if we continue to take an "all-or-nothing" approach to z-levels, we are going to continue to have nothing for a very very long time. |
This comment has been minimized.
This comment has been minimized.
|
It's not all or nothing, it's just that the 'ultimate' payoff of enabling |
Frost-wood
changed the title
Positive Z-levels(Ready)
Positive Z-levels(...)
Jun 19, 2014
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Having upper levels means player gets more stuff to explore by itself, and I see the office looks brilliant. And then, when upper levels are in the mainline, people can use them as a surefire way to test reality spheres, interaction, targeting across z-levels and whatever have you. |
This comment has been minimized.
This comment has been minimized.
|
I think Zireael makes a good point. The faux z-levels presented here make a nice test bed to work on the rest of the issues involved in making the levels interactive. The timeline of "make the levels interactive, then make the levels" sounds backwards to me. In addition, allowing upper levels in this form encourages people to create the structures to fill them, so that once an acceptable implementation is completed, we have lots of buildings already around. This also makes the areas for improvement obvious to anyone playing around with them. The next step should be to get the lower level terrain rendered in place of the "sky" terrain. To do that, we need to expand the reality bubble to include at least the z-levels the player is on and those below. Then we need to refactor the lightmap to calculate in three dimensions to determine what can be seen. Then we need to refactor all the map methods to work in three dimensions. These are all things that have their tentacles deep into various places in the code, and I think the expectations for them are currently unrealistic. IMO, a more realistic solution with a higher probability of succeeding in the near-term would be to have something like this pushed, giving a groundwork. Next, someone with more knowledge of the map and reality bubble expands it so that we can load in the info from surrounding z-levels. Then someone that knows how the lightmap works (I've heard it's a monster in itself) tackles that, giving correct line of sight so we know which areas of the lower levels we need to actually render. Then someone refactors the map accessors so we know whats in the lower level to be able to render it. All of those things first need a base to go off of, and I think this is as good a base as any, and with those issues tackled, I think we have a good second blush at z-levels. My suggestion would be to wait until 0.B releases then merge this into the experimentals, and make fully fleshing out z-levels as the focus for 0.C. The whole point of experimental versions is that they may contain unstable content or content not yet fit for stable releases. I think once something like this gets into the experimentals and people can see where things are going and what we are lacking, they will be more inclined to take a look into things and get them the way we want them. If we somehow get near to a new release and things aren't at an acceptable point, simply turn off the extra levels in omap gen and throw in a cheeky "halfway up the stairs, the way becomes blocked off" to handle stairs leading up to the content people have created in the upper levels.. |
This comment has been minimized.
This comment has been minimized.
|
vache says it far better than I have been trying. Even if you add the 3d-submaps, without my 'faux' z-levels cata will spit out debug messages, as you'll get a "tried to generate map omtype=null" error, as cata will load well nothing. You have to fill the 'sky' with some sort of terrain type. Now t_sky should be moved from trap_ledge to a flag, but that's further down the line. |
This comment has been minimized.
This comment has been minimized.
|
Here's another option. My main issue with merging this as-is is that I don't want people to think this is the z-level feature we've been talking about (not that there's anything wrong with this, just that it doesn't have all the features implemented). |
kevingranade
reviewed
Jun 21, 2014
| @@ -6163,6 +6164,11 @@ void mapgen_rock(map *m, oter_id, mapgendata dat, int, float) | |||
| } | |||
|
|
|||
|
|
|||
| void mapgen_sky(map *m, oter_id, mapgendata dat, int, float){ | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Jun 21, 2014
Member
dat is unused here, change "mapgen dat," to "mapgen," (just remove the parameter name) so the compiler doesn't warn about it.
This comment has been minimized.
This comment has been minimized.
Wev. |
kevingranade
reviewed
Jun 21, 2014
| @@ -2624,5 +2624,22 @@ | |||
| ] | |||
| }, | |||
| "examine_action": "water_source" | |||
| },{ | |||
| "type" : "terrain", | |||
| "id" : "t_sky", | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Jun 21, 2014
Member
One nit here, I'd prefer this be "open air" or similar, reserve "sky" for the situation where we're describing the upper boundary that we can't interact with.
A specific area where "sky" is inaccurate is if you're looking out a window and see forest or another building, but it's still accurate to call it open air.
This comment has been minimized.
This comment has been minimized.
BevapDin
Jun 21, 2014
Contributor
Why not simply reuse t_hole, that is used in the silo and has the same properties. Sooner or later they have to be merged anyway. It's empty space in both places.
This comment has been minimized.
This comment has been minimized.
Frost-wood
Jun 21, 2014
Author
Contributor
It's more an graphic issue-t_hole is underground and t_open_air would be above ground, and eventually it should be changed from a trap to a flag.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Also ran across a bug, if you go upstairs, then it triggers the "way down stairs here" note for every positive z-level... for every square you can see I think. |
This comment has been minimized.
This comment has been minimized.
|
sounds good, I work on the issues you mentioned. |
This comment has been minimized.
This comment has been minimized.
|
I don't care whether it's a mod or master as long as it gets in. +1. |
Frost-wood
changed the title
Positive Z-levels(...)
Experimental Z-Levels(WIP)
Jun 21, 2014
Frost-wood
added some commits
Jun 21, 2014
This comment has been minimized.
This comment has been minimized.
|
I don't know the capabilities of the mod system, but would we be able to control the number of layers created that way? Seems like if you couldn't, you'd just end up with lots of empty sky layers that way. |
This comment has been minimized.
This comment has been minimized.
|
Alright, everything has been transferred to the mod Experimental Z-Level Buildings, the issues Kevin mentioned are fixed. If they don't use the debugger they cannot go to the new Z-levels. |
This comment has been minimized.
This comment has been minimized.
|
-vache: they will be created at map gen, but since z-levels do not really interact with each other, there will not be any performance loss. I did not notice any on my laptop.. |
Frost-wood
changed the title
Experimental Z-Levels(WIP)
Experimental Z-Levels Mod(Ready)
Jun 21, 2014
This comment has been minimized.
This comment has been minimized.
|
I was more concerned with the players being able to view z levels that didn't have anything and that they wouldn't have access to. It's not really a big issue, it just sort of highlights that there's something missing though. |
This comment has been minimized.
This comment has been minimized.
|
The focus there needs to be on keeping homogenous submaps fast to process. |
This comment has been minimized.
This comment has been minimized.
|
OK. Office tower: Motels are not implemented and taking the upstair immediately dumped me back to z=0, with 7 damage to boot. |
This comment has been minimized.
This comment has been minimized.
|
OK, this is NOT mergeable as-is. I opened an old world (obviously, it did not have the mod enabled) and not only did it still have the 10 levels of "open air", every milbunker on the map had its basement moved up to z=0. Therefore, they were inaccessible. Here's a screencap of my issue with the tower: |
This comment has been minimized.
This comment has been minimized.
|
The 10 levels of open air problem is why I thought making it a configuration option instead of a mod was the way to go. I don't think there is a way to control how many levels get created in a mod, but it seems like it would be easy to define that in world creation. The bunker problem only exists because it uses the same function to draw both the upper and lower levels, and it just checks that there is no t_above to make that decision. It should be split into two separate functions and updated where necessary. The road connection issue is one that I've been looking into a little bit, but it doesn't have any easy solutions. Either way, it's not a z-level issue. |
This comment has been minimized.
This comment has been minimized.
|
Then, by all means, fix it. As for the road-connection, so noted. Things that look glaringly Wrong can block merge even if they aren't specifically problems with the underlying feature. |
This comment has been minimized.
This comment has been minimized.
|
Motels are not implemented and taking the upstair immediately dumped me back to z=0, with 7 damage to boot. The bunker issue seems to be happening with the labs as well(it seems to only happen with randomly generated stuff). Road connections I'm not certain how to fix. This might be too much of a change to run through the mod manager system. |
Frost-wood
added some commits
Jun 26, 2014
kevingranade
merged commit fedd6b2
into
CleverRaven:master
Jun 28, 2014
This comment has been minimized.
This comment has been minimized.
|
screams it says merged! Might convince me to start a fresh game! |


Frost-wood commentedJun 15, 2014
Since I want to add a second floor to the Rivtech facility, I need to get positive Z-levels working.
After diving into the code(including that huge if statement in mapgen.cpp), I think, I know what needs to be done to get it working, since a lot of the base is already there.
Implement a "SEEZ", that tells us how far up and down the player can look at most(and by extension, how many of the up/down slices should be loaded into map)
Extend map to store SEEZ times more submaps
transparency_cache etc. can stay the same for now - visibility calculations will ONLY happen on current z-level
implement special submap type that is homogeneously one terrain(e.g. only air, or only rock):DONE-empty z-levels filled with sky
rewrite anything that changes the player's z-level to do map::shift with the new z-level instead
optional: don't shift the map on every z-level, shift it only on every N z-levels
expand creature to have zpos()
expand the creature tracker/mon_at to be fully 3d
expand the stored traps to be fully 3d
expand map::i_at, ter_at, furn_at, get_ter, tr_at, etc etc to be fully 3d