Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 184 185 [186] 187 188 ... 192

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

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2775 on: January 28, 2013, 08:25:00 pm »

minor feature request

when I apply a custom profession

it renames my dwarf's description to the custom profession.

I don't care for that, especially with the labor optimizer and then trying to set a default hauler at the end.

Itnetlolor

  • Bay Watcher
    • View Profile
    • Steam ID
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2776 on: January 28, 2013, 09:39:47 pm »

Just a small question:
Has anyone made a pre-set list of filter scripts, roles, and optimizers (like a packaged file of them, or a sort of plugin pack)?

I already crafted a few of my own, like filters to find out dwarves that are more/less than 50 happiness, Dwarves with no employment whatsoever (or cleared, and forgot to assign), and a few others. However, with the optimizer and roles, I don't have all that much pre-set; or at least, I'm not clear on how the optimizer optimizes (and how it ties in with the roles and whatnot). I test-optimized, and it pretty much auto-assigned my entire fort into hauling duties.

I wasn't sure if the optimizer auto-assigned dwarves to what they're best suited for or not, or what kind of parameters I needed to set to make it work properly, though the profiles of the dwarves stated such.
« Last Edit: January 28, 2013, 09:42:02 pm by Itnetlolor »
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2777 on: January 29, 2013, 04:06:08 am »

Just a small question:
Has anyone made a pre-set list of filter scripts, roles, and optimizers (like a packaged file of them, or a sort of plugin pack)?

I already crafted a few of my own, like filters to find out dwarves that are more/less than 50 happiness, Dwarves with no employment whatsoever (or cleared, and forgot to assign), and a few others. However, with the optimizer and roles, I don't have all that much pre-set; or at least, I'm not clear on how the optimizer optimizes (and how it ties in with the roles and whatnot). I test-optimized, and it pretty much auto-assigned my entire fort into hauling duties.

I wasn't sure if the optimizer auto-assigned dwarves to what they're best suited for or not, or what kind of parameters I needed to set to make it work properly, though the profiles of the dwarves stated such.

I haven't had much luck figuring out the haulers and I use a custom profession to assign hauler's afterwards.
Max Jobs per dwarf to something like 12 to 20 (I recommend 12 due to rusting of skills)
Auto-assign labors sets any dwarf that doesn't meet % of labors assigned.
Example, at 12 labors per dwarf, and 50% auto assign haulers.
anyone who has 6 labors or less will become a hauler.
Lastly.
percent total jobs.  Set this somewhere between 50 to 75% (or whatever you want), and it will assign more labors to dwarfs.  100% means every dwarf will have 12 labors (if you have 12 Max Jobs Per Dwarf)

I have a ton of scripts btw.
these are the ones I mainly use from my %appdata%\udp software\dwarf therapist.ini file
Spoiler (click to show/hide)
« Last Edit: January 29, 2013, 04:12:28 am by thistleknot »
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2778 on: January 29, 2013, 04:13:50 am »

Splinterz
an ability to choose what labors to assign to my haulers (i.e. from the labor optimizer editor). Maybe allow a user to define a custom profession to apply for the hauling?

also an ability to assign everyone to hauling (I tried to set it to both my jobs to assign and haulers to 100% and it assigned 2 out of 13 dwarfs, weird). 

for example:
my haulers I like to also assign feed patients/prisoners
push/haul vehicles
and architect
« Last Edit: January 29, 2013, 04:46:14 am by thistleknot »
Logged

Maklak

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

Tthistleknot, is there a way for you to get the starting attribute for current dwarf? If there isn't then all you have is the current value. Another problem is that some attributes train fast (for military), some slowly and some are only supposed to rust (musicality), except in the mod I play, there are concerts that boost attributes for a while. Another possible problem is that some syndromes can temporarily change attributes. Or even change them for good, if you mod in something like a potion of +200 strength [CE_PHYS_ATT_CHANGE:STRENGTH:100:200:START:0].

If you can get the current value and the cap on an attribute and really want to, you can use something similar to sim1.
Code: [Select]
input: int att, int att_cap;  // Current attribute value and cap.
int att_sim = 2000; // Or whatever you think is prudent.
int max_delta = (att_cap -att) > att_sim? att_sim : (att_cap -att); // min {att_sim, att_cap -att}
double ret = ((att + att + max_delta) * max_delta) / 2.0;   //  Or  att * max_delta + (max_delta * max_delta) / 2.0
// if (max_delta != att_sim)
  ret += (att_sim - max_delta) * att_cap;
ret /= att_sim;   // Ret is now the average value for this attribute when you gain 2000 times in it and cap at some point.
return ret;

That said, I've never seen a dwarf stop gaining a physical attribute from military training, the gains are rather slow anyway and for this reason I care about the current value more than about the hypothetical maximum.

> filters to find out dwarves that are more/less than 50 happiness
Sort by happiness in DT, then check the unhappy ones in-game.

> Dwarves with no employment whatsoever (or cleared, and forgot to assign)
I think there was an option to sort by the number of assigned labours, but this includes hauling of course. Military dwarves will deselect all their civilian labours repeatedly after getting to 11 weapon skill, so for now there is nothing to be done here. Someone's hypothesis is that this is a leftover from 40d that should be removed to allow for civilian defence programs, but there was no definitive answer on the mantis. 

I assign labours manually in the grid view. I usually want 2 or 3 for each quality improving labour (crafting, farming, etc.), a few miners, a few woodcutters and a few extra masons who are locked out of workshops by setting profiles to high skill only. The rest get assigned to hauling, butchering, threshing, glazing and so on as generalists. I don't trust auto-optimizers. Besides, they usually say that my best military is also very good at everything else, due to their high agility. Yes, you can base the selection on attributes and "Likes steel and helmets" and get a quality boost in the end, but for me the most practical method of choosing professionals is estimating how fast they'll get to Legendary+5. Because even with different attributes, with maxed out skill, they will work blazing fast, make about 25-30% masterworks, lots of exceptional items and items 1-5% worse than that, which to me is both acceptable and not worth the trouble of factoring in attributes and personality. 
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

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2780 on: January 29, 2013, 04:45:33 am »

Tthistleknot, is there a way for you to get the starting attribute for current dwarf?
yes.  splinterz has it in his latest beta.

THANK YOU FOR THE FORMULA.  What does 2000 represent?  I see you stated, when you gain 2000 times in it... so each dwarf is different (basically they can double their initial value).  I'll have to read into your code a bit.

PM me if you want the beta, I'll be up for prolly another hour.

concerning attribute rust, q had this to say
Spoiler (click to show/hide)
« Last Edit: January 29, 2013, 05:21:25 am by thistleknot »
Logged

splinterz

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

@Itnetlolor: i'd like to include more defaults, but what i may end up doing is just putting some examples into the documentation when i get around to it. that said if you (or anyone else) has scripts/roles/optimization plans they'd like to contribute, by all means send them my way.

@thistleknot: custom professions are intended to override the dwarf's profession. it sounds like you're using it as a work around for another problem. what's the actual issue? push/haul vehicles is already marked as a hauling labor. the only different hauling labor from DF is cleaning. feed/recover patients i disagree on, as i like to have dedicated nurses for that, same for architects. i'd rather keep the hauling similar to what's in the hauling labor category in game. the current beta also doesn't get the starting attribute values, although it can be calculated.

@Maklak: thanks for the additional work with attributes. i've been working on getting happiness thoughts into the next version. the scripting can accomplish most of what you want. you can check the raw happiness level with d.get_raw_happiness() < X for example. the scripts can also get a count of the total assigned labors, i'm going to modify this so you can exclude hauling. you could then create a filter script that shows all non-squad dwarfs with x total assigned labors: d.total_assigned_labors(false) <= 1 && d.squad_id() < 0

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2782 on: January 29, 2013, 04:53:27 pm »

I think I worked up your program

Spoiler (click to show/hide)

I was talking with splinterz, I was thinking of putting it into the frequency bin formula's we have setup. 

I'm not sure what 2000 is for, so instead I set it to what a dwarf can possibly gain, his max - initial

I made a sim2 that replaces 2000 with max - current.

let me know if I fucked it up
Spoiler (click to show/hide)

example:
attributes.exe <input.txt >output.csv

input.txt formatted as such
current initial
sets att_cap to initial x 2, caps at 5000

here's some #'s (no sim2 in this set)
Spoiler (click to show/hide)

I tried 50 25 50 (which is 50 current, 25 initial, 50 max), which reads 50.
I also tried this with the arbitrary 2000 number, reports the same 50.

So the results will output a value less than max, but greater than current.

errors on 2500 5000 as input values...

now the million dollar question is, how do we calculate rust into all these formula's?  subtract rust from current value obviously, but also maximum value?

according to splinterz, rust isn't permanent on attributes.

new million dollar question
what about modifying the above formula for attribute rate gain?  Some mods have the ability to increase attributes at a faster rate.
« Last Edit: January 29, 2013, 07:50:52 pm by thistleknot »
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2783 on: January 29, 2013, 09:53:50 pm »

Maklak:
I read your post about auto optimizer's.

I felt the same way about autolabor via dfhack (which matches your skill concerns exactly, but I didn't like the fact it didn't figure in attributes, and traits).

Anyways.  If DT could auto-optimize in a way that you would like, how would it go about it?  I mean if we're hitting on the skill thing you want, then can't you just weights skills the most important and then auto-optimize?

You said something about assigning the undesirable effect of militia dwarf's being assigned to labors?  Couldn't you use assign

militia first
nobles second? (filter out militia)
laborers last? (filter out nobles)

that's how I handle it.

I hope the labor optimizer can be used for everyone.  The limit I see with it right now is # of labor's per dwarf (but there is a workaround, using the highlighted dwarf's and changing the # in the labor plan).
« Last Edit: January 29, 2013, 10:01:01 pm by thistleknot »
Logged

Maklak

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

Damn it, the browser hanged on me when I was writing... again.  >:(

> I was talking with splinterz, I was thinking of putting it into the frequency bin formula's we have setup.
The bin method and simulation method are different and don't mix. The bin method is about what you can get from migrants. The simulation method is about what you can can do with what you have now.

> I'm not sure what 2000 is for, so instead I set it to what a dwarf can possibly gain, his max - initial
It is an arbitrary number of attribute points to gain. It must be the same for all dwarves for the simulation method to work properly. The only reason I can think of that you would set this to something dependant on att and initial is that you don't understand these lines, because they take care of capping the attribute already. 
int max_delta = ...
ret += (att_sim - max_delta) * att_cap;
2000 is pretty high, actually. Only the military has a hope of gaining this much and only in some attributes.

> I made a sim2 that replaces 2000 with max - current.
This won't fix it. It will only reverse a small anomally, depending if att or initial is bigger, because depending on that you cap out and "ret += (att_sim - max_delta) * att_cap;" kicks in.

> let me know if I fucked it up
Yes. I explained it above. With different numbers of attribute points gained by different dwarves, this method no longer works properly.

This is what I would do:
Code: [Select]
int sim3 (int att, int initial)
{   int att_cap = initial * 2;  // Actually: int att_cap = initial + ((initial > median) ? initial : median);
    att_cap = (att_cap > 5000) ? (5000) : (att_cap);  //caps at 5000
   
    // If att > att_cap, there can be no gain, except by interactions.
    if (att > att_cap)
       return att;     
   
    int att_sim = 2000; // Or whatever you think is prudent. This is where you can factor in attribute rates.
    int max_delta = (att_cap -att) > att_sim? att_sim : (att_cap -att); // min {att_sim, att_cap -att}
    long long ret = ((att + att + max_delta) * max_delta) / 2;   //  Or  att * max_delta + (max_delta * max_delta) / 2
    ret += (att_sim - max_delta) * att_cap;
    ret /= att_sim;   // Ret is now the average value for this attribute when you gain 2000 times in it and cap at some point.
    return (int)ret;
}

> errors on 2500 5000 as input values...
int att_sim = att_cap - initial; //  = 5000 - 5000 and later causes division by 0.

> new million dollar question
You lie. I won't get a million dollars for answering this.

> what about modifying the above formula for attribute rate gain?
Simple, if you know how those work. "int att_sim = 2000;" Modify 2000 by the gain rate, similar to sim1 for skills. You want to use the first number, the "cost to improve". I think it should be "att_sim = att_sim * 500.0 / CTI;" assuming the lower cost the better.

> Anyways.  If DT could auto-optimize in a way that you would like, how would it go about it?
* Highlight labours with no assigned dwarves in the grid view. (Or fewer than a set number)
* Let me sort dwarves by suitability for a labour, so I can manually pick however many I want.
* Have an option to quickly select multiple labours for a single dwarf. I think this is possible now, but I haven't figured it out.
In other words, I prefer to do this manually, just have a few shortcuts.

> I mean if we're hitting on the skill thing you want, then can't you just weights skills the most important and then auto-optimize?
If sim1 is going to be there with a settable weight, I can sort by mostly it, yes.

> You said something about assigning the undesirable effect of militia dwarf's being assigned to labors?
If I have a DT option to filter out military (all of them, not just the ones currently on duty), then I can manage. Nobles are less important, because I only have a few of them, overlap their responsibilities (manager + record keeper) and can remember or rename them.
I don't mind the military as haulers, butchers and so on, but I don't want them to do any of the important jobs, unless they mood out.
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

arclance

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2785 on: January 30, 2013, 10:41:32 am »

> You said something about assigning the undesirable effect of militia dwarf's being assigned to labors?
If I have a DT option to filter out military (all of them, not just the ones currently on duty), then I can manage. Nobles are less important, because I only have a few of them, overlap their responsibilities (manager + record keeper) and can remember or rename them.
I don't mind the military as haulers, butchers and so on, but I don't want them to do any of the important jobs, unless they mood out.
You can sort by squad and you will get a list of every dwarf not in the military first followed by the rest grouped into their squads active or not.
This won't work if you use squads to assign uniforms to civilians but I don't think there is any way around that.
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

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2786 on: January 30, 2013, 11:31:40 am »

update:
since someone corrected me

squad _id()>0 is military
d.squad_id() > 0 is military (sorry for forgetting the d, I didn't have a copy of dt in front of me to verify, I figured someone with a brain would figure it out if viewing the script editor and if they were slightly familiar with syntax of dt scripts)
the opposite are non military.


Non military
d.squad_id()<0

Not noble
!d.noble_position()


there's also a noble_id() d.noble_id() I believe.
<0 is non nobles

btw. these r also built into the labor optimizer editor

if u highlight one dwarf and run an optimizer on him. it will assign the best labors that fit in the optimization plan up to the max number of labors per dwarf you have set.

and yes, latest beta has your sim1 formula in there, you can weight it to 100% and it will completely disable current skill level and just use your sim1 method :)
« Last Edit: January 31, 2013, 11:00:13 pm by thistleknot »
Logged

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2787 on: January 30, 2013, 02:47:09 pm »

squad _id()>0 is military
the opposite r civvies
theres also a noble_id()
unfortunately, these are all incorrect. check my post above for the proper syntax.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2788 on: January 30, 2013, 08:33:17 pm »

Maklak:
Okay, I tried again.  This time I didn't fuck with it the way I did last time, I changed 2000 to 5000 (since skills based sim_xp on 29k, I figured why not base attributes on 5k).
Changing the number to a higher number seems to lower the increase(seems to be lower numbers do this), which fits the concept of trying to keep these numbers not jumping too high due to the fact that attributes don't train as fast as skills (albeit the new rate concept...)

an att_sim value of 100 seemed to produce good numbers.  Now I'm concerned about skills using 29000 for there sim value... oh well, as long as a weight is introduced, players can mess with this as much as they want.
Although I like 100 as an att_sim value, setting the att_sim to this number, and then setting weights that combines current attribute % with sim3, means the cieling of sim3 results will be that much shorter when using 100, so I recommend a high value, like 5000, and a player can then adjust the weights between attribute/sim3.

Spoiler (click to show/hide)

I modified your formula for CTI, but it comes out the same
att_sim = (att_sim / 100.0) * CTI; (which is how sim1 looked).


You said
Quote
> what about modifying the above formula for attribute rate gain?
Simple, if you know how those work. "int att_sim = 2000;" Modify 2000 by the gain rate, similar to sim1 for skills. You want to use the first number, the "cost to improve". I think it should be "att_sim = att_sim * 500.0 / CTI;" assuming the lower cost the better.

I think when you say "lower cost the better" you mean  cost to improve attributes, such as 1:1 vs 5:1, which confuses me why we're dividing by 100 then multiplying.  Say my rate is 500%, so if the att_sim is 5000, shouldn't it be 5000/5 (i.e. 500%) but we're doing 5000 / 100 (to normalize 100% to 1) then MULTIPLYING by rate... therefore increasing sim.

Maybe a large sim is good in this case?

Update:
Well testing these three
Code: [Select]
    att_sim = (att_sim / 100.0) * CTI;
    //att_sim = att_sim / (CTI/100);
    //att_sim = att_sim * 500.0 / CTI;
the uncommented one went higher with higher skill rates, which is exactly what you had typed.

So I guess larger att_sim is better (for the dwarf)

thanks for this clarification
Quote
// Actually: int att_cap = initial /+ ((initial > median) ? initial : median);
Splinterz was saying something about something that looked similar.

we're probably going to have to generate that based on the raws.  It might be really easy just to take the middle frequency bins (i.e. 3rd+4th value /2 to get the median, otherwise it'll require factoring each middle range x 1/6 and sum them up.)  See, I can do a lil math. ;)

reference for finding mean based on frequency distributions
example
200:700:900:1000:1100:1300:2000
midpoints
450:800:950:1050:1200:1650
x (1/6)
75:133.33:158.33:175:200:275
Sum
1016.66

verified

Update:
I guess that finds the mean, not the median, but eh.  Such a small difference in numbers to be concerned with.  I'm sure the mean is probably what was meant by whoever realized the formula, because I doubt the median is hard coded into ram, and finding the median via a frequency distribution, I'm not sure how it would be done.
I figured how to find the median from watching this video
start at 4:20 (hehe)
however, it describes adding up the frequency's of each category, how do we do that since the frequencies are 1/6 for each bin?
Well, I was going to use an arbitrary number (like 600), but I came up with a better idea (one might be able to do it with 600, IDK).  I took the largest # in the bin, and the lowest number.  Example
150:600:800:900:1000:1100:1500
1500-150=1350
1350/2 = 675
so the 675 value is the median
you can't just take 150+675 though
so if there's 1350 values per bin


well, I just realized something.
The median is the 4th value in the raw's, everytimeThis is only because each bin has exactly 1/6 chance of occuring, so the median is the 3/6 value, which is the 4th bin value
I was going to say to count up to 6/2 = 3, 3rd value in the frequency bin, but then I realized the simplicity of it all.
« Last Edit: January 30, 2013, 10:41:13 pm by thistleknot »
Logged

hops

  • Bay Watcher
  • Secretary of Antifa
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2789 on: January 31, 2013, 02:29:20 am »

Is there any way to use this with 0.34.11?

Never mind. I found out how.
« Last Edit: January 31, 2013, 02:33:39 am by Objective »
Logged
she/her. (Pronouns vary over time.) The artist formerly known as Objective/Cinder.

One True Polycule with flame99 <3

Avatar by makowka
Pages: 1 ... 184 185 [186] 187 188 ... 192