Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 15 16 [17] 18 19 ... 108

Author Topic: DFHack 0.5.15 (legacy)  (Read 405069 times)

Artanis00

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #240 on: August 29, 2010, 01:19:56 am »

Look at this shit


That is the graph of code DF uses to figure out what an item is. That is more branches than all of dfhack put together, and it doesn't include the myriad of functions called from within that function..  it is just one function.

DF is chock full of this crap and I run into it wherever I go. I have no choice but to push ahead. Despite the fact this isn't my first rodeo, this is turning into the single most complicated piece of code I have untangled in my entire life.

Erm, wow. That looks like an amazingly complicated function... Two things, though: How did you generate that graph? What does a slightly less complicated function look like?
Logged
Git - fast, efficient, distributed version control system
Github - Free public repositories, issue tracking, wikis, downloads...

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #241 on: August 29, 2010, 02:02:07 am »

IDA Pro, it will cost ya.

With a less complicated function, you should be able to make out some of the actual code and not just lots of lines :P
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Artanis00

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #242 on: August 29, 2010, 05:51:58 am »

IDA Pro, it will cost ya.

With a less complicated function, you should be able to make out some of the actual code and not just lots of lines :P

I see. It's a feature of the disassembler. Don't do enough of that to warrant any outlay. Nifty graph, though if I guess if I ever need a tool to visualize my code paths plan A is "rewrite."

Logged
Git - fast, efficient, distributed version control system
Github - Free public repositories, issue tracking, wikis, downloads...

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #243 on: August 29, 2010, 10:04:50 am »

Well if outlay is a problem you could check out clang. Clang is poised to replace all c/c++ compilers in the near feature and has static analysis built in.

X Code for the mac is the only IDE that supports it from within the IDE, but you can still do static analysis from the command line on other platforms.

Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #244 on: August 29, 2010, 04:20:20 pm »

So. I just looked at the Items module because I'm updating everything to use the new offset storage classes... and it really needs a rewrite. Consider the module's API deprecated.

devek

  • Bay Watcher
  • [KILL_EVERYTHING]
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #245 on: August 29, 2010, 05:10:34 pm »

Well, I don't think anyone actually uses the API directly due to its memory leak.

1 question though.

Why doesn't it work on Linux?

Reading the code to get the get the type and material ids is correct and identical to how DF itself does it. The only other way to do it would be to find the exact offset of the id for each item class and switching for it. I'm assuming it has different code due to linux having a different c++ runtime, but I don't know due to the fact I have never reverse engineering any code on linux (never had a job where it came up).

EDIT: wow, I should have done this sooner. IDA's output on linux binaries is a lot more informative :D Switch statements are organized so much better... MSVC does some sneaky shit to optimize switches. I should have some code for you by next weekend you can build a proper item and material module with.
« Last Edit: August 29, 2010, 06:14:54 pm by devek »
Logged
"Why do people rebuild things that they know are going to be destroyed? Why do people cling to life when they know they can't live forever?"

Luewen82

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #246 on: August 30, 2010, 04:29:43 pm »

Been trying to use DF clear task on items that are accumulating all over the fortress and dwarfs wont claim,dump or retrieve items no matter what i do. Cleartask worked fine until recently that it has started to crash DF after 15 seconds of use. I wonder whats going on.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #247 on: August 31, 2010, 07:47:58 am »

Cleartask is only meant to be used immediately after reclaiming (i.e. before you unpause) - using it in an active fortress is asking for trouble, since it can easily disrupt all of your active tasks. I did some testing on a fortress with legitimately active tasks and it didn't seem to cause immediate problems (aside from some jobs cancelling due to "job item lost or destroyed"), though it's possible something else may be going on in your case. By any chance are you running the tool while your game is unpaused?

It's far more likely that the items your dwarves won't collect are owned by other dwarves who don't have bedrooms with sufficient storage space (either a cabinet or lots of floor space).
« Last Edit: August 31, 2010, 07:50:37 am by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Luewen82

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #248 on: August 31, 2010, 09:46:11 am »

Cleartask is only meant to be used immediately after reclaiming (i.e. before you unpause) - using it in an active fortress is asking for trouble, since it can easily disrupt all of your active tasks. I did some testing on a fortress with legitimately active tasks and it didn't seem to cause immediate problems (aside from some jobs cancelling due to "job item lost or destroyed"), though it's possible something else may be going on in your case. By any chance are you running the tool while your game is unpaused?

It's far more likely that the items your dwarves won't collect are owned by other dwarves who don't have bedrooms with sufficient storage space (either a cabinet or lots of floor space).

Hmmm. the items loitering around are mostly from migrants that arrive and i change their jobs. And suddenly they drop half of their stuff and leave it there. Have to try assigning them room and see if that works.  But some times there seem to be whole set of wardrobe dropped from dwarf for no visible reason in middle of their running around.
Logged

calrogman

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #249 on: August 31, 2010, 09:59:21 am »

I'm just curious here, but could DFHack be used to modify the contents of the embark rectangle offsets (horribly worded, I know) and replicate the functionality of Nano Fortress?
« Last Edit: August 31, 2010, 10:03:25 am by calrogman »
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #250 on: August 31, 2010, 10:25:11 am »

I'm just curious here, but could DFHack be used to modify the contents of the embark rectangle offsets (horribly worded, I know) and replicate the functionality of Nano Fortress?
Interesting idea. I'll have to try that :)

Truean

  • Bay Watcher
  • Ok.... [sigh] It froze over....
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #251 on: September 01, 2010, 06:47:41 am »

Hi,

The link on your README page is broken, and I just thought that you should know.

Read the README :)

Takes me here:

http://github.com/peterix/dfhack/blob/master/README

Thanks again for making this.
Logged
The kinda human wreckage that you love

Current Spare Time Fiction Project: (C) 2010 http://www.bay12forums.com/smf/index.php?topic=63660.0
Disclaimer: I never take cases online for ethical reasons. If you require an attorney; you need to find one licensed to practice in your jurisdiction. Never take anything online as legal advice, because each case is different and one size does not fit all. Wants nothing at all to do with law.

Please don't quote me.

mLegion

  • Bay Watcher
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #252 on: September 01, 2010, 02:24:14 pm »

I'm just curious here, but could DFHack be used to modify the contents of the embark rectangle offsets (horribly worded, I know) and replicate the functionality of Nano Fortress?

Should include 'embark anywhere' functionality as well in that case.

EDIT: How difficult would it be to implement a hotkey/keypress hook so that we can make DFHack based utilities that run in the background and do something when a person presses a key in DF?
« Last Edit: September 01, 2010, 08:41:24 pm by mLegion »
Logged

lolghurt

  • Bay Watcher
  • [PREFSTRING:failures]
    • View Profile
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #253 on: September 02, 2010, 10:50:09 am »

Is there some issue with spawning liquids above a certain level or is it impossible to place liquids above the max natural elevation to stop people binding obsidian to the top pf the sky?
Logged
Quote from: acetech09 date=1343968486
It's probably made from baby bone, with a handle of baby leather. Probably uses the leg bones wound together for the handle, the pelvis for the handle/pick joint, and the pick is the spine.

But that's all in theory, of course. Not like I've made a pick out of my own 5 month old baby before.

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.4.0.7b - tools and memory access library
« Reply #254 on: September 02, 2010, 11:13:23 am »

Is there some issue with spawning liquids above a certain level or is it impossible to place liquids above the max natural elevation to stop people binding obsidian to the top pf the sky?
The map simply doesn't exist there to keep the memory use low. No simple way around that I'm afraid.
Pages: 1 ... 15 16 [17] 18 19 ... 108