Bay 12 Games Forum

Please login or register.

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

Author Topic: Automatic mining: Is it possible and has it been done?  (Read 6985 times)

Cyborgman

  • Bay Watcher
    • View Profile
Automatic mining: Is it possible and has it been done?
« on: November 08, 2009, 07:23:16 pm »

I have been playing DF for awhile now and like to dig out just the minerals I want when I find them.

Example:
I dig exploratory tunnels out in all directions and once I strike a mineral/ore I want I follow the vein digging out only that mineral. While it is effective and keeps loose stone to a minamum it requires babysitting the miners and designating every block to mine right after I uncover it.

Is it possible to make an external program that automatically designates certain minerals that I choose as they are uncovered? And what scripting language would be necessary to make such a program. (I have quite a bit of technical expertise and want to expand it further) By the way, if this has already been done please stop me... I already looked around but couldn't find anything.
Logged

mission0

  • Bay Watcher
  • He is on a mission!
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #1 on: November 08, 2009, 07:29:54 pm »

As to has this been done, as far as I know no.

There are some programs which would reveal the minerals such as dtil. However that is about as close as it gets.
Logged
Oh wait, "insane" doesn't work on this forum.
Crap, can't think of an alternative.

Cyborgman

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #2 on: November 08, 2009, 07:50:18 pm »

Yeah, I found that one but it seemed like it would take all the fun out of exploratory mining and make actually finding the minerals too easy.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #3 on: November 09, 2009, 05:07:47 pm »

Could do it (almost) just don't have the time. Basically all you need is breakpoint @0x456000(0 based)-> this is dig function. and dfHack lib to add designation around it... Few notes for those who do this: function is called every time wall is damaged by digging.
Logged

Cyborgman

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #4 on: November 09, 2009, 08:03:47 pm »

Where can I get information on how to do this? I want to learn how to do it myself. I imagine c++ or some other scripting language would be needed but how does one go about hacking the memory.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #5 on: November 09, 2009, 09:21:56 pm »

You  don't "hack" it, you read from it and write there, and any language has special syntax for it.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Cyborgman

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #6 on: November 10, 2009, 02:59:09 am »

That is what I meant... I used 'hack' as the slang term.
Logged

Keilden

  • Bay Watcher
  • High Priest of The Endcat
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #7 on: November 10, 2009, 04:11:13 am »

Wasn't there a auto room-dig tool around here somewhere?
Logged
The Endcat will end you and everything you love.

Shades

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #8 on: November 10, 2009, 04:16:01 am »

Wasn't there a auto room-dig tool around here somewhere?

Doing that is much easier you just send key presses to the game (or if someone is clever alter the memory directly while the game is paused) in a pattern to designate the room.

I use something similar to mine shafts of updown staircases in a pattern to reveal as much of my mining zone as possible. It's hard to reuse that area though and you still need to go back afterwards to re-designate the ores.
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

Cyborgman

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #9 on: November 10, 2009, 05:26:58 am »

I guess what I am talking about would be a program that specifically targets a certain ore and auto designates it when uncovered.
Logged

Shades

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #10 on: November 10, 2009, 05:29:48 am »

I guess what I am talking about would be a program that specifically targets a certain ore and auto designates it when uncovered.

Yup, this is the harder task, you'll have to hook into the digging function as mentioned above so you know when new squares are revealed and then scan the memory to see what they are and if they are ores mark them for digging as well. Ideally you want to do this before handing control back to df so you don't run into issues with multiple processes editing memory (even if in this particular case it would probably work).
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #11 on: November 10, 2009, 11:13:06 am »

Found some time... Please enjoy :http://dffd.wimbli.com/file.php?id=1581
Logged

Shades

  • Bay Watcher
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #12 on: November 10, 2009, 11:28:03 am »

Found some time... Please enjoy :http://dffd.wimbli.com/file.php?id=1581

That work by just selecting all ores that are revealed through digging?
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

DennyTom

  • Bay Watcher
  • !!Urist!!
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #13 on: November 10, 2009, 11:31:15 am »

Wasn't there a auto room-dig tool around here somewhere?

there are at least 3 of them and you can always make your own
Logged
It is so much easier to measure life in experience points...

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Automatic mining: Is it possible and has it been done?
« Reply #14 on: November 10, 2009, 11:40:28 am »

Found some time... Please enjoy :http://dffd.wimbli.com/file.php?id=1581

That work by just selecting all ores that are revealed through digging?
Works like this: every time tile is degraded (by digging) function checks a few things:
1. is it a vein?
2. is tile finished digging? (currently not really works)
then if both are true it does this on 3x3 grid around:
Checks:
1.Is tile revealed?
2.Is it valid tile type? (not sure about this one... only one currently. This should stop it from digging smoothed walls)
3.Is it still vein?
4.Is it the same vein?
And then designates the tile for digging.
Logged
Pages: [1] 2 3