Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - stevedore

Pages: [1] 2
1
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 05:28:49 pm »
Tried that 100 times already, no luck.

Seem to have discovered a nice lil memory leak though, Task Manager is reporting over 400,000k while trying to read dwarves.

Hm. Unfortunately in that case there isn't a whole heck of a lot more I can add. You can try generating a new world and that may be enough to fix it.

I'm not sure if this issue is related to the fact that we haven't found all of the offsets yet, or if it's because there's actually some sort of bug somewhere, so it's difficult to say what will fix it.

From the memory leak, sounds like we're getting into some sort of infinite loop. Apparently some people have found it can just take a few minutes to read dwarves, but I can't say that happens for sure.

2
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 05:17:30 pm »
I'm having trouble getting the ini working. Below are the steps I took.

Step 1: Downloaded and unzipped df_34_01_win.zip (the new SDL version of DF)
Step 2: Downloaded and unzipped Dwarf Therapist 6.10 off the link from the first post in this thread.
Step 3: Located Modified .INI file in thread http://www.bay12forums.com/smf/index.php?topic=66525.msg2990788#msg2990788
Step 4: Created v0.34.01_graphics.ini file in "...DwarfTherapist-0.6.10\ect\memory_layouts\windows"
Step 5: Copied code from aforementioned post into v0.34.01_graphics.ini
Step 6: Ran Dwarf Fortress with New World
Step 7: Ran Dwarf Therapist which starts and then freezes while trying to read Dwarves.

Am I missing a critical step or am I just out of luck?

Here is my Run.log
Code: [Select]
code

Edit: Sorry, I posted the wrong log earlier, the above one is correct one.

Try restarting Dwarf Fortress. It's been the fix for a few people that have run into a similar problem.

3
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 05:08:40 pm »
Oh! This makes sense. There's a specific flag recheck_equipment that probably needs to be set for those jobs (now that I hear about this, that offset value suddenly makes sense), and we likely have the wrong offset for it. I'll look into that right now, actually. It should hopefully be a reasonably quick solution.

Try recheck_equipment=0x01c0

You're too fast, dangit!  ;) Got there before me. I got 0x01C0 too.

4
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 04:59:41 pm »
Hmmm... so using the modified .ini,  everything loads and appears to be working right,  however I might have run in to a small problem.

I have the habit of assigning everyone to do mining until the basic layout of the first floor is done so everyone can have shelter and all items and food can be put away.   Well, I assigned everyone via DT, committed changes, and unpaused DF...  Nothing.  Just my two miners from before whittling away while everyone else sets on their thumbs. 
I check; we have 7 pickaxes, everyone has 'mining' set in game.   Huh.   I manually turned their mining off and on, unpaused, and OFF to work they go!!

So yeah, not sure if they are actually doing the jobs they get assigned in DT or not, but I had to manually un-switch then re-switch them in DF for it to work.


I seem to recall that this was a DT bug for a while back in DF2010 as well, where setting mining and woodcutting wouldn't appropriately flag the dwarf to go pick up its equipment. It was only a problem with those two, because they required tools. It was fixed, but I have no idea how. Most likely the new version has broken that fix again. Just one more thing to dig back out of memory.


DwarfEngineer, stevedore, dyn, thanks for all your work getting this thing back on its feet. You are good people.

Oh! This makes sense. There's a specific flag recheck_equipment that probably needs to be set for those jobs (now that I hear about this, that offset value suddenly makes sense), and we likely have the wrong offset for it. I'll look into that right now, actually. It should hopefully be a reasonably quick solution.

5
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 04:30:00 pm »
Hmmm... so using the modified .ini,  everything loads and appears to be working right,  however I might have run in to a small problem.

I have the habit of assigning everyone to do mining until the basic layout of the first floor is done so everyone can have shelter and all items and food can be put away.   Well, I assigned everyone via DT, committed changes, and unpaused DF...  Nothing.  Just my two miners from before whittling away while everyone else sets on their thumbs. 
I check; we have 7 pickaxes, everyone has 'mining' set in game.   Huh.   I manually turned their mining off and on, unpaused, and OFF to work they go!!

So yeah, not sure if they are actually doing the jobs they get assigned in DT or not, but I had to manually un-switch then re-switch them in DF for it to work.

I've read about some bugs with workshops and construction - it's possible they're actually labour bugs, and it was manifesting here. If it showed as enabled in-game, then there's not much more DT can do.

6
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 03:36:06 pm »
For the OS X users:

If you right-click the app and click "Show Package Contents", you can click through to Contents\Resources\etc.  The ini files for the offsets live there.  Unfortunately I'm in the middle of a sprint at work, so I probably won't have time to test offsets on the OS X side until after work tonight.

See - I knew there was an easy answer and I was just dumb.

is there a doc someplace on the structure of ini files for DT?  I observe that the structure of the ini files are different for windows vs osx.
Windows:
  a <version>_legacy.ini and a <version>_graphics.ini file for each release
osx:
  just a single <version>.ini file for each release.

Is the windows structure to support legacy versions of DT, or do I somehow need to have both?

Also - I've got a mac (clearly), and I can read hex - so I'm happy to go looking for the mac-specific offsets myself if someone can point me to a guide for how you identify what you're looking for in the core...surely you're not just randomly guessing memory addresses....

Yes, the Windows structure is for side-by-side support of legacy and SDL versions.

As for finding the offsets... some of it has been guesswork, some more deterministic. There's a wiki post on the google code site (http://code.google.com/p/dwarftherapist/wiki/MappingNewVersions) that describes it, but it's quite outdated so only gives you a very rough idea.

Here's a quick guide to how I figured out some values:

modify DwarfTherapist\etc\game_data.ini, and change the following values:
Code: [Select]
total_words_per_table = 2173
expected_dwarf_race = 465

I don't know for sure that expected_dwarf_race should be changed; it's just a guess. I'm thinking it will probably have the same index in windows and on mac, but it might not. Worst case, this won't be any more incorrect than the value from the old version.

Generate a new world. When you go to embark, give your first dwarf the nickname "this_is_a_long_name" and custom profession "0123456789abcdef".

Once you're in game, just pause.

If you start dwarf therapist and click "connect to DF", it should say "connected to unknown version" in the status bar. Look for run.log (I assume it's within the package, maybe? Not absolutely sure) and look for a line where it says that it can't find a memory layout for checksum 0xXXXXXXXX - copy this hex value.

Close down DT, and copy v0.31.25.ini to v0.34.01.ini. Change the first two sections to look like (copying the checksum value you got from run.log):
Code: [Select]
[info]
checksum=0xXXXXXXXX
version_name=v0.34.01 (graphics)
complete=false

[addresses]
translation_vector=0x0
language_vector=0x0
creature_vector=0x0
dwarf_race_index=0x0
squad_vector=0x0

You can start DT again and connect to DF. Now, hit "Scan Memory". In this dialog, you want to try the four buttons on the right for finding creature vector, dwarf race index, translation vector, and squad vector. If they work, they'll print out some values that you can put into your .ini file, then restart DT and see if it's starting to read anything.

If it's reading the dwarves, you can right click on them and select Dump Memory to get, surprise surprise, a dump of the memory pertaining to that dwarf. From here it's been a bit more guess-work for me, but mostly I was looking at the offsets in my .ini file and trying to determine if the values at those offsets made sense. If DT finds your dwarf race index (more on that a bit later), for instance, that's an easy one to verify, since you just look for a specific hex value at an offset (remembering that it will be in little-endian representation). The labour offset is another semi-easy one; you'll be looking for a large area of repeated bytes that are either 01 or 00. Mining has index 0, so if you go in game and toggle it, you should see one byte going from 00 to 01 and back, etc, and the address of that byte is your labour offset.

on the dwarf race index:
DT didnt' find this value for me. I found that if I looked in run.log, I saw some lines like this after running the search for it:
Code: [Select]
2012-Feb-15 15:30:51.231 DEBUG core PTR 13734bf "" [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:77] (go)
2012-Feb-15 15:30:51.231 DEBUG core MATCH! offset 46 2e [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:80] (go)
2012-Feb-15 15:30:51.231 DEBUG core READ ADDR FROM 13734ed = 252be9c [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:82] (go)
2012-Feb-15 15:30:51.231 DEBUG core RACE VALUE 465 HEX 1d1 [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:84] (go)
2012-Feb-15 15:30:51.231 DEBUG core PTR 13736eb "" [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:77] (go)
2012-Feb-15 15:30:51.231 DEBUG core MATCH! offset 31 1f [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:80] (go)
2012-Feb-15 15:30:51.231 DEBUG core READ ADDR FROM 137370a = 252be9c [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:82] (go)
2012-Feb-15 15:30:51.231 DEBUG core RACE VALUE 465 HEX 1d1 [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:84] (go)
2012-Feb-15 15:30:51.231 DEBUG core PTR 15558c6 "" [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:77] (go)
2012-Feb-15 15:30:51.231 DEBUG core MATCH! offset 28 1c [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:80] (go)
2012-Feb-15 15:30:51.231 DEBUG core READ ADDR FROM 15558e2 = 252be9c [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:82] (go)
2012-Feb-15 15:30:51.231 DEBUG core RACE VALUE 465 HEX 1d1 [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:84] (go)
2012-Feb-15 15:30:51.231 DEBUG core PTR 19b0537 "" [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:77] (go)
2012-Feb-15 15:30:51.231 DEBUG core MATCH! offset 25 19 [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:80] (go)
2012-Feb-15 15:30:51.231 DEBUG core READ ADDR FROM 19b0550 = 252be9c [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:82] (go)
2012-Feb-15 15:30:51.231 DEBUG core RACE VALUE 465 HEX 1d1 [bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:84] (go)

If you're seeing several lines like this that all have a matching race value pop up, then just try one of the addresses from one of these lines (the address is in red)

Code: [Select]
2012-Feb-15 15:30:51.231 DEBUG core READ ADDR FROM 19b0550 = [color=red]252be9c[/color][bin/release/../../../dwarftherapist/inc/dwarfraceindexsearchjob.h:82] (go)

You'll have to subtract the appropriate offset from it first, however, before it's appropriate for putting into your .ini file. Look for this value (again, red) in run.log:

Code: [Select]
2012-Feb-15 15:30:49.001 DEBUG core base address: "0x01360000" [../dwarftherapist/src/dfinstancewindows.cpp:258] (find_running_copy)
2012-Feb-15 15:30:49.001 DEBUG core memory correction: "[color=red]0x00f60000[/color]" [../dwarftherapist/src/dfinstancewindows.cpp:259] (find_running_copy)

And subtract that value from the address you got a step before. That's what you'll put in your .ini file.

I hope that gives you at least somewhere to start.

7
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 02:58:54 pm »
So let's say that with dyn's .ini everything was working just great (souls! yay!) but then a fucking migration wave of 3 dwarves (can 3 dwarves actually be called a migration wave? it'd be more like switching homes or whatever) fucked up and DT now just freezes every time I run it.

Dang.

P.S.: Is there a way to debug DT to know where is exactly the loading failing?

You can try restarting both DF and DT; that might solve it (I think it did for me when I encountered a similar issue while trying to find offsets).

As far as the debugging goes, in theory run.log should have some information, but I found that the stuff it prints while reading dwarves doesn't give enough information. If it crashes even after restarting DF, if you could zip up your save and put it somewhere that we can download it, that may be helpful for debugging the issue (if it's tied to some condition in the save and not some other factor entirely)

8
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 02:47:42 pm »
Finally, I found the soul offsets. These changes should allow DT to show all the traits and skill experience.
Code: [Select]
[dwarf_offsets]
souls=0x0764

[soul_details]
skills=0x0200
traits=0x0224

Damn good job! I had been looking at 0x0764 for the soul offset (it's the same delta between that and labours in both versions, right?) but didn't know well enough what I was actually looking for to be able to identify it, coupled with the soul_details offsets changing, I was pretty much screwed on that one.

9
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 02:45:52 pm »
@dyn

does this mean I can use an old version of DT when replacing the respective parts with what you posted?

As mentioned a few times earlier in the thread, you just have to take his large block of code (the one that starts with [info]) and put it in a file in the following place:

DwarfTherapist\etc\memory_layouts\windows\v0.34.01_graphics.ini

There aren't any changes required to DT itself, so you don't actually need a new "version", it just needs to have the information of where to look for all of the data, which is what this file contains.

10
DF Modding / Re: Dwarf Therapist Continuing Development
« on: February 15, 2012, 12:14:29 pm »
Stevedore, you seem to be doing great so far.

My plan is that once I have a release for DF 2012, I'll write a series of bootcamp style articles, starting with finding offsets, then continuing with DT's code structure. Then we can also talk about merge strategies, and can try to get in touch with the original project owner to see if I can add people as contributors.

My biggest challenge with DT is that I'm not super good at Qt programming. Just enough to be dangerous I guess.

The DF memory organization/structure is definitely the biggest stumbling block for me. What I have figured out, I've done somewhat blind and not entirely without luck, but I really don't understand souls or the physical traits.

11
DF Modding / Re: Dwarf Therapist Continuing Development
« on: February 15, 2012, 09:45:13 am »
As per my work in the main thread on the 34.01 ini, I'm certainly at least moderately interested in working on it.

I have little to no experience with Qt, but otherwise I'm a C programmer by trade and C++ isn't too much of a shift for me, and I'm reasonably comfortable digging around in memory.

12
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 09:28:19 am »
So, do I need the legacy.ini file settings for 34.01 to get the graphics.ini to work, or will it be fine without the legacy.ini file ?

Will creating a new file named correctly give us a working Dwarf Therapist for assigning tasks ?

My experience with this was copying/pasting some code about a year ago to get 31.21 to work the day of the release.

You'll only need the legacy.ini if you're using the legacy version of Dwarf Fortress. If you downloaded the "SDL" version, you're fine with just the graphics.ini.

I think I've missed something fundamental.  I've got DT sitting here (as it happens the OSX versions) and it's a monolith - a single executable file.  Where do I put the <field>=<value> and ini files??

Sorry... I can't much help you with the OSX version; I have no experience with it. I believe many of these values will be different on OSX (so even if we knew where to put them, I don't think it would matter, since they're all determined on Windows), and I'm not sure exactly where the .ini stuff (or its equivalent) goes. You'll have to wait for DwarfEngineer or someone else more knowledgeable than me about it to address this one.

I don't think OP realizes that THOUSANDS OF PEOPLE ARE RELYING ON HIM TO HURRY THE HECK UP to allow them to play this.

"I don't have much time" without stating a reason is just rude. Adventure mode is still too dull for me and Dwarf Mode is virtually unplayable without this mods help. :|

Acting like a spoiled child and whining about a free program not being immediately available is rude. If you want it working sooner, sit down with DF 34.01, DT, and a memory viewer and start trying to find the offsets yourself. It isn't as though this is an easy task that's just being delayed for the heck of delaying it; it takes a lot of work. To get as much progress as I did yesterday was about 6-8 hours of staring at memory dumps and DT code. I've no idea how long the rest will take.


Negative Ned aside, I'll post my full v0.34.01_graphics.ini again since it has a few more values than the last one, for anyone that's interested. Instructions in my post here http://www.bay12forums.com/smf/index.php?topic=66525.msg2988487#msg2988487. The additions from that are having happiness and current job reading properly thanks to dyn (http://www.bay12forums.com/smf/index.php?topic=66525.msg2988627#msg2988627). I feel like I should add a disclaimer that I am not DwarfEngineer, and have no official sanction from him, so this is very unofficial.

Code: [Select]
[info]
checksum=0x4f391a33
version_name=v0.34.01 (graphics)

[addresses]
translation_vector=0x017e3638
language_vector=0x017e3618
creature_vector=0x0179f728
dwarf_race_index=0x015cbe9c
squad_vector=0x0

[offsets]
word_table=0x0000003c
string_buffer_offset=0x0000

[word_offsets]
base=0x0000
noun_singular=0x001C
noun_plural=0x0038
adjective=0x0054
verb=0x008C
present_simple_verb=0x00A8
past_simple_verb=0x00C4
past_participle_verb=0x00E0
present_participle_verb=0x00FC

[dwarf_offsets]
first_name=0x0000
nick_name=0x001C
last_name=0x0038
custom_profession=0x006C
profession=0x0088
race=0x008C
flags1=0x00E0
flags2=0x00E4
sex=0x00F8
id=0x00FC
recheck_equipment=0x01BC
birth_year=0x0224
current_job=0x030C
physical_attrs=0x3DC
states=0x0644
souls=0x0768
likes=0x07A0
labors=0x078C
happiness=0x082C
squad_ref_id=0x790

[soul_details]
skills=0x01F0
traits=0x0214

[job_details]
id=0x0008
on_break_flag=0x0011
sub_job_id=0x0040

[squad_offsets]
id=0x0000
name=0x003C
members=0x0088

[position_offsets]
token=0x0000
flags=0x0020
general_name_singular=0x00E8
general_name_plural=0x0104
male_name_singular=0x0158
male_name_plural=0x0174
female_name_singluar=0x0120
female_name_plural=0x013C
custom_color_red=0x0382
custom_color_green=0x0380

[valid_flags_1]
size=1
1\name=Not from around these parts
1\value=0x80000000

[valid_flags_2]
size=1
1\name=Dead. Deceased. An Undwarf!
1\value=0x02000000

[invalid_flags_1]
size=7
1\name=a zombie
1\value=0x00001000
2\name=a skeleton
2\value=0x00002000
3\name=a merchant or diplomat
3\value=0x00000040
4\name=outpost liason
4\value=0x00000800
5\name=an invader or hostile
5\value=0x00020000
6\name=an invader or hostile
6\value=0x00080000
7\name=an invader or hostile
7\value=0x000C0000

[invalid_flags_2]
size=2
1\name="dead, Jim."
1\value=0x00000080
2\name=from the Underworld. SPOOKY!
2\value=0x00040000

13
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 01:27:37 am »
I believe happiness is 0x082c and current job is 0x030c. I am working on some of the rest, I will keep posting what I find as well

Those two look good to me, they stand against a bit of testing.

I'm going to try to figure souls out, if I can. No luck on it, gotta get to bed. Good luck for anyone continuing after me.

14
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 15, 2012, 12:07:49 am »
I, too, found those values (once I found out about game_data.ini - still learning a lot about DT, heh).

I'm working on trying to figure out some of the offsets. From what I can tell, all of the following are definitely correct:

first_name
nick_name
last_name
custom_profession
race
sex

I'm looking to get current_job figured out, at least. profession and happiness would be nice, too.

I'll have to dig through the code to learn how the souls are structured to see if I can figure them out.

Edit: I got enabled labours working. Here's my v0.34.01_graphics.ini file, it will give what I would call a very basic level of actual functionality to DT - you can manage your dwarves' enabled labours, at least, though you cannot see their skill level, current job, or happiness

Code: [Select]
[info]
checksum=0x4f391a33
version_name=v0.34.01 (graphics)

[addresses]
translation_vector=0x017e3638
language_vector=0x017e3618
creature_vector=0x0179f728
dwarf_race_index=0x015cbe9c
squad_vector=0x0

[offsets]
word_table=0x0000003c
string_buffer_offset=0x0000

[word_offsets]
base=0x0000
noun_singular=0x001C
noun_plural=0x0038
adjective=0x0054
verb=0x008C
present_simple_verb=0x00A8
past_simple_verb=0x00C4
past_participle_verb=0x00E0
present_participle_verb=0x00FC

[dwarf_offsets]
first_name=0x0000
nick_name=0x001C
last_name=0x0038
custom_profession=0x006C
profession=0x0088
race=0x008C
flags1=0x00E0
flags2=0x00E4
sex=0x00F8
id=0x00FC
recheck_equipment=0x01BC
birth_year=0x0224
current_job=0x02F4
physical_attrs=0x3C4
states=0x0528
souls=0x0648
likes=0x07A0
labors=0x078C
happiness=0x0710
squad_ref_id=0x790

[soul_details]
skills=0x01F0
traits=0x0214

[job_details]
id=0x0008
on_break_flag=0x0011
sub_job_id=0x0040

[squad_offsets]
id=0x0000
name=0x003C
members=0x0088

[position_offsets]
token=0x0000
flags=0x0020
general_name_singular=0x00E8
general_name_plural=0x0104
male_name_singular=0x0158
male_name_plural=0x0174
female_name_singluar=0x0120
female_name_plural=0x013C
custom_color_red=0x0382
custom_color_green=0x0380

[valid_flags_1]
size=1
1\name=Not from around these parts
1\value=0x80000000

[valid_flags_2]
size=1
1\name=Dead. Deceased. An Undwarf!
1\value=0x02000000

[invalid_flags_1]
size=7
1\name=a zombie
1\value=0x00001000
2\name=a skeleton
2\value=0x00002000
3\name=a merchant or diplomat
3\value=0x00000040
4\name=outpost liason
4\value=0x00000800
5\name=an invader or hostile
5\value=0x00020000
6\name=an invader or hostile
6\value=0x00080000
7\name=an invader or hostile
7\value=0x000C0000

[invalid_flags_2]
size=2
1\name="dead, Jim."
1\value=0x00000080
2\name=from the Underworld. SPOOKY!
2\value=0x00040000

15
DF Modding / Re: Dwarf Therapist (LATEST 0.6.10 3/15/11 see first post)
« on: February 14, 2012, 08:50:12 pm »
So I am about as oblivious as physically possible to the arcane workings of programming, do the posts in the last couple pages represent significant headway towards getting it working properly, or is it just dabbling in interesting notes?

Well, for reference, the total that I was able to get working in DT over about 4 hours of effort this afternoon (not knowing anything about the inner workings of DT or DF before about 1pm today):

- DT could read all of my dwarves, but only the following attributes
    - first name
    - nickname
    - custom profession name
    - gender

So, I'd say it leans somewhat towards "dabbling". I'd say DwarfEngineer's estimate of the end of the weekend at best still holds pretty strongly.

Pages: [1] 2