could we have traits added into dwarf therapist rather than having to apply filters?
i'm pretty sure you can add trait columns in a custom view if you want, however the drawing methods are missing (i think).
in regards to the roles i've been working on and after giving it more thought, i'm strongly leaning towards just implementing something similar to what dgc did in terms of allowing users to specify a role simply by adding lists of traits, attributes and skills. the advantage would be that it's much more user friendly to define a custom role. the disadvantage is it won't be as flexible as building some crazy weighted script.
the only question then is how to also factor in the levels of traits and skills? should they be weighted equally important as attributes, or something else? anyone have any thoughts on this?
I think that's best. I just did a formula with a trait.
I had 3 attributes (for a diagnostician), and added helpfulness. To get helpfulness to match the other stat, I weighted it by x17.
I chose x17 because attribute-50 = a range of 0 to 50 away from 0 (center). The 3 attributes that (diagnostician used in DGC) were Analytical Ability, Memory, and Intuition. Each had their own range of 800-900 from 0. I got this from determining what the minimum vs maximum was (I had a sample of dwarves (WHICH HAS DIFFERENT RESULTS THAN THE WIKI FOR SOME AVERAGES), but one could just use the
http://dwarffortresswiki.org/index.php/DF2012:Attribute site and guess what the max was.
Sample was from 294 dwarves
Sample was from 294 dwarves
Attribute Min Avg Cnter Max Range MRng MxRng AvgRng Factor CntAvg
strength 458 1303 1250 2248 1790 845 945 895 0.9045894737
agility 146 886 900 1595 1449 740 709 724.5 1.256374269
toughness 458 1268 1250 2229 1771 810 961 885.5 0.9045894737
endurance 227 1021 1000 2072 1845 794 1051 922.5 1.1307368421
recuperation 212 1027 1000 1997 1785 815 970 892.5 1.1307368421
disease resistance 200 1019 1000 1998 1798 819 979 899 1.1307368421
analytical ability<205 1056 1250 1971 1766 851 915 883 0.9045894737
focus< 220 1053 1542 1960 1740 833 907 870 0.7332923749
willpower> 444 1257 1000 2243 1799 813 986 899.5 1.1307368421
creativity< 219 1036 1250 1995 1776 817 959 888 0.9045894737
intuition> 452 1256 1000 2250 1798 804 994 899 1.1307368421
patience< 207 1022 1250 1996 1789 815 974 894.5 0.9045894737
memory> 695 1513 1250 2486 1791 818 973 895.5 0.9045894737
linguistic ability 236 1083 1000 2108 1872 847 1025 936 1.1307368421
spatial sense< 198 1040 1542 2041 1843 842 1001 921.5 0.7332923749
musicality> 732 1541 1000 2537 1805 809 996 902.5 1.1307368421
kinesthetic sense 229 1075 1000 2010 1781 846 935 890.5 1.1307368421
empathy> 445 1264 1000 2227 1782 819 963 891 1.1307368421
social awareness> 465 1272 1000 2243 1778 807 971 889 1.1307368421
AVERAGE 1130.7368421053
Average of sample: 1157.6713211601
The 3 attribute's had ranges from their average as 800, 800, 900 from average. (averaged range from average had 833.33). 833.33/50 = 16.66.
I could have used 16.66, but I wanted to give helpfulness a higher weight, so I made it 17.
I weighted the other two, analytical ability, intuition, and whatever at 1 to 1.1, so I was giving helpfulness a weight of .33 higher (16.66 to 17 is .33 higher).
I would include the option of specifying weights, default could be 1 if none is entered.
In the end the formula was something like this
((
((d.analytical_ability()-1000)*1.1)+
((d.memory()-1500)*1)+
((d.intuition()-1250)*1)+
((d.trait(20)-50)*17)
)/4)>110
Hope that made sense.
Update:
The idea works, but I just realized those ranges are not from average. Range from 0 is different some have higher range to max than they do to min. I guess I would have to average those two.
For example, for intuition I have a min of 452, max of 2250. Range of 1790. However, average is 1256. So a min has a range of 804 from average, and max has a range of 994. I would of course round all these numbers. I would say the min has a range of 0 of 800, and from max 1000. I would average the two to say intution has a range of 900 from 0.
I would then repeat the same for analytical ability and memory.
Analytical: 900 from average
Memory: 850 from averaage
(900+900+850)/3 = 883.333
883.333/50 = 17.66666666666667
New formula would be
((
((d.analytical_ability()-1000)*1.1)+
((d.memory()-1500)*1)+
((d.intuition()-1250)*1)+
((d.trait(20)-50)*18)
)/4)>110
If I were to use more traits, I would continue to base the traits multiplier on the value I derived (ex. 883.333/50 = 17.66666666666667), and increase the number I'm dividing by from /4 to how many attributes/traits are involved.
The 110 is a number I derived from the average center attribute value (i.e. an average of all attribute average values) * 10%. 1100 in this case is the average of ALL ATTRIBUTE averages. However, it might be more accurate to use the averages of only the attribute's involved. Example: Intution average is 1250, Memory: 1500, Analytical: 1000, average is 1250. Again, I'm using the averages I derived from a sample of 294 dwarves, the averages for stats are listed in the wiki, and those can be used instead.
Update:
I just realized something, applying the .33 increased to 17.66 might not be right, I might want to do d.trait(20)*17.66*1.3.
New formula would be
((
((d.analytical_ability()-1000)*1.1)+
((d.memory()-1500)*1)+
((d.intuition()-1250)*1)+
((d.trait(20)-50)*17.66*1.3)
)/4)>125
Update 3:
Changed my < to > in my formula's
As a side note, the benefit of crazy weighted scripts isn't really important. Dwarf Therapist has the ability already by just using the scripts I provided, one can change the >threshold quite easily. I no longer think a column with a weighted script is a good idea anymore. I think maybe some default scripts being provided with dwarf therapist is a better idea. However, determining weights is a hard issue. I'm thinking of starting a thread on dt filter scripts.
Here's a ranged combat script
d.can_set_labors() &&
((
((d.agility()-900)*1.2)+
((d.toughness()-1250)*.7)+
((d.endurance()-1000)*.7)+
((d.recuperation()-1000)*.6)+
((d.disease_resistance()-1000)*.6)+
((d.spatial_sense()-1000)*1.2)+
((d.kinesthetic_sense()-1000)*.6)
((d.focus()-1000)*1)
)/8)>101
Update:
A note on average discrepencies. You can run a function that does the averages of all attributes of your dwarves at any given time, and calculates min/max's, and averages the range from the average. Then use this for the formula's. This creates a dynamic range of best available dwarves based on the makeup of your fortress. This is only recommended if min/max ranges as well as averages are unknown.
Update:
Using the crazy convoluted weighted system (but everything described above), I came up with a close combat formula that takes into account the rage trait, as well as the perseverance trait.
((
((d.strength()-1250)*1.2)+
((d.agility()-900)*1.2)+
((d.toughness()-1250)*1.3)+
((d.endurance()-1000))+
((d.recuperation()-1000)*.8)+
((d.disease_resistance()-1000)*.8)+
((d.willpower()-1000)*.7)+
((d.spatial_sense()-1000)*1.1)+
((d.kinesthetic_sense()-1000)*.9)+
((d.focus()-1000)*.8)+
((d.trait(1)-50)*17.6*1.1)+
((d.trait(28)-50)*17.6*1.1)
)/12)>110
Update:
Thanks for the info on the if/else stuff, I implemented it (shouldn't care if a close combat dwarf has below average rage, but it should be beneficial
if ((d.trait(1)-50)<0)
{
d.can_set_labors() &&
((
((d.strength()-1250)*1.2)+
((d.agility()-900)*1.2)+
((d.toughness()-1250)*1.3)+
((d.endurance()-1000))+
((d.recuperation()-1000)*.8)+
((d.disease_resistance()-1000)*.8)+
((d.willpower()-1000)*.7)+
((d.spatial_sense()-1000)*1.1)+
((d.kinesthetic_sense()-1000)*.9)+
((d.focus()-1000)*.8)+
((d.trait(28)-50)*17.6*1.1)
)/11)>110
}
else
{
d.can_set_labors() &&
((
((d.strength()-1250)*1.2)+
((d.agility()-900)*1.2)+
((d.toughness()-1250)*1.3)+
((d.endurance()-1000))+
((d.recuperation()-1000)*.8)+
((d.disease_resistance()-1000)*.8)+
((d.willpower()-1000)*.7)+
((d.spatial_sense()-1000)*1.1)+
((d.kinesthetic_sense()-1000)*.9)+
((d.focus()-1000)*.8)+
((d.trait(1)-50)*17.6*1.1)+
((d.trait(28)-50)*17.6*1.1)
)/12)>110
}
}