Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 186 187 [188] 189 190 ... 222

Author Topic: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06  (Read 962503 times)

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2805 on: October 12, 2016, 08:58:15 pm »

Yeah, it's not that simple. It should never use "long" to hold DF data, for one thing, because "long" varies in size with DF's compilers, and DT can be compiled as a 32-bit or 64-bit binary to work with 32-bit DF. DT doesn't even have to be compiled with the same compiler as DF either.

Anyway, hooking into 64-bit processes has some non-trivial differences, not to mention the fact that DT uses completely different APIs on every platform already. DT has probably also hardcoded the layouts of some DF structures (vectors, strings, etc.) that vary between 32-bit and 64-bit DF, as well as between MSVC 2010 and 2015, which probably aren't trivial to change. There's also the question of keeping 32-bit compatibility, which arguably makes debugging far easier, but also complicates support for both architectures somewhat.

I remember some conversations in the lead-up to DF 0.40, suggesting that Therapist might eventually be backed by DFHack instead of continuing to roll it's own memory access tools.  Given the new challenges of 32/64 bit compatibility and a new compiler, this might be a good time to revisit the idea!
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

jecowa

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2806 on: October 12, 2016, 09:02:22 pm »

Yeah, it's not that simple. It should never use "long" to hold DF data, for one thing, because "long" varies in size with DF's compilers, and DT can be compiled as a 32-bit or 64-bit binary to work with 32-bit DF. DT doesn't even have to be compiled with the same compiler as DF either.

Anyway, hooking into 64-bit processes has some non-trivial differences, not to mention the fact that DT uses completely different APIs on every platform already. DT has probably also hardcoded the layouts of some DF structures (vectors, strings, etc.) that vary between 32-bit and 64-bit DF, as well as between MSVC 2010 and 2015, which probably aren't trivial to change. There's also the question of keeping 32-bit compatibility, which arguably makes debugging far easier, but also complicates support for both architectures somewhat.

Unrelated: Here are OS X layouts that I generated with devel/export-dt-ini, after Quietust's fix (although that shouldn't make a difference on OS X). They are entirely untested, but may work somewhat if you're lucky. The 64-bit one is entirely useless at the moment, but might work once DT supports 64-bit DF.
Spoiler: v0.43.05 osx32 (click to show/hide)

Spoiler: v0.43.05 osx64 (click to show/hide)

Nice! Thanks for the layouts! And thanks for the Dwarf Therapist information. I guess "MSVC 2010 and 2015" refers to the compiler change.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2807 on: October 12, 2016, 09:53:11 pm »

Yeah. That's mainly an issue on Windows because Microsoft likes to change the layouts of STL things between versions. GCC usually doesn't do that, so STL classes between GCC 4.5 and 4.8 have the same layout. (A notable exception is GCC 5, which changed a few things, particularly strings, but those changes can be disabled at compile time, which is what DFHack does when it detects GCC 5.)

I remember some conversations in the lead-up to DF 0.40, suggesting that Therapist might eventually be backed by DFHack instead of continuing to roll it's own memory access tools.  Given the new challenges of 32/64 bit compatibility and a new compiler, this might be a good time to revisit the idea!
Maybe. It would require some extra RPC work on the DFHack side and a rewrite of some of DT, and could open up new possibilities for bringing down DF, which is bad. However, it would probably reduce maintenance on the DT side, and it would get around the funky stuff DT has to do to hook in.
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.

i00n

  • Bay Watcher
  • Tetris gosu
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2808 on: October 13, 2016, 05:42:32 am »

Attached below is a valid INI file for Dwarf Fortress 0.43.05-win32 which should work in Dwarf Therapist v.37.0:

Oh man this rainy day suddenly got a lot better. Big thanks!
Logged

Grax

  • Bay Watcher
  • The Only.
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2809 on: October 13, 2016, 05:59:09 am »

Attached below is a valid INI file for Dwarf Fortress 0.43.05-win32 which should work in Dwarf Therapist v.37.0:

You are the best, Sir.
Logged
Finis sanctificat media.

CABL

  • Bay Watcher
  • Has a fetish for voring the rich
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2810 on: October 13, 2016, 04:17:31 pm »

Just copied and pasted Quietust's code. It works with 43.05 without any problems. Anyway, thanks to Quietust and all wonderful people working on utilities for this great game, and DF community in general.
Logged
Pounded in the Butt by my own Government... oh wait, that's real life.

Much less active than I used to be on these forums, but I still visit them on occasion. Will probably resume my activity in full once Dwarf Fortress will be released on Steam.

Chimerat

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2811 on: October 13, 2016, 10:49:58 pm »

Cool.

Where do I download the version that works with that file?

EDIT: Never mind. *facepalms* On the first page!

I'll need to wait a while before I can edit the INI though.
« Last Edit: October 13, 2016, 10:53:52 pm by Chimerat »
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2812 on: October 14, 2016, 02:01:28 am »

I might be interested in converting Therapist to use DFHacks RPC functions, instead of the debugging stuff that it uses now, which will mean that it will automatically work with any version of DF that has DFhack installed, but would also mean that you wouldn't be able to use .ini files with it anymore.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2813 on: October 14, 2016, 06:39:40 am »

Yeah. That's mainly an issue on Windows because Microsoft likes to change the layouts of STL things between versions.
Actually, the change made between MSVC 2012 and 2015 was quite benign - both strings and vectors shrunk in size, but they did so by eliminating a field at the end of the structure (the "allocator", which was just visible as padding anyways), so Therapist sees them exactly the same as before (since it keeps offsets of each individual field rather than a full structure layout like DFHack uses).
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.

g2knee

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2814 on: October 14, 2016, 09:19:51 am »

Attached below is a valid INI file for Dwarf Fortress 0.43.05-win32 which should work in Dwarf Therapist v.37.0:



You are a hero. 
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2815 on: October 14, 2016, 11:00:06 am »

I might be interested in converting Therapist to use DFHacks RPC functions, instead of the debugging stuff that it uses now, which will mean that it will automatically work with any version of DF that has DFhack installed, but would also mean that you wouldn't be able to use .ini files with it anymore.
Wouldn't a non-DFHack version still need to be maintained, given how long it takes for DFHack to catch up with DF releases?
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: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2816 on: October 14, 2016, 02:52:31 pm »

Right now DFHack is way ahead of DT. Usually, DFHack is stable enough to do everything DT can do before DT layouts are available - it's testing other stuff that takes a while, although it admittedly could be faster.
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.

Blue_Dwarf

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2817 on: October 16, 2016, 06:44:18 am »

Attached below is a valid INI file for Dwarf Fortress 0.43.05-win32 which should work in Dwarf Therapist v.37.0:

Code: [Select]
[info]
checksum=0x577b57ff
version_name=v0.43.05 win32
complete=true

[addresses]
cur_year_tick=0x0188d6b0
current_year=0x018986b8
dwarf_civ_index=0x018b6090
dwarf_race_index=0x018b609c
fortress_entity=0x018bad24
historical_entities_vector=0x018d0b4c
creature_vector=0x018e43e8
active_creature_vector=0x018e43f4
weapons_vector=0x018e4494
shields_vector=0x018e44dc
quivers_vector=0x018e4500
crutches_vector=0x018e4524
backpacks_vector=0x018e4530
ammo_vector=0x018e453c
flasks_vector=0x018e4698
pants_vector=0x018e4a1c
armor_vector=0x018e4a4c
shoes_vector=0x018e4a58
helms_vector=0x018e4a64
gloves_vector=0x018e4a70
artifacts_vector=0x018e4ac4
squad_vector=0x019df2cc
activities_vector=0x019df2fc
fake_identities_vector=0x019e2680
poetic_forms_vector=0x019e2764
musical_forms_vector=0x019e277c
dance_forms_vector=0x019e2794
occupations_vector=0x019e27dc
world_data=0x019e5540
material_templates_vector=0x019e5cd8
inorganics_vector=0x019e5ce4
plants_vector=0x019e5cfc
races_vector=0x019e5d98
itemdef_weapons_vector=0x019e5dd8
itemdef_trap_vector=0x019e5de4
itemdef_toy_vector=0x019e5df0
itemdef_tool_vector=0x019e5dfc
itemdef_instrument_vector=0x019e5f10
itemdef_armor_vector=0x019e5f1c
itemdef_ammo_vector=0x019e5f28
itemdef_siegeammo_vector=0x019e5f34
itemdef_glove_vector=0x019e5f40
itemdef_shoe_vector=0x019e5f4c
itemdef_shield_vector=0x019e5f58
itemdef_helm_vector=0x019e5f64
itemdef_pant_vector=0x019e5f70
itemdef_food_vector=0x019e5f7c
language_vector=0x019e5f94
translation_vector=0x019e5fac
colors_vector=0x019ea578
shapes_vector=0x019ea584
reactions_vector=0x019ea59c
base_materials=0x019eab64
all_syndromes_vector=0x019eb5d4
events_vector=0x019ebb6c
historical_figures_vector=0x019ebb84
world_site_type=0x006c
active_sites_vector=0x00048228

[offsets]
word_table=0x0030
string_buffer_offset=0x0000

[word_offsets]
base=0x0000
noun_singular=0x0018
noun_plural=0x0030
adjective=0x0048
verb=0x0078
present_simple_verb=0x0090
past_simple_verb=0x00a8
past_participle_verb=0x00c0
present_participle_verb=0x00d8
words=0x0030
word_type=0x004c
language_id=0x005c

[general_ref_offsets]
ref_type=0x0008
artifact_id=0x0004
item_id=0x0004

[race_offsets]
name_singular=0x0018
name_plural=0x0030
adjective=0x0048
baby_name_singular=0x0060
baby_name_plural=0x0078
child_name_singular=0x0090
child_name_plural=0x00a8
pref_string_vector=0x0100
castes_vector=0x0118
pop_ratio_vector=0x0124
materials_vector=0x2250
flags=0x0130
tissues_vector=0x225c

[caste_offsets]
caste_name=0x0018
caste_descr=0x0198
caste_trait_ranges=0x0464
caste_phys_att_ranges=0x0f28
baby_age=0x03a8
child_age=0x03ac
adult_size=0x03c0
flags=0x0590
body_info=0x059c
skill_rates=0x06b8
caste_att_rates=0x113c
caste_att_caps=0x126c
shearable_tissues_vector=0x1364
extracts=0x2c38

[hist_entity_offsets]
histfigs=0x0098
beliefs=0x06d4
squads=0x09dc
positions=0x0958
assignments=0x0980
assign_hist_id=0x0004
assign_position_id=0x000c
position_id=0x0018
position_name=0x0054
position_female_name=0x0084
position_male_name=0x00b4

[hist_figure_offsets]
hist_race=0x0002
hist_name=0x0038
id=0x00bc
hist_fig_info=0x00e8
reputation=0x002c
current_ident=0x0018
fake_name=0x0004
fake_birth_year=0x0078
fake_birth_time=0x007c
kills=0x0018
killed_race_vector=0x000c
killed_undead_vector=0x0048
killed_counts_vector=0x0054

[hist_event_offsets]
event_year=0x0004
id=0x0014
killed_hist_id=0x0018

[item_offsets]
item_type=0x0001
item_def=0x00a4
id=0x0018
general_refs=0x0028
stack_size=0x005c
wear=0x0070
mat_type=0x0080
mat_index=0x0084
maker_race=0x0088
quality=0x008a

[item_subtype_offsets]
sub_type=0x001c
name=0x003c
name_plural=0x0054
adjective=0x006c

[item_filter_offsets]
item_subtype=0x0002
mat_class=0x0004
mat_type=0x0006
mat_index=0x0008

[weapon_subtype_offsets]
single_size=0x00a8
multi_size=0x00ac
ammo=0x0090
melee_skill=0x008c
ranged_skill=0x008e

[armor_subtype_offsets]
layer=0x0008
mat_name=0x0084
other_armor_level=0x0088
armor_adjective=0x009c
armor_level=0x00b8
chest_armor_properties=0x00c4
pants_armor_properties=0x00cc
other_armor_properties=0x0098

[material_offsets]
solid_name=0x0094
liquid_name=0x00ac
gas_name=0x00c4
powder_name=0x00dc
paste_name=0x00f4
pressed_name=0x010c
flags=0x0208
inorganic_materials_vector=0x00e0
inorganic_flags=0x0024

[plant_offsets]
name=0x0030
name_plural=0x0048
name_leaf_plural=0x00c0
name_seed_plural=0x0090
materials_vector=0x01ec
flags=0x0028

[descriptor_offsets]
color_name=0x0030
shape_name_plural=0x0048

[health_offsets]
parent_id=0x0030
body_part_flags=0x0034
layers_vector=0x003c
number=0x005c
names_vector=0x0064
names_plural_vector=0x0070
layer_tissue=0x0018
layer_global_id=0x0048
tissue_name=0x0020
tissue_flags=0x0018

[dwarf_offsets]
first_name=0x0000
nick_name=0x0018
last_name=0x0030
custom_profession=0x0064
profession=0x007c
race=0x0080
flags1=0x00c8
flags2=0x00cc
flags3=0x00d0
meeting=0x00d8
caste=0x00e4
sex=0x00e6
id=0x00e8
animal_type=0x00f0
civ=0x00f8
specific_refs=0x0134
squad_id=0x014c
squad_position=0x0150
recheck_equipment=0x019c
mood=0x0224
birth_year=0x0244
birth_time=0x0248
pet_owner_id=0x026c
current_job=0x0330
physical_attrs=0x03e0
body_size=0x04b8
size_info=0x0488
curse=0x0590
curse_add_flags1=0x057c
turn_count=0x0638
souls=0x0718
states=0x0680
labors=0x0734
hist_id=0x07fc
artifact_name=0x06b4
active_syndrome_vector=0x0844
syn_sick_flag=0x0030
unit_health_info=0x08a4
temp_mood=0x0568
counters1=0x0550
counters2=0x056c
counters3=0x0654
limb_counters=0x0804
blood=0x04a0
body_component_info=0x0340
layer_status_vector=0x0024
wounds_vector=0x03a0
mood_skill=0x0334
used_items_vector=0x08a8
affection_level=0x000c
inventory=0x02bc
inventory_item_mode=0x0004
inventory_item_bodypart=0x0006

[syndrome_offsets]
cie_effects=0x0018
cie_end=0x0014
cie_first_perc=0x0060
cie_phys=0x0078
cie_ment=0x0094
syn_classes_vector=0x006c
trans_race_id=0x0094

[unit_wound_offsets]
parts=0x0004
id=0x0004
layer=0x0006
general_flags=0x001c
flags1=0x003c
flags2=0x0040
effects_vector=0x002c
bleeding=0x0044
pain=0x0048
cur_pen=0x0070
max_pen=0x0072

[soul_details]
name=0x0004
orientation=0x0070
mental_attrs=0x0094
skills=0x0200
preferences=0x020c
personality=0x0218
beliefs=0x0000
emotions=0x0018
goals=0x0024
goal_realized=0x0018
traits=0x0040
stress_level=0x00c4

[emotion_offsets]
emotion_type=0x0000
strength=0x0008
thought_id=0x000c
sub_id=0x0010
level=0x0014
year=0x0020
year_tick=0x0024

[job_details]
id=0x000c
mat_type=0x0028
mat_index=0x002c
mat_category=0x0040
on_break_flag=0x0011
sub_job_id=0x0044
reaction=0x0018
reaction_skill=0x0050

[squad_offsets]
id=0x0000
name=0x0004
alias=0x0068
members=0x0080
orders=0x008c
schedules=0x0098
sched_size=0x0040
sched_orders=0x001c
sched_assign=0x0028
alert=0x00a4
carry_food=0x0110
carry_water=0x0112
ammunition=0x00d4
ammunition_qty=0x000c
quiver=0x00bc
backpack=0x00c0
flask=0x00c4
armor_vector=0x0040
helm_vector=0x004c
pants_vector=0x0058
gloves_vector=0x0064
shoes_vector=0x0070
shield_vector=0x007c
weapon_vector=0x0088
uniform_item_filter=0x0004
uniform_indiv_choice=0x0020

[activity_offsets]
activity_type=0x0004
events=0x0008
participants=0x002c
sq_lead=0x0068
sq_skill=0x0070
sq_train_rounds=0x007c
pray_deity=0x0064
pray_sphere=0x0068
knowledge_category=0x0074
knowledge_flag=0x0078
perf_type=0x0064
perf_participants=0x0094
perf_histfig=0x000c

[valid_flags_2]
size=0

[invalid_flags_1]
size=9
1\name=a skeleton
1\value=0x00002000
2\name=a merchant
2\value=0x00000040
3\name=outpost liason or diplomat
3\value=0x00000800
4\name=an invader or hostile
4\value=0x00020000
5\name=an invader or hostile
5\value=0x00080000
6\name=resident, invader or ambusher
6\value=0x00600000
7\name=part of a merchant caravan
7\value=0x00000080
8\name="Dead, Jim."
8\value=0x00000002
9\name=marauder
9\value=0x00000010

[invalid_flags_2]
size=5
1\name="killed, Jim."
1\value=0x00000080
2\name=from the Underworld. SPOOKY!
2\value=0x00040000
3\name=resident
3\value=0x00080000
4\name=uninvited visitor
4\value=0x00400000
5\name=visitor
5\value=0x00800000

[invalid_flags_3]
size=1
1\name=a ghost
1\value=0x00001000

It took me a while to get a valid INI file - for whatever reason, the "devel/export-dt-ini" command was totally broken and completely ignored ASLR, thus producing bogus offsets that didn't work.

Do I need to download the "df_43_05_legacy32.zip" version of Dwarf Fortress for that?

I downloaded the "df_43_05_win.zip" and it doesn't seem to be working.
Logged
Crafting Statistics 42.06Farming Statistics

Blue Dwarf has been happy lately. He did some !!science!! recently. He admired a fine forum post lately. He was enraged by a forum troll recently. He was upset by the delayed release of the new version of Dwarf Fortress lately. He took joy in planning a noble's death recently.

jecowa

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2818 on: October 16, 2016, 06:48:17 am »

You need the 32-bit SDL version. (df_43_05_win32.zip)
Logged

Blue_Dwarf

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« Reply #2819 on: October 16, 2016, 07:00:55 am »

You need the 32-bit SDL version. (df_43_05_win32.zip)

Thanks, that worked  :)
Logged
Crafting Statistics 42.06Farming Statistics

Blue Dwarf has been happy lately. He did some !!science!! recently. He admired a fine forum post lately. He was enraged by a forum troll recently. He was upset by the delayed release of the new version of Dwarf Fortress lately. He took joy in planning a noble's death recently.
Pages: 1 ... 186 187 [188] 189 190 ... 222