Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 171 172 [173] 174 175 ... 192

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

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2580 on: November 22, 2012, 12:56:18 am »

I'd probably have a lot more updates if I was single... or at least without kids...

anyways...

Splinterz has seen my code, and is appalled (implementation, not concept) by most of it, but that's ok.   I don't do it for a living, only aspire to... right now it's a hobby/interest (which is a shame, because so many of my friends, at least 2, who didn't know shit about computers before joining the Corps are making 150k each... yet, I was the computer guy in High School)...  I know networking, but that's not what I want to do.

Wow, soapbox...

anyways, I'm thinking of updating the code to actually include the spreadsheet...

I'll still have to rely on a .csv input sheet... but I intend on eventually using a form for input variables (vs a csv sheet), and the input variables will be: role name, labor id, priority weight (which will simply be an input number specified by the user, probably simply values of 1 to .25), and a value that is proportionate to the rest of the values (or a straight %) problem is with c++... rounding (excel has nicer rounding features), which will be used to calculate matching % of the total jobs to assign

lastly a
%jobs
%jobs will be a % of...

total jobs

will be based on
jobs per dwarf
*
number of dwarfs

Update
...and done (source only)...
will send a new video and stuff possible this eve or tomorrow morning.

http://www.mediafire.com/?x21b1g4ey8xh5nv

what this does is essentially prevent one from having to use a new file as the population is changed.
« Last Edit: November 22, 2012, 05:04:29 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 #2581 on: November 23, 2012, 02:25:47 pm »

here's the updated .zip

http://www.mediafire.com/?13v28jjdbhw1ph4

Instructions are inside

took me about 5 minutes to assign everyone. I used the military.csv to assign melee to Wax working ranged to architect then I cleared all current military ingame used the right click option in DT to assign to Squads

then I excluded militia using filter scripts. then I assigned my new_roles.csv to the rest at .7 then I did nobles by sorting by total_assigned_labors then I did haulers to those not nobles and less than 4 labors :)
« Last Edit: November 23, 2012, 02:28:21 pm by thistleknot »
Logged

dnatabar

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2582 on: November 24, 2012, 04:00:16 am »

That looks highly interesting :3

I'l certainly try it out later today ^_^
Logged

thistleknot

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

here's another updated version that checks if miner, hunter, woodcutter would exceed population counts, and to adjust the ratio accordingly.

I would say my spreadsheet is now obsolete :)

it served it's purpose well though

http://www.mediafire.com/?tksyzvgpkkkjlzm

Updated:
This is some really nifty if statements... there's 3 conditions it has to check for.

Code: [Select]
            if ( (MHWExceed) && ((labor == 0) || (labor == 10) || (labor == 44)))
            {
                //truncate miner, hunter, woodcutter to population size
                pre_number_to_assign = ListOfRolesV[x].coverage / MHWCoverage * m_selected_dwarfs.size();
            }
                else if (MHWExceed)
                {
                    //since miner, hunter, woodcutter are being truncated down to population size, we need to remove that from the jobs to assign
                    pre_number_to_assign = ListOfRolesV[x].coverage / modifiedTotalCoverage * (jobs_to_assign - m_selected_dwarfs.size());
                }
            else
            {
                //normal
                pre_number_to_assign = (ListOfRolesV[x].coverage / modifiedTotalCoverage) * jobs_to_assign;
            }

Basically some if checks for what my spreadsheet did to keep miner's, hunter's, and woodcutter's below population size...

Now it matches what I had for my spreadsheet (more so than it did before, I noticed some numbers were off)

ALSO, VERY IMPORTANT...

Since Splinterz version was using a CDF function to scale the %'s to the other values in a given role, that meant that comparing roles against each other using the %'s values was BAD!  So... I removed it from my calculations for optimizations and used raw non CDF values... (CDF, cumulative distribution function, was used to make nice scaling ranges from 0 to 100% and to show who was good/bad in a given population for given task)


http://www.mediafire.com/?spqagsksyskxdda

Updated again to include raw role rating in dwarf details pane right next to the cdf rating, so you guys can see what I'm talking about...
http://www.mediafire.com/?nrzyv3njp06f0zs

fixed a spelling, should have been reading how many labors per dwarf, not how many dwarfs per labor...
http://www.mediafire.com/?ni1ptuuvzh5h01c

one more change... added tooltip for raw role rating in custom roles now...
http://www.mediafire.com/?fppcm82nt52blcp
« Last Edit: November 25, 2012, 01:40:48 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 #2584 on: November 26, 2012, 07:44:51 pm »

splinterz just coded up his beta...

messed with a lil, still prefer mine due to some rounding issues and the miner, woodcutter, hunter...

but!  it works just like mine AND BETTER...

can't wait to see those few items tweaked, but one can always rely on him to make shit look professional!

Nostril actor

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2585 on: November 26, 2012, 08:08:52 pm »

So despite it looking like maybe in the near future I won't need to organize my dwarves myself (although this might be a bit undwarfy), I downloaded splinterz's most recent build and I'm really missing the sort by profession option. I've sorted my dwarves by profession for a while now and am wondering if there's is any way for me to somehow add it in myself, or if doing something like that would be very complicated, perhaps the feature could be readded to the new build?
Logged
"Let me out! Let me out! Let me out!"
"Stay in there 'til ye rot, vampire scum!"
"Let me- Asvirgrail, Asvirgrail, Asvrigrail...! I NEED STONE! I NEED METAL! I NEED SHELLS!"
"Wait, what? 'Asvirgrail?' Ye mean ye've got a plan?! Well why didn't ye say so! Quick now, gimme the keys! HEAR THAT LADS, VAMPIRE'S GOT A PLAN!"
"A plan you say?! 'a's wonderful! Let 'im out, gotta see what 'e's gonna make!"

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2586 on: November 27, 2012, 04:57:22 pm »

So despite it looking like maybe in the near future I won't need to organize my dwarves myself (although this might be a bit undwarfy), I downloaded splinterz's most recent build and I'm really missing the sort by profession option. I've sorted my dwarves by profession for a while now and am wondering if there's is any way for me to somehow add it in myself, or if doing something like that would be very complicated, perhaps the feature could be readded to the new build?

is this when you've got them grouped by profession and you try to sort the first column?

Nostril actor

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2587 on: November 27, 2012, 07:40:39 pm »

I found it, seems I've just been a bit dumb and overlooked it. Thanks anyway!
Logged
"Let me out! Let me out! Let me out!"
"Stay in there 'til ye rot, vampire scum!"
"Let me- Asvirgrail, Asvirgrail, Asvrigrail...! I NEED STONE! I NEED METAL! I NEED SHELLS!"
"Wait, what? 'Asvirgrail?' Ye mean ye've got a plan?! Well why didn't ye say so! Quick now, gimme the keys! HEAR THAT LADS, VAMPIRE'S GOT A PLAN!"
"A plan you say?! 'a's wonderful! Let 'im out, gotta see what 'e's gonna make!"

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2588 on: November 27, 2012, 10:22:50 pm »

just looked at splinterz new beta, and it's looking great!

his numbers are a little different then mine, but only on labors that were low priority  (and were coincidentally low skilled, such as shearer, spinner, i.e. I don't have many dwarf's with any skill in it, so I think he's doing some weird back end optimization on dwarf's with same role ratings on those labors, WHICH IS GREAT!!!, WHICH I had no suggestions really on how to do that other than pick dwarf's that were already assigned up with labors to take those on).

all the numbers were spot on though, I spent a lot of time to ensure maximum assignment, and I'm glad to see it was implemented correctly... not saying there can't be room for improvement, but the initial beta had lower #'s...

so moving in the right direction.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2589 on: November 29, 2012, 09:41:08 am »

i had an idea for how to calculate preferences into role calculations... so now the optimizer versions gonna be delayed a bit pending splinterz mastermind working on adding preference calculations.

hehe. i had an idea to group the preferences into their sub categories such as material or item.

splinterz says its a lot of work for such a small addition of happy thoughts.

something beneficial will result though

Update:
Okay, Splinterz and I came up with a great easy way to do this that allows for accurate results.

A preference ratio system that converts to a %.

Example:

Palm: 2
Beds: 1
Chairs: 1

If a Dwarf has a preference of Palm wood, then he has 2 / (2 + 1 + 1) = 50% rating for preferences.

The above example gives a 1:1 ratio of material:item types.

I guess I'll use a / for annotating type differences...

if I wanted to add more tree types and keep the ratio intact, I would merely do this
Cedar: 1 Palm: 1 / Beds: 1 Chairs: 1

So if I had another item type I'd like to add...

Cedar: 1.5 Palm: 1.5 / Beds: 1 Chairs: 1 Doors: 1

so now I have a 3 / 3 (i.e material/item) type ratio.

If I wanted to increase the weight of the materials, I could get a 2 / 1 ratio by doing the following

Cedar: 3 Palm: 3 / Beds: 1 Chairs: 1 Doors: 1

The resulting matches will be added together, and divided by the sum of all possible (above example for Cedar would be 3 / (3 + 3 + 1 + 1 + 1) = 33%

will be added into the rest of the categories (attributes, skills, traits), average will be reported to Dwarf Therapist

UPDATE:

on second thought, this awesome idea might not work out so well.

It will always produce in lower % for the preference rating for roles that have a complete listing of all items and materials... which means no direct comparison between roles that do not have preferences holding them back.

So... instead Splinterz is thinking it's best to just add a small # to the current raw % if a preference is found, which is not statistical at all, but it's the only good idea we can think of.

Update:

not sure what direction Splinterz is working on, but I had this discussion with him. (paraphrased to another person)

we're thinking of a diminishing return straight additive bonus.

it's kind of complicated, but works like my bud said, first is 5%, second preference is 7.5%, 3rd is 8.75%

however, each diminishing return can have a different value, default is half the original if the value set by user is 1, but the user can set different values...

so yeah, kind of hard to explain.

The logic though is that multiple preferences affecting a role only really make a dwarf happy to do that job, and have a chance at producing masterwork items.

producing masterwork is a skill ability, so should it outweigh skills?  A high skill in carpentry will always produce masterwork items.

happiness is also contributed by traits (such as patience).

So... preferences are a two for one deal, but not as powerful as the quantifiable statistics like traits, and skills.
« Last Edit: November 30, 2012, 07:38:34 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 #2590 on: December 01, 2012, 07:33:26 am »

another new version with some tweaks and the all new labor optimizer.

  • new labor optimization feature (optimization algorithm courtesy of Thistleknot)
  • added search box to preference window
  • new file menu action to export the current view to csv (Shishimaru)
  • added new action to the grid context menu to clear the labors of currently selected dwarves
  • added a selection count in the bottom status bar
  • the preference dock now distinguishes between preferences of the same name, but different categories (i.e. Brass as a color and a material)
  • clearing pending changes now updates column headers appropriately
  • exiting custom role editing by clicking on the window's X no longer removes the role from the list
  • sorting first column when grouped by profession works properly now


Project Home // Download

hopefully all the tooltips and status messages on the labor optimization planner are sufficient to get an idea on how to use the tool. as always feedback is encouraged!

please report any bug reports and i'll fix things up asap.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2591 on: December 01, 2012, 11:20:33 pm »

the big x button should clear the preferences filter

otherwise I have to open preferences and clear it from within preferences

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2592 on: December 02, 2012, 06:29:24 pm »

Branched version of Dwarf Therapist for Dwarf Fortress 34.07-34.11.

Version 18.1 Change Log

    bug fixes for optimization
    fix for 'wood' showing up in english for other translations of the game

DOWNLOAD - Rapidshare
DOWNLOAD - Mediafire
DOWNLOAD - DFFD

Project Home // Download
« Last Edit: December 02, 2012, 06:40:56 pm by thistleknot »
Logged

Nkosi_SW

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2593 on: December 19, 2012, 02:18:48 pm »

Looks like great work guys.  The optimizer is impressive - can't wait to start using it.  Thanks heaps!   :)

Minor bug report: The dwarven caravan members are now showing up in DT when they visit to trade.  I have 190 dwarves in my fort.  The caravan has just arrived, and now I'm showing 204 in DT (an extra seven guards and seven merchants are fully listed).

I have a save if you want it, but I guess it can be replicated pretty easily.  I'm running DT 18.1 and DF 34.11 SDL.
« Last Edit: December 19, 2012, 03:00:26 pm by Nkosi_SW »
Logged

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2594 on: December 19, 2012, 05:19:32 pm »

Looks like great work guys.  The optimizer is impressive - can't wait to start using it.  Thanks heaps!   :)

Minor bug report: The dwarven caravan members are now showing up in DT when they visit to trade.  I have 190 dwarves in my fort.  The caravan has just arrived, and now I'm showing 204 in DT (an extra seven guards and seven merchants are fully listed).

I have a save if you want it, but I guess it can be replicated pretty easily.  I'm running DT 18.1 and DF 34.11 SDL.

i'll have another update finished soon, and it has some important fixes to optimization, so watch for it if you're interested in that feature!

thanks for the report, unfortunately i have a save with merchants, but they don't show up in DT, so i may still need you to upload that save if it's not too much trouble.
Pages: 1 ... 171 172 [173] 174 175 ... 192