Bay 12 Games Forum

Please login or register.

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

Author Topic: Dwarf Therapist (LATEST 0.5.7 7/13/10 see first post)  (Read 624618 times)

Guhndahb

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #240 on: September 07, 2009, 01:39:00 pm »

Hi chmod, the main problem for me patching it is that I'm unsure if there are multiple possible Window Class values for the different versions of DF (I'm _really_ new to DF).  The version I'm using (came w/ a tutorial) has a window class of "OpenGL".  But I don't know if that's true of others.  If there are multiple, and I make that change, it could break DT for those with a different window class.

Oh and EnumWindows() probably isn't necessary for DT, though.  It's very useful, and a necessity for more advanced window handle searching, but I think it's overkill here.  FindWindow() should be fine.  Assuming there is only the one possible Windows window class of "OpenGL" you could Simply call FindWindow("OpenGL", "Dwarf Fortress") and that would eliminate it finding explorer.exe.  If there are other possible window classes you could just call FindWindow() a couple of times checking each if they return null. 

My recommendation is this:  If you feel confident that there is only the one possible window class for DF just replace that one line with:
Code: [Select]
HWND hwnd = FindWindow(L"OpenGL", L"Dwarf Fortress");otherwise, I'd suggest reading multiple possible values from a new group in game_data.ini and just iterating through them until hwnd != null.  I should point out, however, that it's unusual for a developer to change the app's main window class name, so putting it in the .ini instead of hard coding it may also be overkill especially since the project is OSS.  If all versions of DF use OpenGL then it's likely they all have the same window class since that's probably being set by the framework.

Oh and to get the window class I use Spy++ but since you likely don't have Visual Studio you may not have access to that.  I checked StackOverflow for an alternative and one user recommended WinDowse but I've never tried it.  If it works like Spy++ just target the title bar to get the main window.

The other alternative actually is to use EnumWindows() which will allow you to iterate through all the windows with a name of "Dwarf Fortress" and then select the right one according to some criterion other than window class, but, as I said, that's probably overkill.

Edit:
Here's a quick and dirty fix now that I think about it.  It'll solve the problem at least for people with a window class of OpenGL and it'll fall back to your current behavior if that's not found:
Code: [Select]
HWND hwnd = FindWindow(L"OpenGL", L"Dwarf Fortress");
if (hwnd == null) hwnd = FindWindow(NULL, L"Dwarf Fortress");
« Last Edit: September 07, 2009, 01:46:59 pm by Guhndahb »
Logged

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #241 on: September 07, 2009, 01:59:18 pm »

Hi chmod, the main problem for me patching it is that I'm unsure if there are multiple possible Window Class values for the different versions of DF (I'm _really_ new to DF).  The version I'm using (came w/ a tutorial) has a window class of "OpenGL".  But I don't know if that's true of others.  If there are multiple, and I make that change, it could break DT for those with a different window class.

Everything up through .40d uses "OpenGL".  The .40d# testing versions use "SDL_app".

I do something like
Code: [Select]
hwnd = FindWindow("OpenGL", "Dwarf Fortress");
if (hwnd == NULL)
    hwnd = FindWindow("SDL_app", "Dwarf Fortress");
if (hwnd == NULL)
    didn't find it.
Logged

chmod

  • Bay Watcher
  • I get by with a little help from my friends
    • View Profile
    • UDP Viper
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #242 on: September 07, 2009, 02:07:17 pm »

Thanks a lot guys, I'll give it a go! I do have visual studio, but I'm a mobile developer by trade (Symbian anyone?). So this windows stuff is pretty new to me. This has been a hell of a learning experience so far.
Logged

Guhndahb

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #243 on: September 07, 2009, 02:14:21 pm »

Everything up through .40d uses "OpenGL".  The .40d# testing versions use "SDL_app".
Ah that's exactly what concerned me.  I saw the forum announcement for the SDL version and that made me suspect there might be alternative window classes which needed to be considered.  Thanks for checking that, 0x517A5D.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #244 on: September 07, 2009, 06:16:21 pm »

One thing that would be really useful would be the ability to display skill levels as actual numbers - blank for "completely unskilled" (so I know who needs to be "primed" with a moodable skill), 0 for Dabbling, 1 for Novice, 2 for no-label, etc., up to 15 for Legendary (and preferably further to 20 for Legendary+5 so I know when I can let the dwarf use my really valuable materials without risking a mere 'superior' quality item).
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.

Shades

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #245 on: September 08, 2009, 03:53:19 am »

I have a copy of d16 on linux sort of working if that's what you mean. The current state of the linux client goes like this:

1) Wow some guy made a linux client, cool
2) Hmm I don't have over 50% of the libs he used
3) Well I convinced the library loader that these .so's will work so at least it launches
4) Hey it read my fort!
5) Hey it corrupted my fort!

So I will most likely have to get some more folks testing and a whole lot more debugging output before it reaches the same maturity of the windows version. However I think I have mostly nailed reading/writing to the game, I'm just going to have to make a separate scanner tool to find addresses.

I'm happy to test the linux version, I (currently) run under 64bit ubuntu and have things like code::blocks / gcc installed anyway. Is the code for Linux in the svn repository as well?
Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #246 on: September 08, 2009, 05:46:07 am »

OK guys. Here's how I do it in dfhack:
I just enumerate all processes, find their PE header timestamp and compare it with a list of known ones.
There's a slight possibility of collision, but way less probable than checking window titles. It works even with multiple instances of DF running.

I just can't get hold of the other devs and relicense it under something better than GPLv3...

Here's the relevant file : http://khazad.svn.sourceforge.net/viewvc/khazad/Khazad/dfhack/library/ProcessManager.cpp?revision=173&view=markup
The method for Windows starts @line 185. Same thing for Linux is @line 61.

Now I'm tempted to move all the code not written by me to khazad where it belongs and release the rest (most if not all of the process stuff and SimpleAPI) under a two-clause BSD license. I wonder... can I do that?
« Last Edit: September 08, 2009, 06:15:47 am by peterix »
Logged

Shurhaian

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #247 on: September 08, 2009, 08:14:12 pm »

I look forward to hearing about progress getting this program to work under 40d16 Linux. My system is marginal enough that I'm not sure I really want to poke at too much extra stuff until there's some feedback to the effect of it working, but even without the text entry it'd be a godsend.

Re: tracking immigrant waves - is there a way to snoop on the in-game date a dwarf is first noticed? For that matter, I recall from using DM (before my Windows box died) that as soon as a wave first arrived, ALL the dwarves were listed in DM even if they hadn't all appeared in world yet. Perhaps there's no way to track it between sessions, but remembering who showed up when during a session could still be handy - if you want to let the spring migrants show up before assigning them jobs, or, if indeed they all are in memory from the moment the first appears, grouping them all together and assigning tasks that way.
Logged
Working on: drakes - making the skies(mostly) a bit more varied

My guards need something better to do than make my nobles happy with hugs and justice.

chmod

  • Bay Watcher
  • I get by with a little help from my friends
    • View Profile
    • UDP Viper
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #248 on: September 08, 2009, 08:28:18 pm »

I look forward to hearing about progress getting this program to work under 40d16 Linux. My system is marginal enough that I'm not sure I really want to poke at too much extra stuff until there's some feedback to the effect of it working, but even without the text entry it'd be a godsend.

Re: tracking immigrant waves - is there a way to snoop on the in-game date a dwarf is first noticed? For that matter, I recall from using DM (before my Windows box died) that as soon as a wave first arrived, ALL the dwarves were listed in DM even if they hadn't all appeared in world yet. Perhaps there's no way to track it between sessions, but remembering who showed up when during a session could still be handy - if you want to let the spring migrants show up before assigning them jobs, or, if indeed they all are in memory from the moment the first appears, grouping them all together and assigning tasks that way.
I just got it working fairly well on d14, d15, and d16 for linux. Needs a bit more testing before release, but it's coming along nicely. You should thank the alpha testers :)
Logged

njero

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #249 on: September 08, 2009, 09:35:45 pm »

One thing that would be really useful would be the ability to display skill levels as actual numbers - blank for "completely unskilled" (so I know who needs to be "primed" with a moodable skill), 0 for Dabbling, 1 for Novice, 2 for no-label, etc., up to 15 for Legendary (and preferably further to 20 for Legendary+5 so I know when I can let the dwarf use my really valuable materials without risking a mere 'superior' quality item).
This suggestion is far to simple and elegant to have only occurred at this point in the thread. You sir, must be a time traveller!

Seriously though, good suggestion. I recommend that the font display for level indicators be independent of the other font setting. That way we can have nice string-reading fonts for labels, and whatever appropriately eye-catching font suits us best for the numeral. Silkscreen? :D
Logged
these aren't buzzards, they're cliff racers!

chmod

  • Bay Watcher
  • I get by with a little help from my friends
    • View Profile
    • UDP Viper
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #250 on: September 08, 2009, 09:38:31 pm »

One thing that would be really useful would be the ability to display skill levels as actual numbers - blank for "completely unskilled" (so I know who needs to be "primed" with a moodable skill), 0 for Dabbling, 1 for Novice, 2 for no-label, etc., up to 15 for Legendary (and preferably further to 20 for Legendary+5 so I know when I can let the dwarf use my really valuable materials without risking a mere 'superior' quality item).
This suggestion is far to simple and elegant to have only occurred at this point in the thread. You sir, must be a time traveller!

Seriously though, good suggestion. I recommend that the font display for level indicators be independent of the other font setting. That way we can have nice string-reading fonts for labels, and whatever appropriately eye-catching font suits us best for the numeral. Silkscreen? :D
It would be even better if someone opened a feature request ticket for it! Seriously guys, I don't read every page of this thread when I'm working on this, but I do read my open ticket list. If you want it done, file the ticket! See my sig for links, or use the help menu in DT.

Thanks!
Logged

chmod

  • Bay Watcher
  • I get by with a little help from my friends
    • View Profile
    • UDP Viper
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #251 on: September 08, 2009, 09:58:14 pm »

LINUX NEWS
The linux build is stabilizing a bit. It's still pretty far behind the windows version, but labor writing, and happiness reporting are working which is about 90% of the features most of us need. So I'm going to open up testing for the linux client.

Links and instructions are here: http://code.google.com/p/dwarftherapist/wiki/LinuxVersion

Please be aware that this is super-alpha (even more alpha than DF!) And may very well completely corrupt your forts. So backup your region folder before trying this. Also keep in mind that string writing (nicknames, and applied custom professions) won't work. And likely never will on Linux due to how glibc stores strings.

You can still apply a custom profession, and it will set the labors correctly, it just won't change their actual custom profession text field.

HAPPY TESTING!
Logged

zooeyglass

  • Bay Watcher
  • Melbil that!
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #252 on: September 09, 2009, 06:27:05 am »

i tried this out after a recommendation on the 'gameplay questions' forum, and just wanted to post up my initial thoughts:

Quote
this application is FANTASTIC. seriously, so many wonderful little features. familiarity with dwarf manager helps, of course, but some of the profession set-ups and view alterations, once one gets the hang of them, are brilliantly handy. i have a set up so that i can view dwarves just by hauling designations - easy for tweaking more people onto item hauling when a goblin siege has just brushed by.

you can also view happiness, which i find to be a major plus, as it's handy for monitoring anyone with a massive dip or some (death of siblings/pets/etc). it's the customisation of this utility that really makes it killer - it really feels like it's built so that the player can get the most out of the information from dwarf fortress. really rate it!

just so you know....honestly recommended, from a gameplay perspective.
Logged

It is a total pain in the butt, but you gotta do what you gotta do if you want that upright candy weapon.
Your suspicions are nothing more than superstition

Lesconrads

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #253 on: September 09, 2009, 06:58:39 am »

I look forward to a working linux version! Managing everything with custom names for Dwarfs gets hard after some time :\
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Dwarf Therapist (LATEST 0.3.1 8/19/09 see first post)
« Reply #254 on: September 09, 2009, 08:29:22 am »


It would be even better if someone opened a feature request ticket for it! Seriously guys, I don't read every page of this thread when I'm working on this, but I do read my open ticket list. If you want it done, file the ticket! See my sig for links, or use the help menu in DT.

Thanks!

I was going to enter a feature request, but I couldn't find the bug tracker on the Google Code page. Only now did I manage to find it here (with the rather peculiar name "Issues"), and I've just added 3 new enhancement requests.
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.
Pages: 1 ... 15 16 [17] 18 19 ... 124