Z-levels - organizing work

I wanted to start working on z-levels for some time and I have a lot of free time at the moment. That $330 at https://github.com/CleverRaven/Cataclysm-DDA/issues/6818 sounds nice (especially for someone from a poor country and with no job, like me) and I think I know DDA code well enough to handle properly implementing it.

However, in the “Worldgen rewrite” thread, Angle declared wanting to start working on z-levels. There also may be some other people who want to do this or even someone who has it half-implemented.

I don’t want to fight or race for the bounty. This wouldn’t be healthy for me, the forum atmosphere and possibly the other person. If someone wants the bounty more than I do, I’d rather settle it before we start working.

If no one wants it more than I do, I’d like to lay some sort of exclusive claim on that one issue and bounty associated with it. Or at least a part of it, if bounties can be split.
As in, get some assurance that I won’t spend a lot of time writing 40% of code for someone to suddenly swoop in, write 60% and grab 100% of money.

Later on I could solve other Z-level issues, though once again I’d like to know in advance if someone wants them more than me.
From the page https://github.com/CleverRaven/Cataclysm-DDA/issues/6822 I’d like to do everything except part 2 (active items, monsters etc.) and part 6 (mapgen). But mostly the parts 1 (base map code), 4 (movement) and 5 (sight and attacks).

Ohhh i am getting excited I have been after Z levels for ages I wish you the best of luck mate and thanks for contributing :slight_smile:

I promise not to steal the bounty from you, and especially not when using your code. I do think it might be worthwhile to decide exactly how the code should work, though - in particular, is extending the map class to 3d really the best way? Might it not be better to write some code for creatures to have a z-level, and then just check if they’re on the surface and assume that there’s plenty of space if they are? I dunno, but it sounds better - giving the map class z - levels will work poorly for underground areas, and is mostly just empty space for the surface.

There needs to be some way to keep multiple z-levels in the reality bubble at one time. Extending the map class is the most practical way to do that.

can’t you just edit the reality bubble to extend up and down a bit?

That’s essentially what we need. The reality bubble IS the map class though.

but doesn’t it pull in the adjacent maps just fine? Can’t you simply extend that up and down?

It’s not exactly “simply”, but yes - that’s what it will essentially do.
However, there are many extra things to care about: the entire world is centered around the player. This means shifting (re-centering) the entire world roughly every 12 steps.
Plus, there maybe considerations like “how many z-levels to pull”, “how to store and access the data without wrecking performance”.

There was one developer who started working on z-levels, but then stopped before finishing. This suggests that it isn’t all just that simple.

Yeah, z-levels has been our eternal killer of developers. It seems that every developer who tries to start it ends up leaving the project totally before they finish. :stuck_out_tongue:

Could something that Dwarf Fortress uses for Z-Levels be used here? Or help figure out a different solution?

Possibly. I think we should really list what we want in terms of end behaviour, and then worry about code after that. I take it people want the reality bubble to stretch up and down, in addition to horizontally? what next? Flying enemies? Ability to examine the sides of multi z-level building that are above you? Movement between z-levels?

All of this is on the list here: https://github.com/CleverRaven/Cataclysm-DDA/issues/6822
Fires climbing buildings, flying enemies etc.
It won’t end just at those, because we’ll probably want things like spiders (and spidery survivors) clinging to walls, enemies pathing in 3d (easy to write, HARD to optimize), vehicles jumping off inclinations, helicopters and thousands of things more.
But all of those have to wait.

The solutions are already quite well figured out. Most of this is past the idea phase and just before programming phase (the hardest part).
DF is different because DF is played on a single, static map. DDA has scrolling map.

I haven’t started working on it yet because I’d like to make sure no one will come up and say “but I’m already doing it too” after I sink many hours of work into it.
I’ll start working if “enough” time passes (till the end of week?) and no one lays a claim on this issue.

Seeing spider mutants scaling walls and cat mutants jumping on buildings would be awesome.

One of the tests is gonna be “can my spider mutant climb the wall”. :wink:

That said, sure, organize all you like and team efforts can certainly split the bounty. But DDA being open-source means that you can’t lock others out of working on the problem, too.

We’ll certainly be aware of the possibility of people playing Fastest Finger with the PR interface, though I suggest that a solid commit history would be one way to reduce that sort of problem (If someone PRs code that’s Remarkably Similar to that filed over time by someone(s) else, I’d take note).

Thanks for the effort.

The only problem I see with Z-levels not already posted, is that once you have z-level buildings, people are going to want z-level cars, so there death mobile can be a 4*4 tower into space. Also, if you can climb walls as a spider, people will want to be able to be spoderman (https://www.youtube.com/watch?v=9MQmHQh2Jlc), ans all sorts of shenanigans will come from there.

Only good can come from death mobiles 444 :slight_smile:

How else would we reach very high trees for our apple gathering?

PS. Lets leave the cars 2d until all the other 3d code works :slight_smile:

I kinda want to do this, except in a more voluntary way.

Give everyone time to either claim the issue for themselves or agree to leave it for me.

I can’t make anyone be unable to work on it, but if I announce it here and wait for everyone to acknowledge it, I can discourage people from doing something unpredictable later on. It would be simply rude to pop in when my work is mostly done and interrupting everything and fighting for cash.

I don’t want to claim the issue to lock others out of it and let it sit there backburnered, I just want to make sure there will be no fight for it in the last moment, no conflicting PRs racing for the money, no fights about who deserves what % of bounty etc.
I work (and sleep) better when there’s no deadline, no risk of failure (delays don’t count as failure, unless there’s a deadline) and everyone agrees how should things look.

It’s entirely possible that it would take me less than a week to come up with working Part 1 of z-levels, so it’s not like I want to buy time/clog development. If I fail, I’ll announce it (if it won’t be obvious from commit history).
I too want the z-levels to happen.

Heh. If I had a dollar for every time someone in the DDA community did something I considered “rude” I’d have enough to hire someone to claim the bounties.

As I said, we’ll pay attention for “poaching”, etc. If you’re afraid of someone reading your code, don’t upload it to Git. But you don’t get to ask folks not to work on a bounty just so you can feel more comfy doing so.

Organize a team, sure. Dividing the labor can forestall burnout and provide additional readers to spot issues. But even Team Coolthuhu doesn’t get to ask others not to work on the bounty.

I’m asking them to at least announce they want to work on it.
As I said - I’m fine with someone else doing it (I’d prefer to be the one who gets it, but if I can’t…), but I’d like to know it in advance and resolve any conflicts before we get involved.

No interest in the bounty…

Having looked at the code for experimental-Z-levels mod, its not that simple. A lot of code assumes there is only one z-level, and trying to change one thing is going to break a lot of things, until you code everything that’s broken to work with multiple z-levels, that’s before you can even test it.

There is also the problem of how much cpu power extending z-levels is going to take-in some parts of the game there a noticeable slowdowns, from even simulating one z-level. Maybe how many z-levels the game simulates should be in the options.