Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 190 191 [192] 193 194 ... 244

Author Topic: DFHack 50.14-r1.1  (Read 893182 times)

Moeteru

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2865 on: March 20, 2021, 11:10:12 pm »

Thanks a lot for the help.
In return I've been doing a bit more experimentation with emotions and I've made some progress towards figuring out some of the unknown flags:

emotion.flags.unk0 seems to be set to true for thoughts which cause the creature to be "overcome by terror" or other similar extreme states.

emotion.flags.unk1 is related to goals/dreams being fulfilled. I've only seen it set to true on CraftMasterwork thoughts for dwarves who dream of crafting a masterwork or creating a great work of art, and on MasterSkill thoughts for dwarves who dream of mastering a skill. Weirdly it didn't get set for my baron's BecomeNoble thought, despite the fact that it realized his dream of "attaining rank in society". One dwarf had received two MasterSkill thoughts in quick succession and both had this flag set. More science is definitely needed here.
EDIT: It can apparently be set to true for emotions which would satisfy the dwarf's dream even if their dream is already satisfied.

emotion.flags.unk2 is almost always true for the thoughts of citizens and traders, always false for wild and domesticated animals, and varies for sentient invaders. I think it's probably some kind of flag to mark which thoughts have been "processed" by the game engine in some sense. After a dwarf made an artifact I viewed their thoughts without unpausing the game and it showed flags.unk2 to be false for their two most recent thoughts (MadeArtifact and ImproveSkill). Advancing the game by one tick didn't change anything, but after two ticks the ImproveSkill thought got flagged with unk2=true. Another ~20 ticks later the MadeArtifact thought also received the unk2 flag. The same thing happened when looking at a dwarf who had just given birth while the game was still paused, and I also managed to catch a regular "satisfied at work" thought before the unk2 flag got set.

emotion.flags.unk3 causes the emotion to display as "didn't feel anything". I can't actually take credit for this one since PatrikLundell pointed it out earlier in the thread. Interestingly this isn't the only way to get the "didn't feel anything" message. Sometimes the game uses this flag and other times it sets emotion.type to -1.
EDIT: The difference seems to be that this flag only affects thoughts after they leave the present-tense section of the thoughts screen and move into the "within the last season, ..." section.
« Last Edit: March 21, 2021, 02:12:12 pm by Moeteru »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2866 on: March 21, 2021, 07:54:51 pm »

Reported here, with details on what I think the issue is and some possible fixes: https://github.com/DFHack/dfhack/issues/1803

It's definitely not a rendering issue. Liquid is placed exactly where the unmovable cursor is.

Thanks for clarifying, although that doesn't necessarily rule out a rendering issue too. In fact, the fortress screen is actually not re-rendering, at least in the case of gui/liquids - I moved the cursor through Lua, and I was able to paint liquid over a larger area, but the screen didn't update to reflect this until command-prompt was closed. (You can confirm this with ":lua cursor.x = cursor.x + 10") The input issue had a separate cause, though, and the cursor keys just weren't making it to the DF screen to begin with (i.e. that part wasn't a rendering issue).

Here's a preliminary fix: https://github.com/DFHack/dfhack/pull/1804
Tested with gui/liquids, gui/teleport, and "dwarfmonitor stats". Feel free to try it out and let me know if there are still issues with other things. Binaries should be available here in under an hour.

Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2867 on: March 21, 2021, 08:26:15 pm »

Thanks a lot for the help.
In return I've been doing a bit more experimentation with emotions and I've made some progress towards figuring out some of the unknown flags:
Thanks! By the way, this is something that can go in the DF-structures issue tracker. Opened here: https://github.com/DFHack/df-structures/issues/424
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2868 on: March 24, 2021, 07:41:24 pm »

So, how would I go about checking how the tree cutting code works? I have some experience in programming in Assembly language, and I'd like to take a crack at it.

Is it something I should be doing with a special compile of DFHack, or do I just use Visual Studio debugger to attach to the process?
« Last Edit: March 24, 2021, 07:43:42 pm by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2869 on: March 24, 2021, 08:42:14 pm »

I'm not sure how useful the Visual Studio debugger will be, since DF doesn't have symbols. https://docs.dfhack.org/en/latest/docs/Memory-research.html has some information about tools that various people use, but it's still a bit sparse, sadly. In terms of disassembly, I know Quietust uses IDA and BenLubar uses Ghidra. I personally barely do any disassembly at the moment, but they might have more information to add.

I don't know how much debugging of DFHack specifically you'll need to do, but if you need more DFHack symbols, you can get those with a RelWithDebInfo build: https://docs.dfhack.org/en/stable/docs/Compile.html#build-type
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2870 on: March 25, 2021, 11:17:45 am »

I use IDA Freeware, but the freeware version doesn't do debugging, so I have to use GDB separately. I tried ghidra once, but I hated its decompiler, it produces less readable code than the original assembly, maybe it's because I don't know how to use it.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2871 on: March 29, 2021, 05:17:06 am »

Tried Ghidra the other day, but I couldn't even figure out how to get to its disassembler. IDA was so much easier to get working. I couldn't figure out what to do with the scripts, though. When I try to run them, I get "Function declaration is expected" errors. I've also got to figure out how to check stuff just within DF's executable, since I start out lost in a dll.

Using minGW64 for GDB on Windows:
"Reading symbols from C:\Dwarf Fortress\df_47_05_win\Dwarf Fortress.exe...(no debugging symbols found)...done."
I'll try the RelWithDebInfo build later.
« Last Edit: March 29, 2021, 05:25:53 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2872 on: March 29, 2021, 05:26:08 am »

IDA was so much easier to get working. I couldn't figure out what to do with the scripts, though.

I don't know about the .idc scripts, but a useful one is codegen_c_hdr.pl, it will a generate a C header that you can import in IDA.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2873 on: March 29, 2021, 04:11:13 pm »

Tried Ghidra the other day, but I couldn't even figure out how to get to its disassembler. IDA was so much easier to get working. I couldn't figure out what to do with the scripts, though. When I try to run them, I get "Function declaration is expected" errors.
What scripts are you running, and do you have more complete errors?
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2874 on: March 30, 2021, 04:39:27 am »

What scripts are you running, and do you have more complete errors?

For instance, vtable.idc, having no clue what it actually does.
Code: [Select]
C:\Program Files\IDA Freeware 7.0\idc\DFHack\vtable.idc: C:\Program Files\IDA Freeware 7.0\idc\DFHack\vtable.idc,7: Function declaration is expected
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.47.05-r1
« Reply #2875 on: March 31, 2021, 09:28:35 am »

What scripts are you running, and do you have more complete errors?

For instance, vtable.idc, having no clue what it actually does.
Code: [Select]
C:\Program Files\IDA Freeware 7.0\idc\DFHack\vtable.idc: C:\Program Files\IDA Freeware 7.0\idc\DFHack\vtable.idc,7: Function declaration is expected
I'm pretty sure that's an old script that requires you to manually specify each individual vtable you want to add - for 64-bit Windows binaries, run "ms_rtti64.idc" and it'll automatically find and name everything.
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.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2876 on: March 31, 2021, 10:41:01 am »

I'm pretty sure that's an old script that requires you to manually specify each individual vtable you want to add - for 64-bit Windows binaries, run "ms_rtti64.idc" and it'll automatically find and name everything.

Same error:
Quote
C:\Program Files\IDA Freeware 7.0\idc\DFHack\ms_rtti64.idc: C:\Program Files\IDA Freeware 7.0\idc\DFHack\ms_rtti64.idc,7: Function declaration is expected
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2877 on: March 31, 2021, 11:59:02 am »

Not sure if I should put this into here or TWBT thread, but...

Noticed few very weird things with my custom TWBT. It's not behaving as it used to.



My question is then: Is it possible that one of the linux updates changed my setup? If not, any other known ways ➂ could happen?

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.47.05-r1
« Reply #2878 on: March 31, 2021, 06:44:02 pm »

Same error:
Quote
C:\Program Files\IDA Freeware 7.0\idc\DFHack\ms_rtti64.idc: C:\Program Files\IDA Freeware 7.0\idc\DFHack\ms_rtti64.idc,7: Function declaration is expected
What exact version of IDA are you running? I've got 7.0.191002 and it runs that script just fine, though I'm not running it from within IDA's "idc" directory - I'm running it directly from where I cloned the df_misc repo, which is on a different drive and is right next to my DFHack and DF directories.

Also, what is the exact file size of the script, and what sort of line endings does it have? Mine is 27,133 bytes and has DOS line endings, but IDA still seems to handle it just fine even when it has UNIX line endings (and is 26,049 bytes long).
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.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.05-r1
« Reply #2879 on: March 31, 2021, 07:10:32 pm »

Not sure if I should put this into here or TWBT thread, but...

Noticed few very weird things with my custom TWBT. It's not behaving as it used to.
...

My question is then: Is it possible that one of the linux updates changed my setup? If not, any other known ways ➂ could happen?
What Linux updates are you referring to? We haven't changed our toolchain or build machine recently, as far as I know (and aren't you running this on an old DF version anyway?), and OS upgrades on your end would be out of our control.

My instinct in this sort of situation is to suspect either a binary produced from unexpected source code or unexpected modifications to source code. Unfortunately, these sorts of questions are hard to answer without version control, so I would definitely recommend using git (or some other version control system) for your development if you aren't already.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.
Pages: 1 ... 190 191 [192] 193 194 ... 244