Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 174 175 [176] 177 178 ... 192

Author Topic: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)  (Read 870721 times)

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 3/6/12 see first post)
« Reply #2625 on: January 03, 2013, 01:00:57 am »

I feel I should step into the discussion to say some things.

First of all, splinterz's above quote is correct. I've not changed the README however my current version of DGC still uses the old formula. (though refactored!)

This formula assumes that information in the wiki is correct, and without seeing more well documented tests with evidence I think they are correct. Attributes get raised by using skills and I believe thistleknot used dwarves from two large fortresses which would have seen attribute growth.

The DGC formula takes an attribute that falls within the generated range and maps it from 0-100. This roughly is how much of the population this is better than. If it's 80% it means that given 100 generated dwarves this will be above ~80 of them.

This is a very good formula to use when embarking! However it suffers huge problems as soon as you get immigrants, babies or any of your dwarves do anything since attributes will deviate from the generated averages.

If you have a very large fort you don't want to know how good your dwarves are above the generated average, you want to know how good they are in relation to all your other dwarves. Hence, two formula are needed, one for embark and one afterwards.

A third formula may be useful and can also be used on any other creatures. This is to say that attributes are between 0-5000 so weight all attributes by dividing by 500. 100 will be the maximum value possible and 0 the minimum.

So yeah, I'm planning on having all three formula in the next release of DGC. Hopes this info helps people! :)

wow, old shiz revisited.

we actually decided that basing on embark was better.  I was assuming migrants were based on embark dwarves... if there not... then there's a whole ball of wax that may need to be adjusted... how does one incorporate 3 diff formulas?  sounds like a mess... and if that is the case, then maybe adjusting the %'s based on the current population are called for... but we know what the values are limited to.  stats can only reach x2 of starting

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2626 on: January 03, 2013, 11:18:35 am »

to try and remove the process of checking out the source and compiling manually for linux users, i've got a dwarf therapist package for you to try out. it seems to work alright on my flavour of linux, but i'd like to get some more people to try it out before i start building a linux package consistently in my releases.

download it here

extract, and run with the DT script inside. let me know if anything explodes or if you have other ideas on a packaging up a linux release (i really don't know what i'm doing haha)
« Last Edit: January 04, 2013, 07:04:35 pm by splinterz »
Logged

arclance

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2627 on: January 03, 2013, 11:29:07 am »

to try and remove the process of checking out the source and compiling manually for linux users, i've got a dwarf therapist package for you to try out. it seems to work alright on my flavour of linux, but i'd like to get some more people to try it out before i start building a linux package consistently in my releases.

download it here

extract, and run with the DT script inside. let me know if anything explodes or if you have other ideas on a packaging up a linux release (i really don't know what i'm doing haha)
I have been experimenting with doing that as well for the Linux version of Mephs Masterwork mod.
The first version of mine is in the latest Linux version, 2c, of Masterwork.
I tried to include all the libraries that are version dependent or need to be 32bit in mine to make it easy for others to use.
I did find that a 32bit build could not detect the users QT theme on a 64bit computer but it otherwise worked fine.

I will look at yours when I get home (no Linux here) and see if I see anything obvious wrong with it.
Hopefully you did not build on Ubuntu 12.04 or later, or a recent Fedora because they use a newer glibc (eglibc), 2.15, than many distros.
This means programs built on them won't work on many peoples Linux installs.
« Last Edit: January 03, 2013, 12:45:05 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2628 on: January 03, 2013, 12:44:42 pm »

to try and remove the process of checking out the source and compiling manually for linux users, i've got a dwarf therapist package for you to try out. it seems to work alright on my flavour of linux, but i'd like to get some more people to try it out before i start building a linux package consistently in my releases.

download it here

extract, and run with the DT script inside. let me know if anything explodes or if you have other ideas on a packaging up a linux release (i really don't know what i'm doing haha)
I have been experimenting with doing that as well for the Linux version of Mephs Masterwork mod.
The first version of mine is in the latest Linux version, 2c, of Masterwork.
I tried to include all the libraries that are version dependent or need to be 32bit in mine to make it easy for others to use.
I did find that a 32bit build could not detect the users QT theme on a 64bit computer but it otherwise worked fine.

I will look at yours when I get home and see if I see anything obvious wrong with it.
Hopefully you did not build on Ubuntu 12.04 or later, or a recent Fedora because they use a newer glibc (eglibc), 2.15, than many distros.
This means programs built on them won't work on many peoples Linux installs.

ah dammit, i think it was on ubuntu 12.10.. i'll have to get an older version then and recompile, thanks for the heads-up. as for the method, i'm just packaging the qt libraries indicated after running ldd on the executable, and using a script to set the ld_library_path. from all the qt documentation i've read it seems this is the most flexible (and simple) solution.

for the ptrace kernel hardening issue i read somewhere on the forums here about using a script to launch therapist and then fortress as a work around. however i'm not sure if you can daisy chain multiple things like stonesense and dfhack into it as well.

i'm not knowledgeable as to exactly what distros require which other additional libraries so any advice is much appreciated.

arclance

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2629 on: January 03, 2013, 01:12:48 pm »

I will look at yours when I get home and see if I see anything obvious wrong with it.
Hopefully you did not build on Ubuntu 12.04 or later, or a recent Fedora because they use a newer glibc (eglibc), 2.15, than many distros.
This means programs built on them won't work on many peoples Linux installs.

ah dammit, i think it was on ubuntu 12.10.. i'll have to get an older version then and recompile, thanks for the heads-up. as for the method, i'm just packaging the qt libraries indicated after running ldd on the executable, and using a script to set the ld_library_path. from all the qt documentation i've read it seems this is the most flexible (and simple) solution.
You only need to go back to Ubuntu 11.10, that has glibc 2.13 which should work unless someone has not updated their Linux install in several years.

I use a 32bit xubuntu 11.10 VM to build updated versions of dfhack for Masterwork since it has glibc 2.13 and gcc 4.5.
The current version of Dwarf Fortress was built with gcc 4.5 so it is best to build dfhack with it, Debain does not have gcc 4.5 so I used xubuntu.
You can use any gcc version you want for Therapist as long as it compiles.

I use a script to load the libs as well, it is the easiest way to do it.
I included more libs than that for ease of use on non-Debian based systems.
I put in pretty much everything but the X11 stuff for now, you should use the system version of those and they can be 64bit.
I am sure some of them are unneeded but I have not had time to work out which ones yet.

for the ptrace kernel hardening issue i read somewhere on the forums here about using a script to launch therapist and then fortress as a work around. however i'm not sure if you can daisy chain multiple things like stonesense and dfhack into it as well.
I put some documentation on ways to allow ptrace in the Linux instructions I wrote for Masterwork.
I will post them here when I get home, I can't get at them here.

I have seen the script you are talking about but I have not had any luck trying to employ it with dfhack and therapist at the same time.
The problem is that dfhack takes over your terminal now and that holds your script at the line where you start dfhack until Dwarf Fortress is closed.
Stonesense is part of dfhack now so you don't have to daisychain it in anymore.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

arclance

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2630 on: January 03, 2013, 04:45:19 pm »

for the ptrace kernel hardening issue i read somewhere on the forums here about using a script to launch therapist and then fortress as a work around. however i'm not sure if you can daisy chain multiple things like stonesense and dfhack into it as well.
I put some documentation on ways to allow ptrace in the Linux instructions I wrote for Masterwork.
I will post them here when I get home, I can't get at them here.
Here is what I have about allowing ptrace.
Code: [Select]
Depending on your kernel version and build settings you may need to enable Dwarf Therapist to use ptrace on other processes.
You may get a error like this

ptrace attach: Operation not permitted

or this

ptrace: Permission denied

in your terminal when you run Dwarf Therapist if you are experiencing this problem.

If your kernel does not have an extra LSM enabled or you are running the Yama LSM (Ubuntu and others) you can enable ptrace by running this command as root in the "MasterworkDwarfFortress/Utilities/Dwarf_Therapist" directory.

sudo setcap cap_sys_ptrace=ep DwarfTherapist

This will allow the DwarfTherapist executable to ptrace other processes but will not turn off ptrace protection for the rest of your system.

If your kernel is running SELinux (Fedora and others) you can enable ptrace by running this command as root.

setsebool deny_ptrace 0

This turns off all ptrace protection, ptrace protection will be reactivated if you reboot or run "setsebool deny_ptrace 1" as root.
It is also possible to completely turn off ptrace protection when running Yama but it is not necessary to do that.

as for the method, i'm just packaging the qt libraries indicated after running ldd on the executable, and using a script to set the ld_library_path. from all the qt documentation i've read it seems this is the most flexible (and simple) solution.
Your script looks fine but I thought I would show you the one I am going to use in future Masterwork Linux releases.
Code: [Select]
#!/bin/sh
appname="DwarfTherapist"

dirname=`dirname $0`
tmp="${dirname#?}"

if [ "${dirname%$tmp}" != "/" ]; then
dirname=$PWD/$dirname
fi
cd "$dirname"
LD_LIBRARY_PATH="$dirname/libs":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
$dirname/$appname "$@"
It will work no matter what your current working directory is when you start it.
« Last Edit: January 03, 2013, 05:13:50 pm by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

Bot Hack

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2631 on: January 03, 2013, 05:12:41 pm »

Wow thank you this works great!
Logged

Antalia

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2632 on: January 03, 2013, 08:12:38 pm »

Could someone point me to a resource that shows the mapping of labors to the indices used in an exported custom_professions.dtp? (I can read code or human, doesn't matter.)

I can extract what I'm looking for by brute force, but a clue would save some time. :) Thanks.
Logged
Author of Saga of Nutscaves, a tale of unsafe working conditions, plague, and worse

Creator of Dwarf Organizer, a Java application to help assign labor in your fortress

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2633 on: January 04, 2013, 05:44:27 am »

@arclance - well i've got the older version of ubuntu installed to recompile. having some nasty issues getting qt upgraded to 4.8.4 so i may have to abandon that and just package with 4.7.4. thanks for the script, that's a bit more robust. i'll have to try out the setcap method, although it would be nice to allow DT to run without root permissions..

Could someone point me to a resource that shows the mapping of labors to the indices used in an exported custom_professions.dtp? (I can read code or human, doesn't matter.)

I can extract what I'm looking for by brute force, but a clue would save some time. :) Thanks.

in DT, edit a script, there's a list on the right hand pane, or you can use the game_data.ini in the etc folder:

http://code.google.com/r/splintermind-attributes/source/browse/etc/game_data.ini#903

arclance

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2634 on: January 04, 2013, 08:44:41 am »

@arclance - well i've got the older version of ubuntu installed to recompile. having some nasty issues getting qt upgraded to 4.8.4 so i may have to abandon that and just package with 4.7.4. thanks for the script, that's a bit more robust. i'll have to try out the setcap method, although it would be nice to allow DT to run without root permissions..
The setcap command does not run Therapist is just marks the executable as "allowed to use ptrace".
You can run it as a regular user and it will work, you just need to be root to use the setcap command.

You could also build in Debian Testing and get glibc 2.13 and QT 4.8.2.
It not 4.8.4 but Debian is not quite as gun ho about updating core packages as Ubuntu.
The relevant package names are the same.
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2635 on: January 04, 2013, 09:10:42 am »

@arclance - well i've got the older version of ubuntu installed to recompile. having some nasty issues getting qt upgraded to 4.8.4 so i may have to abandon that and just package with 4.7.4. thanks for the script, that's a bit more robust. i'll have to try out the setcap method, although it would be nice to allow DT to run without root permissions..
The setcap command does not run Therapist is just marks the executable as "allowed to use ptrace".
You can run it as a regular user and it will work, you just need to be root to use the setcap command.

You could also build in Debian Testing and get glibc 2.13 and QT 4.8.2.
It not 4.8.4 but Debian is not quite as gun ho about updating core packages as Ubuntu.
The relevant package names are the same.
i realize setcap doesn't run therapist, however i'm forced to run therapist as root after running setcap it appears. same as another user described here.

so far the 4.8.4 libraries aren't working; it's not decorating the window/graphics properly (looks like windows 95 :D) maybe something went wrong when compiling the libraries, i don't know yet.

Quote
I put in pretty much everything but the X11 stuff for now, you should use the system version of those and they can be 64bit.
can you elaborate on how you determined which shared libraries to package?

arclance

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2636 on: January 04, 2013, 09:28:18 am »

@arclance - well i've got the older version of ubuntu installed to recompile. having some nasty issues getting qt upgraded to 4.8.4 so i may have to abandon that and just package with 4.7.4. thanks for the script, that's a bit more robust. i'll have to try out the setcap method, although it would be nice to allow DT to run without root permissions..
The setcap command does not run Therapist is just marks the executable as "allowed to use ptrace".
You can run it as a regular user and it will work, you just need to be root to use the setcap command.

You could also build in Debian Testing and get glibc 2.13 and QT 4.8.2.
It not 4.8.4 but Debian is not quite as gun ho about updating core packages as Ubuntu.
The relevant package names are the same.
i realize setcap doesn't run therapist, however i'm forced to run therapist as root after running setcap it appears. same as another user described here.
Try
Code: [Select]
sudo setcap cap_sys_ptrace=eip DwarfTherapist
That sets all the ptrace premissions possible, maybe it needs more than "ep" to work.
Make sure you run that command in the "bin/release" folder so it gets applied to the correct executable.
You can use
Code: [Select]
sudo getcap DwarfTherapist
to check if the setcap command worked.

There are other things you can set with setcap and it might need one of them.
I believe that sudo runs things with all of the setcap controlled stuff set to the most permissive values.

so far the 4.8.4 libraries aren't working; it's not decorating the window/graphics properly (looks like windows 95 :D) maybe something went wrong when compiling the libraries, i don't know yet.
Do you have a QT theme set on that system?
You might just be seeing the default theme, I remember it being pretty terrible.

Quote
I put in pretty much everything but the X11 stuff for now, you should use the system version of those and they can be 64bit.
can you elaborate on how you determined which shared libraries to package?
I used "ldd" on the "DwarfTherapist" executable to see what it depended on and copied them all (following links and renaming) to a "libs" folder.
« Last Edit: January 04, 2013, 09:39:21 am by arclance »
Logged
I think that might be one of the most dwarfen contraptions I've ever seen the blueprints of.
The Bloodwinery v1.3.1 | Dwarven Lamination v1.5 | Tileset Resizer v2.5 - Mac Beta Tester Needed
Sigtext

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2637 on: January 04, 2013, 07:09:43 pm »

@arclance: well it turned out that i had to recompile the libraries for qt, seems i was missing some of the prerequisites before i compiled the first time. looks like everything is running well without funky graphics anymore. i had to slightly modify the script to surround the last line with" marks when i had a space in the folder name. just something to be aware of.

i've packaged up another version with the qt 4.8.4 libraries as well as every other system library ldd reported for more testing, so if anyone wants to try it out, here it is:

Download Dwarf Therapist Linux v19.1

Nkosi_SW

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2638 on: January 05, 2013, 12:01:59 am »

Just letting you know that I've noticed two minor problems in the latest version.

The first is that on my setup, the happiness column is blacked out when I start DT:
Spoiler (click to show/hide)

If I go and change an option, any option (eg the "Show profession desciption in the tooltip"option, either enabling or disabling) and then say "Yes" to "Would you like to apply the new options now (Read Dwarves)?", then the column changes back to it's usual state (ie yellow for Content, dark green for Happy etc) and continues to display correctly until DT is closed.  When DT is started again, the problem reappears.  Just doing a "Read Dwarves" does not fix the problem.

The second problem is that DT no longer maintains the vertical scroll position of the main grid of dwarves when a "Read Dwarves" is performed.  Instead, the grid repositions to the top of the list of dwarves on every Read, which was the old behaviour a few versions back before this was fixed.

Not too serious, but the second problem especially is annoying.  Let me know if I can provide any more details.

Logged

Maklak

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2639 on: January 05, 2013, 04:29:02 am »

I use the branch 16.1 and noticed something rather annoying. When I sort by skill, instead of the current XP for that skill, it actually sorts by a routine using the current level in that skill and stats to determine, who is the best candidate for that labour. It would be fine, except this routine doesn't take into account the skill rates. I play a mod with heavy emphasis on castes and the learning rates are in the 50-300 range, so they matter even more than stats.
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral
Pages: 1 ... 174 175 [176] 177 178 ... 192