Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4

Author Topic: Hell Hole Chasm digger  (Read 11953 times)

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Hell Hole Chasm digger
« on: October 14, 2010, 01:23:55 pm »

http://dffd.wimbli.com/file.php?id=3270

Miss bottomless pits and chasms?
Need some way to get rid of magma-safe items?
Wait no longer!

dfHellHole will burrow a randomly shaped, 16x16 bottomless pit from your cursor straight through hell.  At the bottom, old-style classic chasm tiles.

Can also make magma pipes, magma pools, oasis pools, solid obsidian pillars, and more.
Run time configurable shape and size of the feature being dug.
Probably not appropriately named anymore.

Includes VS2008 compiled dfhack dll.
Don't mix it with dfhack 5.0.2


The bottomless pit will be created starting in the z-level below the cursor.
The pit will start out enclosed, capped off with a roof.  You have to dig into it to reveal it.
Veins and any other special tiles will be kept in the walls of the pit.  The pit will otherwise be enclosed in obsidian walls.
If Adamantine veins are encountered, they are expanded around the pit instead of being lost.
An additional single tile obsidian stack stretches from the bottom to the top, to give the ability to cut a staircase from top to bottom.  It is only attached to the roof.

Aquifers will automatically be pierced, rivers blocked, caves walled-off, magma sea sealed behind obsidian; the pit is entirely self-contained.

Any water, magma, items, or critters unfortunately caught in the newly made pit will unfortunately fall to their untimely doom.
Unless, of course, they can fly.


Changelog:

Version 4 adds all of these feature types:
  • Bottomless Chasm
  • Bottomless Eerie Pit
  • Pit with floor
  • Solid Pillar
  • Oasis Pit (ends at magma, no hell access)
  • Oasis Pool, with partial aquifer (default 5 z-levels)
  • Magma Pit (similar to volcano, no hell access)
  • Magma Pool (default 5 z-levels)

All of these configurable options:
  • Pit Type
  • Depth
  • Hole Radius
  • Wall Thickness
  • Pillars, Hole
  • Pillars, Wall
  • Expose Hell
  • Stop at Magma
  • Expose Magma
  • Magma Fill
  • Water Fill

And the ability to regenerate the pattern to dig:
Code: [Select]
..WWWWWWWWWWW...
..WcWcWcWcccW...
WWWcccccccccWWW.
WcWcccccccccccW.
WWccccccccccccW.
.WcccccccccccWW.
WWccccccccccccW.
WcccccccccccccW.
WcccccccccccccW.
WccccccccccccWW.
!WcccccccccccWW.
WWccccccccccc!W.
.WWcccccccccWWW.
..WcWcccccWcWW..
..WWWWWcWWWWW...
......WWW.......


Known Bugs:
  • Magma Pits are slightly buggy when placed over adamantine tube, but should not leak.
  • Aquifer creation does not work, and is disabled.
  • Mud in caves causes walls covered in mud, which can be destroyed by trees growing on them, creating holes in the chasm/tube created.


Future Features:
- None planned.  Accepting requests.


Please report all bugs you encounter which are not in the bug list above.
« Last Edit: December 27, 2010, 12:37:24 pm by zilpin »
Logged

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Hell Hole Chasm digger
« Reply #1 on: October 14, 2010, 01:24:13 pm »

(placeholder)
Logged

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Hell Hole Chasm digger
« Reply #2 on: October 14, 2010, 01:24:30 pm »

(placeholder)
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: Hell Hole Chasm digger
« Reply #3 on: October 14, 2010, 01:37:14 pm »

You.  Are.  Awesome.

And yes, everything you wrote in future features sounds great, including placeable volcanoes.

So, does this mean that if one were to set wall material to raw adamantine and set thickness greater than size, they could make their own solid blue spires?  Granted they wouldn't be as tall but still...  *salivates at game-twisting/breaking possibilities*

And this will drastically cut down on the time it takes me to find a good embark, since if there are no natural 1st cavern magma pipes or adamantine veins, I can put them there.  Will make it much easier to get all that AND a demon fortress.
« Last Edit: October 14, 2010, 01:40:10 pm by Makbeth »
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Hell Hole Chasm digger
« Reply #4 on: October 14, 2010, 01:59:42 pm »

That actually gets quite tricky.
Dwarf Fortress does not store materials in the tile itself.  In order to find out what a tile is made of, you have to go through this process:

Is it a local map feature?  If so, X stores the index in an array of features, which stores the index of material type.
Is it a global map feature?  Similar situation.
Is it a vein? Similar situation.
Is it a normal map tile rock (like, most of the map)?  Then the tile holds biome and region indexes.  Go look in one table to check the biome, then another for the region, cross reference the two, then go lookup the material.
Is it a soil rock?  Similar to rock.
Is it a special category of tile types for Semi-Molten rock or Obsidian or Ice?  Then (maybe) ignore everything above, and use that hard-coded material type.

So setting a tile to be an arbitrary material is quite a task.  You don't set the tile itself, you change an entire vein, or an entire region of the world map!

Most of DF has this kind of excessive use of lookup tables.  I'm sure Toady wrote functions to jump through the hoops for him, but that doesn't change the fact that every single check against what a tile is made of requires dozens of seeks into the memory heap.  Adds up quick.

Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: Hell Hole Chasm digger
« Reply #5 on: October 14, 2010, 02:09:11 pm »

Well, that explains DFTileTypes a little better.  What does your generator do?  Create a local feature?
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: Hell Hole Chasm digger
« Reply #6 on: October 14, 2010, 02:10:45 pm »

And is any of this stuff actually written down somewhere or am I following everyone in else's footsteps by just reading through the code of several files and figuring out how it works?
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

quintin522

  • Bay Watcher
  • [FLYING_SPAGHETTI_MONSTER]
    • View Profile
Re: Hell Hole Chasm digger
« Reply #7 on: October 14, 2010, 02:11:43 pm »

Finally, once more, I can build a floating city over an abyss.
Logged
"I can't bleed to death now, I don't have time!"
Urist McExplorer, bolding going where no dwarf has OH GAWD THE MAGMA IT BURNSSSss..

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Hell Hole Chasm digger
« Reply #8 on: October 14, 2010, 02:18:05 pm »

Not anything so impressive, sorry.

All it does is modify the tile types and their flags.  So you won't get a message telling you that you've found a Chasm.  It's purely a terrain change.

I go from highest z-level, cover the area with floor tile type if it's an open space, then proceed downward.  Mostly it's just creating open space, which is easy.  The walls take some care, but they are all set to be solid vein (if the tile was any kind of vein already) or solid feature (if the tile was a feature tile, e.g. adamantine,slade), otherwise solid obsidian.  Since all I'm doing is changing the tile type, not the material, I don't need to actually create any structures in memory (a daunting and dangerous task).

And, sorry, nothing is really documented anywhere.  Everyone's too bus memory hacking to update the magmawiki entry on memory hacking.

But if you are interested in map modifications, take a look at the dfprobe and dfprospector source code.  I did :)

Logged

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: Hell Hole Chasm digger
« Reply #9 on: October 14, 2010, 02:21:06 pm »

Most of DF has this kind of excessive use of lookup tables.  I'm sure Toady wrote functions to jump through the hoops for him, but that doesn't change the fact that every single check against what a tile is made of requires dozens of seeks into the memory heap.  Adds up quick.
That is a remarkably bizarre and convoluted way to do it.  Doesn't surprise me a bit, however.  I'm starting to suspect that one of the biggest reasons Toady will never go open source is because the source is an incomprehensible mass of spaghetti code that nobody else could ever hope to understand.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Hell Hole Chasm digger
« Reply #10 on: October 14, 2010, 02:40:21 pm »

That is a remarkably bizarre and convoluted way to do it.  Doesn't surprise me a bit, however.  I'm starting to suspect that one of the biggest reasons Toady will never go open source is because the source is an incomprehensible mass of spaghetti code that nobody else could ever hope to understand.
It just needs to be refactored.
Projects typically get things done messy and fast at first.  It's better to have something today than something great a month from now.
But then, they refactor.
Toady is always moving on to Big New ThingsTM or quickly (messily) patching bugs created by said Big New Things.
It's easy to get into that kind of pattern.  Refactoring isn't fun.  And at this point, we're talking about massive structural redesign.

I think he won't open source because he's making a comfortable income from donations.
If we put together some kind of show-us-the-source fund, how big would it have to get for him to 'sell' the source?  $50k?  $80k?  $100k?  I can't imagine he'd go for less, and he'd probably get pretty salty about people putting money in that fund instead of sending it to him.  Can't blame him.  I like getting paid for my hard work.

But, looking at the structures in memory with dfhack, I can make this statement comfortably:
Nothing will give DF speed, and stability, and ease for writing new features, as refactoring will.
No clever algorithm, no fancy unit tests, nothing.

Logged

SquidgyB

  • Bay Watcher
    • View Profile
Re: Hell Hole Chasm digger
« Reply #11 on: October 14, 2010, 04:51:12 pm »

Now that's more than a little useful!

+1 for insta volcanoes
Logged

Ieb

  • Bay Watcher
  • A Breakdancing Ogre
    • View Profile
Re: Hell Hole Chasm digger
« Reply #12 on: October 14, 2010, 05:32:00 pm »

So first you make the de-ramper utility, and now you bring back the old chasms?

What's next on your list of fun and insane things to do besides updates on this?

Good work by the way.
I mean. Damn. The old chasms were sort of good, sort of bad, what with the random ledges where creatures lurked. So this is like, a better version of a chasm, with none the job-interrupting creatures like the horrid naked mole dog!

Although right now all those have been replaced by demons.
Hooray.
Logged

zilpin

  • Bay Watcher
  • 437 forever!
    • View Profile
Re: Hell Hole Chasm digger
« Reply #13 on: October 14, 2010, 08:57:08 pm »

Quote
Although right now all those have been replaced by demons.

You will only get demons in your hell hole if they happened to be in that location already.  Most of the time, they won't be.  They tend to hang around adamantine veins.

By the way, I have another tool that will let you export all the demon raws from your save game, modify their traits (e.g. flying, trap avoid), then re-import it.

Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: Hell Hole Chasm digger
« Reply #14 on: October 14, 2010, 10:00:55 pm »



By the way, I have another tool that will let you export all the demon raws from your save game, modify their traits (e.g. flying, trap avoid), then re-import it.

That's 3 for 3 threads you've opened now wherein you've provided the tools to do things I've always desperately wanted to do in DF.  If I liked you any more than I do now it would start to get creepy.
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.
Pages: [1] 2 3 4