Bay 12 Games Forum

Please login or register.

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

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

Maklak

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2805 on: February 01, 2013, 02:31:51 pm »

> because we want to match the raw values between attributes to each other in terms of percents.
Ah, OK. I finally get it.

The one problem I see with that is that agility and strength are the most important attributes anyway because they influence speed and faster dwarves are better at everything (walk faster, finish working at workshops faster, better military, everything). Still, DT with high weight for attributes likes to pick my military for all sorts of labours, so it kinda works now.

Well, I'm not sure if sim3 can help you with what you want to do. I believe you're computing a value in <0, 100> for an attribute (the higher the better), then take an unweighed arithmetic average for all relevant attributes.
If values slightly below 0 or slightly above a 100 are not a problem, then a very straightforward method would be to take
(att - min) / (max - min), so for Strength (att -450) / (2250 -450). You would have to check for some edge cases (max == min), or the result of this formula exceeding <-100, 200>, but other than that it should work for all attribute values. Use min and max average for all castes and based on their frequency.

I understand your motivation for attribute bins now, but I am at a loss on how to make it right.

Another simple solution would be to just use att / 5000 for everything, then maybe scale the results to 100%, allowing values above 5k to be above 100%. Sure, you won't get 50% to be the same as median, but you'll get a nice property: linearity. With this simple method 80 is exactly +25% / -20% as good as 100, while with the bin method you don't know.

There are a few things to keep in mind here:
* You are really comparing Dwarves to each other. It doesn't matter if the highest suitability ranking for some dwarf is 100 or 63.8, he is still the best candidate, so he gets the job.
* Extraordinarily good attributes should be rewarded.
* In the end +20% in whichever attribute should get the same ranking improvement for a related job for a dwarf, regardless of which attribute got boosted. The (att - min) / (max - min) formula doesn't have this property.

sim3 can't help much here, I'm afraid. It kinda factors in the cap for an attribute, but sim1 for skill gains and rates was much more useful.
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 #2806 on: February 01, 2013, 02:49:39 pm »

Code: [Select]
The one problem I see with that is that agility and strength are the most important attributes anyway because they influence speed and faster dwarves are better at everything (walk faster, finish working at workshops faster, better military, everything). Still, DT with high weight for attributes likes to pick my military for all sorts of labours, so it kinda works now. This is a custom role issue, you can weight strength/agility higher for the roles that you feel it's important for INSIDE the role editor.

Quote
(att - min) / (max - min), so for Strength (att -450) / (2250 -450). You would have to check for some edge cases (max == min), or the result of this formula exceeding <-100, 200>, but other than that it should work for all attribute values. Use min and max average for all castes and based on their frequency.

remember what you said about dwarf's above max bin (i.e. 7th raw?)  that wouldn't account for it, it would if we extended it.  but that's kind of what we do now.  We squeeze 98% of values inbetween 1st bin and double last bin.  The remaining 2% are values outside of it.  It's the best system we can come up with without using min/max.

Code: [Select]
sim3 can't help much here, I'm afraid. It kinda factors in the cap for an attribute, but sim1 for skill gains and rates was much more useful. This is why I wanted to feed the return value (wether it's sim1 or sim3) back into the frequency bin's to get a # that is scaled back to our distribution.

UPDATE:
Here's a good formula... so simple in it's simplicity

both attribute values are converted to %'s via the frequency bin's

((Current Attribute * Weight A) + (Max Attribute possible for that Dwarf * Weight B))/(Weight A + Weight B)

It's merely measuring the halfway point between current and max possible for that dwarf. 
Currently there is no CTI factor... I would like to figure out a CTI factor, in the end it should be based on (max possible - current)*whatever we want CTI factor to do for us.

Maybe
att_sim = (att_sim * 500) / CTI;
Can be
add value to current (%) =
(((Max - current) * 500) / CTI) (* Weight)

So the whole formula would be

((Current Attribute * Weight A) + ((
    (Max Attribute possible for that Dwarf - Current Attribute) * 500 / CTI ) * Weight B))
/
(Weight A + Weight B)


that's it.

it does produce higher numbers on average (as expected), but the rankings do differ.


If we can mitigate this:
(Max Attribute possible for that Dwarf - Current Attribute) * 500 / CTI )

from ever being greater than (max - current), we're good, but now that I'm looking at it, I don't think it can...

I think the answer might be in your formula here
Quote
double normalised_XP = 0.5 * (1.0 - jobs_left/290.0);    // Scaled to <-49.5, 0.5>
where whatever value you get, you factor it down to <.5
maybe something like this
.5 * (1-((Max - current)*(500/CTI)))[/s]
Yeah, I don't think that was the answer...

I think i I'm onto something, but I can't figure out how to incorporate CTI

I think the answer is here
normalised_XP = -0.5 / (normalised_XP - 1.0);
« Last Edit: February 02, 2013, 01:28:38 pm by thistleknot »
Logged

Ryusho

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2807 on: February 02, 2013, 05:24:00 am »

I know I feel slightly stupid right now, for asking this, but may I ask if there are any recomendations on how to set up the optimizer for your forts? I was trying to figure it otu a bit ago, and...I saw some strange selections by it, so I feel I was being absolutely -stupid- with what I was telling it to keep an eye open for >.< then again I was playing Kobold camp with Masterwork at the time so that might be one reason I felt like I did so stupidly with the setup @_@
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2808 on: February 02, 2013, 03:13:59 pm »

I did it!

deletes a bunch of erroneous code

tada!
Code: [Select]
float mod_att_value(int CTI, int max, int current)
{
  const int defaultCTI = 500; //set as default... values above/below will adjust accordingly.

  //int CTI; //Cost to improve as described via tokens.
  //int max; //dwarf's max attribute
  //int current; //dwarf's current attribute
  float mod_Att_Value;
  float add_value;
 
 
  float gap = (float(max) - float(current)) * defaultCTI / CTI;
 
  float normalized_gap = 0.5 * (1 - gap / (float(max) - float(current)));
 
  if (normalized_gap >= 0)
    normalized_gap += 0.5;    // Values <0, 0.5> reserved for those suitable for a task.
  else                                                               
    normalized_gap = -0.5 / (normalised_gap - 1.0);
   
  add_value = normalized_gap * gap;
 
  mod_Att_Value = current + add_value; //can weight mod_Att_Value against current value for weighted average
 
  return mod_Att_Value;

   
   
}

so the only issue with this... is IT WILL NOT WORK WITH ANY NEGATIVE CTI.  I had a formula that was kind of working for negative CTI's but not really.  This seems to work for any positive CTI.
« Last Edit: February 03, 2013, 02:05:36 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 #2809 on: February 03, 2013, 11:46:12 am »

I know I feel slightly stupid right now, for asking this, but may I ask if there are any recomendations on how to set up the optimizer for your forts? I was trying to figure it otu a bit ago, and...I saw some strange selections by it, so I feel I was being absolutely -stupid- with what I was telling it to keep an eye open for >.< then again I was playing Kobold camp with Masterwork at the time so that might be one reason I felt like I did so stupidly with the setup @_@
the optimizer sets up pairings between labors and either their related skill, or a chosen role. the skill or role chosen determines 'how to score' each dwarf for the labor or job that needs to be done. the priority column can kind of be thought of as a ranking of importance for the jobs/labors in the optimization plan. a higher priority means there's a better chance of assigning a highly rated worker to the job. the ratio is a way to setup approximately how many workers will actually be assigned to the job or labor.

there are tooltips on everything and the columns will update as you change values so you can get an idea of what will happen. i'm not sure if this helps as i don't know exactly what problems you were having. i'm working on getting a little webpage/manual setup which will explain all the new features i've implemented and in time have examples and samples you can try.

Gobolinno

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2810 on: February 04, 2013, 01:09:54 am »

Excuse me for asking, A couple of pages ago Maklak asked or thought about making it able to edit values.
(as jdrwaf)...

then everyone started talking about scripts and 2000 values and much more complicated stuff (for me!) than
even dwarf fortress itself...

I'm sorry if the answer is somewhere in these last pages but... this feature (aka: edit... yes, cheat!)
is available somewhere, somehow in any release?

O.o?
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2811 on: February 04, 2013, 11:47:54 am »

I do not think dwarf therapist should be used as a tool to cheat (I'm kind of on the fence about highlighting cursed dwarfs, I use it, but... I wouldn't cry if it wasn't there).

there's a lot of flack already about how this tool "cheats" even though it doesn't (really), but if it were enabled to do what you speak of, edit attributes... then a lot of people probably wouldn't use it.

it's a philosophical standpoint.

I for one liked those tools you spoke of, and I hope the developers get it working again, but I don't think it belongs in DT.

I think rather if you REALLY want to do what you speak of, use cheat engine and use splinterz version of dwarf therapist .ini files for the memory address

IMO
« Last Edit: February 04, 2013, 12:39:38 pm by thistleknot »
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2812 on: February 04, 2013, 12:50:22 pm »

Yeah, I think DT should just be for observation and for doing stuff that you can do in-game. At the moment the only DT options that DF doesn't have are 'highlight cursed dwarves' and 'allow child labour', and that's okay.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Gobolinno

  • Bay Watcher
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2813 on: February 04, 2013, 08:17:47 pm »

Could someone point me to the memory adresses to use with Cheat Engine?.   :'(
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2814 on: February 04, 2013, 09:04:42 pm »

now when I did this, i searched for an attribute value
say
a dwarf's strength value


open a process by using window list (if your using dfhack, dfhack shows up as "dwarf fortress (somenumber)" don't choose the window with the number.
try using a dwarf's experience in a skill instead

and then when it increased by a number, I searched for the increased value

once I finally found a dwarf, then I was able to use

v0.34.11_graphics.ini

and it specified the exact difference between dwarf's

(I never figured out how to save cheat engine tables for use with DF :(, i remember they changed when i fired up a new fort).

Another thing you could do is change a dwarf's squad id.  I'll post some more when I figure some stuff out

You know, I think it's a counter... their probably isn't a value that stores actual xp...  but when the counter reaches a point, the level goes up.

Yeah, it's a counter.

woohoo, found my old notes

Splinterz said
Quote
for memory locations you can't just save the address of an attribute, as when you start a program it will load into memory in (potentially) a different base address each time. you'll need to use the right click in dt and look at the memory dump, plug in the base address for the dwarf, and then the offsets to get to the attributes, each time you want to mess around with cheat engine.

Okay, getting somewhere
right click on the dwarf you want, copy address to clipboard, inside cheat engine click "add address manually" (bottom right) then choose text value type.

Voila, you just got the start of the dwarf's memory address layout (so you can now use the offsets defined in the .ini file, example 0x000 = name, or the starting position).  The rest of the offsets can be found from the name starting address.

For example, fire up the windows calculator, copy and paste that value in that you copied from DT (make sure you have the calculator set to programmer and set it to hex mode), and add the offsets to find the other address...  the first phys attr is strength.  Found it, just set mine to 6000 (to see what happens, but it did have the correct 1st value).  try changing the record offsets by 4 to get each new attribute.  I'm not sure what the size of a dwarf's object is inside DT, but if you "recalculate new address" you can set the offset to ...

I tried to find the difference in dwarf's, but i was getting b08 (in hex) as the difference between dwarf's... or 2824 decimal address difference.  So if you define all the values for one dwarf, you can cycle through them by changing the offset for all the address.

beyond that, i'm not sure how to use cheat enginge (although you can also use it to freeze your fortress' value, embark points, adventurer points!)
« Last Edit: February 04, 2013, 10:28:18 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 #2815 on: February 05, 2013, 05:22:18 am »

Yeah, I think DT should just be for observation and for doing stuff that you can do in-game. At the moment the only DT options that DF doesn't have are 'highlight cursed dwarves' and 'allow child labour', and that's okay.
yes i agree. it's never been intended to turn it into something like runesmith. i also believe there are a quite a few dfhack scripts and plugins for tweaking values already.

Could someone point me to the memory adresses to use with Cheat Engine?.   :'(
here you go: https://github.com/angavrilov/df-structures

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2816 on: February 05, 2013, 05:08:17 pm »

I sometimes get posts by people saying that they can see my custom written "cursed dwarves" with dfhack. Which is not true. My disease carriyng migrants, cults, possessed dwarves, and so forth ARE invisible. They use a caste system, but the caste name is identical to the normal dwarves, so the Therapist sorts them to the normal castes.

We did talk about this a long time ago, and I think it is just perfect as it is. ;) But for testing, bugfixing and people that like to use this "highlight cursed dwarves" it would be nice to have the option to see them. I dont know of any other mod using this system (I think LFR is planning on an addition though) so I dont know if you want to add it as a feature.

If yes, all you would have to do is add an option to sort dwarves by caste-id. I think some people that play my mod, including me, would be greatful for the option. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2817 on: February 05, 2013, 05:59:18 pm »

I sometimes get posts by people saying that they can see my custom written "cursed dwarves" with dfhack. Which is not true. My disease carriyng migrants, cults, possessed dwarves, and so forth ARE invisible. They use a caste system, but the caste name is identical to the normal dwarves, so the Therapist sorts them to the normal castes.

We did talk about this a long time ago, and I think it is just perfect as it is. ;) But for testing, bugfixing and people that like to use this "highlight cursed dwarves" it would be nice to have the option to see them. I dont know of any other mod using this system (I think LFR is planning on an addition though) so I dont know if you want to add it as a feature.

If yes, all you would have to do is add an option to sort dwarves by caste-id. I think some people that play my mod, including me, would be greatful for the option. :)

by sort, do you mean group by? so these special caste dwarves don't actually have a curse, they're just a special caste?

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2818 on: February 05, 2013, 08:04:35 pm »

New Feature request... not sure if anyone wants it. (and I'd hate to hold up a new release)

a status icon column.

I'm wondering how many of my dwarf's are thirsty

http://dwarffortresswiki.org/index.php/DF2012:Status_icon

i don't see any thirsty icons, but I'm wondering if anyone is still thirsty after my supposed wells are in place).

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« Reply #2819 on: February 06, 2013, 05:23:07 am »

New Feature request... not sure if anyone wants it. (and I'd hate to hold up a new release). a status icon column. I'm wondering how many of my dwarf's are thirsty (http://dwarffortresswiki.org/index.php/DF2012:Status_icon) i don't see any thirsty icons, but I'm wondering if anyone is still thirsty after my supposed wells are in place).

most of the status icons are spread among different properties of a dwarf (health, happiness, thoughts, statuses, moods, etc..) most of these are already accessible in DT in some form or another. for example you could probably gauge the amount of thirsty dwarves by monitoring the amount of thirsty/dehydrated thoughts in the population (thoughts are in the upcoming release!), but obviously that will have a bit of a delay. a dwarf will also often have multiple status icons that will cycle in DF, which isn't really practical to implement in DT.

that said, health statuses like hunger and thirst will be visible when i get around to attempting a health grid view so you can also see who is injured, and how badly (similar to the z->health overview within DF). it's been asked for multiple times and may be a nice addition.
Pages: 1 ... 186 187 [188] 189 190 ... 192