Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 148 149 [150] 151 152 ... 192

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

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2235 on: June 14, 2012, 03:51:51 am »

I just came up with a very quick and easy way to efficiently assign a fortress to labors without the need for all this extra coding. I may have to explain in more detail later, but it now involves only 3 variables.

Desired coverage of job (i.e. how many dwarf's available at any given time do you want to be able to do it).

How many labor's do you want to assign per dwarf (doesn't really matter, but values from 5 to 10 are good).

Coverage / (1/labor's per dwarf) = # dwarf's to assign to each role

sort your role's out from most important to least important

then start assigning that # to each role until you hit the # of dwarf's per labor, and ensure you don't exceed that number for each dwarf...

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2236 on: June 14, 2012, 12:12:44 pm »

Thanks to Splinterz for showing me the function!

This is how it works
  1.  You have to create a ranked list of labors where the 1st item is the highest priority of assigning high % dwarf's to, and the last is least priority.
  Example: at the top of mine, I had miner's, farmer's, at the top, and I had shearer's and milker's at the bottom.

  2.  Coverage: Then you need to decide how much coverage you want per labor.  For example, do I want 2 miner's available at all times?  Well, then I set coverage to 2.  Coverage determines the # of dwarf's to assign to that labor...  coverage / (1/number of dwarfs per labor (step3) can't be larger than population).
 
  3.  Labors Per Dwarf:  Then you decide how many labor's you want per dwarf.   I recommend a low # of labor's per dwarf for small populations, and more? for large populations.  I have 100 population, so I set my labors to 10 each. Labors per dwarf has to be less than the highest value derived in step 3a
  3a.  Dwarfs Per Labor: Each labor has it's own # of dwarf's to assign:  Calculate by taking the labor's coverage / (1/# of labors per dwarf).  For maximum efficiency I recommend multiplying (and rounding) this number by population/(sum of coverages), sum of the rounded numbers should equal: population * labor's per dwarf.
  Example: 2 coverage for mining, at 10 labors for each dwarf.  Is 20 dwarf's for mining.

  4.  Now you unassign everyone's labor (create a custom profession that you want to use a base labor set, for example, mine included all hauling jobs, recovering wounded, burying, architecture, etc.).  Apply this custom profession to everyone...

  5.  Now see how many labors are assigned to each dwarf by sorting by total labor's assigned (use the filter drop down).  This is your base #.  Important for next step.  Unapply sort.

  6.  Now take the # of labors you wish to assign to each dwarf established in step 3 and add this to the number you got in step 5.

  7.  Apply this filter script (save it too!) d.total_assigned_labors()<# derived in step 6.

  8.  Now sort each labor by % highest to lowest.  Start assigning the # of dwarf's established in step 3a.

Special note:
  Nobles, militia: you can assign militia at the end (and unassign labors, or... you can assign them first and just exclude them by name in your filter script...
  Same with nobles.  I personally selected my nobles at the end by sorting by # of labors, and picking a low # of labor dwarf with a good fit for a noble position to fill that position, therefore preserving my super dwarf's (i.e. a good % fit for a lot of roles) who had a lot of labors assigned to keep doing there super dwarf labors.
  There's an optional way of handling militia as well as Nobles.  You can assign them a cost.  For example, a manager you can safely assume is a cost of 1 (100% of their time is consumed doing work).  This cost kind of equals coverage.  All it means is you subtract 1 from the population in your calculations above... then you don't assign him to any other labors and everyone else is still assigned.
  You can kind of do this with the military as well if you have half active/half inactive like I do... You can then assign them a cost of .5, so they could still be assigned 1/2 of the labors per dwarf that the other dwarf's can have.  Originally I didn't want to say anything about this cuz it's confusing, but... in Splinterz version of DT, militia dwarf's are highlighted.  And if they are your highest priority to assign, you can keep an eye on them until they reach there 50% labor mark, and then add their names to the filter script to exclude them from future assignments!

  Custom Professions:  If you have custom professions, as I do with Nurses, craftsdwarfs, and metalsmiths.  Do not assign their custom profession during this process, if you do it will add say 5-6 labors at once, and you may only wish to count nursing as 1 labor for the purposes of the ranked labor list (step 1).  If you want to count nursing as 1 labor, assign just 1 labor in the meantime (example diagnosis) until you finish assigning everyone, then apply the custom profession that applies the 5-6 labors.

  Incompatible Labors:  This is important, these 3 are incompatible: Woodcutting, hunting, and mining.  When you get to these roles, you need to filter by the other incompatible labors by adding this to the filter script (step 7).  d.has_labor(00) for mining, or d.has_labor(44) for hunting.  So when you get to woodcutting, and you already have your miner's and ambusher's assigned, then you need to add to the filter script (!d.has_labor(00)) && (!d.has_labor(44)), this will filter out those dwarf's so you can assign the correct # of dwarf's without accidentally unassigning the incompatible labor dwarf's, be sure to remove that additional filter part when not needed

That's it.  With practice, you can efficiently assign your whole fortress in less than 5 minutes!  I was doing it (finally at the end) in 10 minutes after about 10 failed attempts without the d.total_assigned_labors()<# function, which was a pain, I was manually filtering by names that had exceeded the # of labor's assigned...

Here's a csv sheet of my stuff (without the military/noble stuff described above)
Code: [Select]
Population,,95,,,Dwarfs per labor,10,,Pop/Cov,1.210191083
Name,P Weight,Coverage,# of Dwarfs,x Pop/Cov,Labor,,,,
Miner,0.5625,2.5,25,30,Mining,,,,
Farmer,0.5625,2.5,25,30,Farming (fields),,,,
Metalsmith,0.523437,2.5,25,30,Custom Profession,,,,
Leatherworker,0.523437,2,20,24,Leatherworking,,,,
Bowyer,0.471094,2,20,24,Crossbow-making,,,,
Carpenter,0.46875,2,20,24,Carpentry,,,,
Mason,0.46875,2,20,24,Masonry,,,,
Brewer,0.46875,2,20,24,Brewing,,,,
Gem Cutter,0.468749,2,20,24,Gem cutting,,,,
Thresher,0.421875,2,20,24,Plant processing,,,,
Craftsdwarf,0.421874,2,20,24,Custom Profession,,,,
Mechanic,0.421874,3,30,36,Mechanics,,,,
Plant Gatherer,0.390625,4,40,48,Plant gathering,,,,
Cook,0.390624,2,20,24,Cooking,,,,
Engraver,0.375,3,30,36,Stone detailing,,,,
Ambusher,0.375,3,30,36,Hunting,,,,
Nurse,0.375,6,60,73,Custom Profession,,,,
Woodcutter,0.34375,2,20,24,Wood cutting,,,,
Trapper,0.328125,2.5,25,30,Trapping,,,,
Lyemaker,0.328125,2,20,24,Lye making,,,,
Fisherdwarf,0.312499,3,30,36,Fishing,,,,
Fish Cleaner,0.281249,2.5,25,30,Fish cleaning,,,,
Spinner,0.273437,2,20,24,Spinning,,,,
Butcher,0.25,3,30,36,Butchery,,,,
Tanner,0.234375,2.5,25,30,Tanning,,,,
Soaper,0.1875,2,20,24,Soap making,,,,
Cheesemaker,0.140624,2,20,24,Cheese making,,,,
Animal Caretaker,0,4,40,48,Animal care,,,,
Wood Burner,0,2.5,25,30,Wood burning,,,,
Milker,-0.000001,2,20,24,Milking,,,,
Shearer,-0.000001,2,20,24,Shearing,,,,
,Sum,78.5,,,,,,,
Need to apply custom professions last!,,,,,,,,,
« Last Edit: June 14, 2012, 08:15:36 pm by thistleknot »
Logged

plaidman

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2237 on: June 14, 2012, 04:17:10 pm »

Heh. You coulda just used mine from a few pages back in the thread. I promise yours won't warp your mac into another dimension, since they appear to be the same as mine :)

I got tired of waiting for the "official" OSX offsets, so I made an attempt to do them myself. Based on personal quick tests, these look to be working fine, but no guarantees this won't make your mac warp to another dimension.

Spoiler (click to show/hide)

Aww crap, I wish I would have seen that. Oh well, thanks for your work. At least now I know my numbers aren't bad!

TerryDactyl

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2238 on: June 15, 2012, 07:27:32 am »

I haven't been following this thread very closely, so my apologies if this is already known/addressed, or if there is a better place to report peculiar behaviours.

In splinterz' build, I've set up some custom roles. They don't appear on the 'roles tab', but they're coming up in the corner window. I copied the 'melee soldier' role, removed the 'rage' trait, and called it 'calm soldier'. Now the odd part: despite rage being unweighted, I have a dwarf with a 91.83 'calm soldier' rating, against a 31.76 'melee soldier' rating. His lack of rage dropped him a full 60 points! This does not seem like intended behaviour.

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2239 on: June 15, 2012, 08:57:39 am »

I haven't been following this thread very closely, so my apologies if this is already known/addressed, or if there is a better place to report peculiar behaviours.

In splinterz' build, I've set up some custom roles. They don't appear on the 'roles tab', but they're coming up in the corner window. I copied the 'melee soldier' role, removed the 'rage' trait, and called it 'calm soldier'. Now the odd part: despite rage being unweighted, I have a dwarf with a 91.83 'calm soldier' rating, against a 31.76 'melee soldier' rating. His lack of rage dropped him a full 60 points! This does not seem like intended behaviour.

you can override roles in the default role tab by adding a custom role with the same name. it will replace the default roles. what weights are you using for the roles, specifically the traits?

TerryDactyl

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2240 on: June 15, 2012, 09:28:46 am »

Melee soldier is the default role,
Calm soldier is the default melee role with rage removed.

Intrinsic

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2241 on: June 15, 2012, 10:38:46 am »

Icon issue: Milk Creature shows what looks like a Bow icon.
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2242 on: June 15, 2012, 11:11:15 am »

Melee soldier is the default role,
Calm soldier is the default melee role with rage removed.
i still don't know what weights you're using but try changing the global weight of the traits if you don't want them to affect ratings as much (options->roles tab). in your example, the lower you set the trait weight, the closer those two roles should come in ratings.

Icon issue: Milk Creature shows what looks like a Bow icon.
thanks, will be fixed in the next update.

TerryDactyl

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2243 on: June 15, 2012, 12:47:11 pm »

Default everything. Across the board.

Attributes:1, Skills:1, Traits:1. The melee soldier role, as well, has weight:1 set to everything.

Are attributes, skills and traits each being compared against each other as averaged sums, or are all such values being considered individually?

It seems like traits are being weighed against attributes and against skills. Since there is only 1 trait and 6 attributes, I think that means that every one of those attributes is being considered only 1/6th as valuable as that 1 trait. I have not performed maths to confirm this notion.

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2244 on: June 15, 2012, 01:39:01 pm »

Default everything. Across the board.

Attributes:1, Skills:1, Traits:1. The melee soldier role, as well, has weight:1 set to everything.

Are attributes, skills and traits each being compared against each other as averaged sums, or are all such values being considered individually?

It seems like traits are being weighed against attributes and against skills. Since there is only 1 trait and 6 attributes, I think that means that every one of those attributes is being considered only 1/6th as valuable as that 1 trait. I have not performed maths to confirm this notion.

it takes a weighted average of all attributes, all traits and all skills to get three total ratings. it then uses the global weights to take a weighted average of the 3 totals. finally it adjusts it with a cdf to acquire a rank relative to the population.

so in your example, the single trait is valued equally to all the attributes, and equally to any/all skills, as they're all set to 1.

Intrinsic

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2245 on: June 16, 2012, 02:51:17 am »

BUG: If an animal is set as "Available" to be tamed ingame and then you set it to butcher it in DT then it is already treated as owned and so when it dies it gets put in the corpse stockpile and then given a tomb...it works fine if you butcher it from ingame. I'm guessing there is a flag that isn't being cleared which makes it get treated this way.
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2246 on: June 16, 2012, 04:33:22 am »

BUG: If an animal is set as "Available" to be tamed ingame and then you set it to butcher it in DT then it is already treated as owned and so when it dies it gets put in the corpse stockpile and then given a tomb...it works fine if you butcher it from ingame. I'm guessing there is a flag that isn't being cleared which makes it get treated this way.

just to be sure, you mean 'Toggle pet availability' to available, and then slaughter?

Intrinsic

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2247 on: June 16, 2012, 05:24:25 am »

BUG: If an animal is set as "Available" to be tamed ingame and then you set it to butcher it in DT then it is already treated as owned and so when it dies it gets put in the corpse stockpile and then given a tomb...it works fine if you butcher it from ingame. I'm guessing there is a flag that isn't being cleared which makes it get treated this way.

just to be sure, you mean 'Toggle pet availability' to available, and then slaughter?

Yep on the Status->Animals screen.
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2248 on: June 16, 2012, 07:18:40 am »

BUG: If an animal is set as "Available" to be tamed ingame and then you set it to butcher it in DT then it is already treated as owned and so when it dies it gets put in the corpse stockpile and then given a tomb...it works fine if you butcher it from ingame. I'm guessing there is a flag that isn't being cleared which makes it get treated this way.

just to be sure, you mean 'Toggle pet availability' to available, and then slaughter?

Yep on the Status->Animals screen.

bah. i'm not sure what's going on then. i did some comparisons of the 'ready to slaughter' flag, setting it from DF and then from DT and it was identical. there must be something else happening  :-\

just to make certain i'm following your actions: set animal to available, then set to slaughter in DT results in corpse stockpile->tomb right?

Shishimaru

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2249 on: June 16, 2012, 08:47:12 am »

When you set an animal as available DF adds a pointer to the unit.specific_refs vector.
The specific_ref is of type 7 (PETINFO_PET)

I don't think there is a way to change this through DT, but you can check this reference to disable "set to slaughter" if the pet is available
Logged
Pages: 1 ... 148 149 [150] 151 152 ... 192