Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Are there any known ways to spawn an an aquifer post world-gen?  (Read 2896 times)

NordicNooob

  • Bay Watcher
  • *Not actually Nordic
    • View Profile
Are there any known ways to spawn an an aquifer post world-gen?
« on: October 16, 2019, 06:14:01 pm »

Hey! So, contrary to the usual, I'm actually trying to create aquifers.

So, I'm trying to get a particular location, the exact details of which are irrelevant. The spot I'm looking for has high drainage as part of its biome, which makes it pretty difficult to get aquifers to spawn within via normal world gen, and both because I forgot and because I don't want to ruin my raws more than I already have I strayed away from just making more stone able to spawn aquifers. I've found a perfect spot, albeit without an aquifer, and have resorted to tiletypes to cheat one in.

To get to the main problem, aquifers made with tiletypes just flat out aren't working. The tile will flash as damp when designations menu is up as normal, but when dug into nothing will happen. The surrounding tiles will remain damp, and the dug tile will revert to the material that was there before. I've got my paint set to paint: STONE WALL AQUIFER INORGANIC:CONGLOMERATE CLUSTER but have tried many different ways, all of which behave the same.

As an example of the tile reverting, when I have an original layer of gneiss and run my paint command on it, it turns into conglomerate. However, if I dig it, the resulting floor tile will be gneiss. Interestingly, tiles that are dug from walls also turn to gneiss, such as if I dig an up/down stair that will be a gneiss up/down stair. I can independently change the floor (also with the aquifer flag, for thoroughness) but it doesn't do anything other than change the floor material.

So the question is this: Is there any way to not have this happen? Do I have to set some command for the shape to go over everything (if I omit the WALL in my paint command it just leaves the shape the same and, if it's a wall, doesn't paint over the floor that's under it)? If not, is there some other utility that could be used to spawn in aquifers?

Thanks for any help, this has been frustrating me to no end. I don't really have the option to go back to world gen because it's already taken me forever to get a usable world.
Logged

feelotraveller

  • Bay Watcher
  • (y-sqrt{|x|})^2+x^2=1
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #1 on: October 16, 2019, 06:50:09 pm »

Two suggestions, the first I'm sure of the second not absolutely...

In order for tiles to automatically have floors corresponding to a changed material (more precisely of the base layer) it is necessary to use the 'changelayer' command from dfhack.  This changes entire layers not just individual tiles.  Recommend making a backup copy of the save before experimenting in case it all goes horribly wrong.   ;)

On the main point I think it might be possible, although I personally haven't done it, to simulate aquifers by using the 'liquids' and (or) 'source' commands.

There's a bit of documentation here: https://dfhack.readthedocs.io/en/stable/docs/Plugins.html

Hope that helps.  :)
Logged

Loci

  • Bay Watcher
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #2 on: October 16, 2019, 08:42:50 pm »

when I have an original layer of gneiss and run my paint command on it, it turns into conglomerate. However, if I dig it, the resulting floor tile will be gneiss. Interestingly, tiles that are dug from walls also turn to gneiss, such as if I dig an up/down stair that will be a gneiss up/down stair.

This is the expected behavior (Toady's nerf for gold-vein floors); all tiles revert to layerstone upon being excavated.


To get to the main problem, aquifers made with tiletypes just flat out aren't working. The tile will flash as damp when designations menu is up as normal, but when dug into nothing will happen.

Try a cave-in near the new aquifer. The tiletypes command doesn't appear to update the game's "water generation map", but a cave-in forces recalculation of those values. 
Logged

NordicNooob

  • Bay Watcher
  • *Not actually Nordic
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #3 on: October 16, 2019, 09:29:55 pm »

In order for tiles to automatically have floors corresponding to a changed material (more precisely of the base layer) it is necessary to use the 'changelayer' command from dfhack.  This changes entire layers not just individual tiles.  Recommend making a backup copy of the save before experimenting in case it all goes horribly wrong.   ;)

On the main point I think it might be possible, although I personally haven't done it, to simulate aquifers by using the 'liquids' and (or) 'source' commands.

There's a bit of documentation here: https://dfhack.readthedocs.io/en/stable/docs/Plugins.html

1. Actually running on a backup right now lol. Was fiddling around to make sure I actually had a problem and wasn't just being dumb. I'll make note of the changelayer thing, but it sounds like the floor material isn't my problem.

2. Don't think so. Read the docs a bit more and have previously done a bit with liquids and haven't had any success.


Try a cave-in near the new aquifer. The tiletypes command doesn't appear to update the game's "water generation map", but a cave-in forces recalculation of those values. 

1. There's got to be a non cave-in-the-entire map way, right? I'm just trying to cheat in a pretty deep aquifer and not a few tiles, so while I think it'd be possible for the most part it would be a huge PITA and possibly mess up my map forever in some way. After testing for a bit, I also run into that one bug with how aquifer cave-ins work, the one that sometimes breaks the cave-in method by resetting tiles to match the aquifer status of the layer they're on. I'm guessing that since my aquifers are hacked in instead of natural, the game just says "oh, no layers are aquifer, any caved-in aquifer tiles are wrong." So, clever idea and you've almost certainly got the exact problem nailed down, I just need something that works to fix it now.

2. Kudos to both of you for the help.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #4 on: October 17, 2019, 01:30:29 am »

Yeah, you can add aquifer tiles, but it's not enough to change just the tile, you also have to change block flags. Proof

||

Marked, dug in a stairway, and it filled with water.

Just look at hack/scripts/drain-aquifer.lua for an example and assign true instead of false (obviously, if you just change every instance of false to true you'll have an entire map as an aquifer, which might be incredibly challenging). Though here I used gui/gm-editor dfhack.maps.getTileBlock(xyz2pos(pos2xyz(df.global.cursor)))
 initially and then a small loop over each tile in that block, which is more comfy if you just want a few aquifer tiles.
« Last Edit: October 17, 2019, 01:34:22 am by Fleeting Frames »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #5 on: October 17, 2019, 05:54:30 am »

It ought to be possible to export the world gen settings, change the aquifer one to enable those, and then re-generate the world from those settings. Prior to the embark you could hack the layer of the future embark you want the aquifer in to an aquifer supporting kind (can be done with Region Manipulator's geo manipulation) and then embark (note that you'll get a soil aquifer as well if the soil depth is 3-4 and layer 3/4 aren't clay, which can be worked around by changing those to a clay type).

It may be possible to avoid the world re-generation by changing the aquifer flag for the world gen data with DFHack, but I haven't tested that.

Note that this is a reply to the question actually asked, rather than the one answered (and quite possibly intended) of how to change things post embark.
Logged

NordicNooob

  • Bay Watcher
  • *Not actually Nordic
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #6 on: October 17, 2019, 11:49:32 am »

Just look at hack/scripts/drain-aquifer.lua for an example and assign true instead of false (obviously, if you just change every instance of false to true you'll have an entire map as an aquifer, which might be incredibly challenging). Though here I used gui/gm-editor dfhack.maps.getTileBlock(xyz2pos(pos2xyz(df.global.cursor)))
 initially and then a small loop over each tile in that block, which is more comfy if you just want a few aquifer tiles.
So, uhh, how exactly would I do this? I've never actually worked with Lua before so a lot of the syntax is foreign, and also I can do little other than read the code. Also I just generally suck at it in general, but that's not the point.

What I'm attempting to do is take every tile in the map, look at it and see if it's an aquifer, and update its flag. This means I can sort of use tiletypes as a marker where I mark all the things I want to be aquifer as aquifer, and then I use my update-aquifer command to make them start flowing.

My current changes from drain-aquifer are just setting all the falses to true, but that does nothing. Honestly, if I could just like, have the file for whatever you did to create the aquifer you pictured that'd be great. I'm assuming that you used the code snippet you mentioned to just make an aquifer of x-y-z size, probably replacing the code in the main for loop of drain-aquifer with that?
« Last Edit: October 17, 2019, 02:24:03 pm by NordicNooob »
Logged

NordicNooob

  • Bay Watcher
  • *Not actually Nordic
    • View Profile
Re: Are there any known ways to spawn an an aquifer post world-gen?
« Reply #7 on: October 17, 2019, 02:32:28 pm »

Nevermind, figured it out! I was just forgetting some nots, and poking it enough times got me working code by sheer attrition. Thanks a ton for the help, everybody, you shall see the fruits of this mess pretty soon, I hope.

Since I couldn't find anything on this problem, I'll also toss up exactly what I changed for any future readers who just want to know how to make their dang aquifers work.


To use, first make an aquifer with tiletypes and then just type update-aquifer to get your aquifers flowing.

Copy/paste the code into a .lua file and stick it into /hack/scripts.
Logged