Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarf Therapist Continuing Development  (Read 4654 times)

DwarfEngineer

  • Bay Watcher
  • Grumble Grumble...
    • View Profile
Dwarf Therapist Continuing Development
« on: February 14, 2012, 11:02:10 pm »

Starting a side thread because there was some interest from a few people in helping with the continued development of Dwarf Therapist.

I'll use this thread to publish some of the basics about the code base and discuss development path.

DwarfTherapist Offsets Bootcamp
Basically, you start by crafting a particular save game - I typically have a dedicated folder for DT development and create games as follows:
  • Generate a pocket world.
  • Embark at the first location, and choose "Prepare for journey carefully"
  • Give the first dwarf (embark leader) level 10 in mining and teaching.
  • Customize the first dwarf to have a nickname of this_is_a_long_name and a custom profession of 0123456789abcdef.
  • Then embark and pause the game
  • Open the [M]ilitary screen, [C]reate a new squad, and assign the first dwarf (now named 'this_is_a_long_name') as the leader

After following these steps, you can then find the offsets using therapist. If it's just a minor update to DF, you can use the Create New Layout functionality from the Scan Memory screen. This will automatically scan all of the vectors and create a new memory offsets ini file for you (if all goes well.) Otherwise you have to check run.log for the new checksum, and start hand editing a new offsets ini file.

  • Translation Vector - Finds the language and translation vector
     
    • If DwarfTherapist is having trouble finding this vector, you can search for the C String ABBEY, and do 2(?) reverse lookups to find the vector, then subtract 4 from that address and use the enumerate vector tool to find out how many entries there should be.
    • Once you know how many entries there should be, update game_data.ini with that value.
    • I'll add more details to this soon (and modify DT to do this automatically if it doesn't find a vector of the expected size)
  • Dwarf Race Index - DT has been modified so it should be better at finding this regardless of the expected dwarf race id.
  • Creature Vector - This one should always work as long as the nickname offset is correct in game_data.ini
  • Squad Vector - This one should always work as long as you have the expedition leader assigned to a squad by himself
I'll add notes on additional methods of finding these offsets and the dwarf offsets, etc, in the future.
« Last Edit: February 16, 2012, 09:11:23 am by DwarfEngineer »
Logged
Current Dwarf Therapist Maintainer - Tips

misaac

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #1 on: February 14, 2012, 11:09:59 pm »

Checking in.  I've already done a little prelim work on a new version ini.  Just waiting for feedback or a knowledge dump to make sure I'm doing this as is needed.
Logged

stevedore

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #2 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.
Logged

DwarfEngineer

  • Bay Watcher
  • Grumble Grumble...
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #3 on: February 15, 2012, 09:49:34 am »

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.
Logged
Current Dwarf Therapist Maintainer - Tips

Darmarius

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #4 on: February 15, 2012, 11:18:39 am »

I'm also interested in this. I haven't had the opportunity yet to take a look at the code base, probably tonight or tomorrow.

As for background I'm (currently) a Java programmer and I have some experience in a wide range of programming language, including C++.

And for the project owner, if we can't reach him we could always fork the project somewhere else, like Github, Sourceforge, Bitbucket or any other out there.
Logged

zanchito

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #5 on: February 15, 2012, 12:03:42 pm »

I'm interested too, mostly from an academical viewpoint. I might get myself involved in the Legends Viewer, so I don't know if I'd have the time to help over here too, but I'm interested in the articles or any source code.
Logged

stevedore

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #6 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.
Logged

DwarfEngineer

  • Bay Watcher
  • Grumble Grumble...
    • View Profile
Re: Dwarf Therapist Continuing Development
« Reply #7 on: February 16, 2012, 09:11:45 am »

Updated with basic instructions for finding offsets.
Logged
Current Dwarf Therapist Maintainer - Tips