Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Maklak

Pages: 1 ... 41 42 [43] 44 45 ... 94
631
DF Modding / Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« on: January 15, 2013, 11:57:26 am »
I generalised the simulation method of factoring in both current skill level and skill rate. I'm pretty sure this method is fine, but the code itself may need cleaning up. It may not even compile the first time and I might have missed some bugs.

Code: [Select]
const int max_xp = 29000;

const int xp_levels [] = {0, 500, 1100, 1800, 2600, 3500, 4500, 5600, 6800, 8100, 9500,
11000, 12600, 14300, 16100, 18000, 20000, 22100, 24300, 26600, 29000};


// xp(lvl) = 500*lvl + 100 * (lvl * (lvl -1)) / 2

// const int lev_size = sizeof(xp_levels) / sizeof(int);   // 21 , unused

int get_level_from_xp(int xp)   // Uses busection method. Assumes xp >= 0.
{ if (xp >= max_xp)
    return 20;

  int min = 0;
  int max = 19;
  int current = 10;

  while (1)
  { if (xp < xp_levels[current])
    { max = current;
      current = (min + max)/2;
    } else if (xp > xp_levels[current+1])
    { min = current;
      current = (min + max)/2;
    } else
      return current;
  }
}

/* Simulation method for judging a dwarf's skill level and rate.
   Inputs: dwarf's current xp and learning rate for a skill.
   Output: rating based on simulating gaining experience in that skill.
*/
double simulate_skill_gain(int xp, int rate)
{ if (xp >= max_xp)
    return 20;

  if (rate == 0)
    return get_level_from_xp(xp);       // Obviously stays the same.

  int sim_xp = max_xp;    // 29k seems like a good value to me.
  sim_xp = (sim_xp / 100.0) * rate; // This is how much XP will go towards skill learning.
  int total_xp = sim_xp;
  double ret = 0.0;
  int curr_level = get_level_from_xp(xp);
  int curr_xp = xp;


/*  // Version of the while loop interpolating the level. It may be smoother.
  while ((sim_xp > 0) && (curr_level < 20))
  { int xp_gap = xp_levels[curr_level+1] - curr_xp;         // How much XP till mext level?
    if (xp_gap > sim_xp)   
      xp_gap = sim_xp;
    double low = (0.0 +curr_xp -xp_levels[curr_level]) / (xp_levels[curr_level+1] -xp_levels[curr_level]);
    double high = (0.0 +curr_xp + xp_gap -xp_levels[curr_level]) / (xp_levels[curr_level+1] -xp_levels[curr_level]);
    double avg_level = curr_level + (low + high) / 2.0;   // Average scaled level for this iteration.
    ret += xp_gap * avg_lvl;
    curr_level++;
    curr_xp = xp_levels[curr_level];
    sim_xp -= xp_gap;
  }
*/

//  Alternate, simple version of the while loop, without the interpolation.
  while ((sim_xp > 0) && (curr_level < 20))
  { int xp_gap = xp_levels[curr_level+1] - curr_xp;         // How much XP till mext level?
    if (xp_gap > sim_xp)   
      xp_gap = sim_xp;
    ret += xp_gap * curr_level;
    curr_level++;
    curr_xp = xp_levels[curr_level];
    sim_xp -= xp_gap;
  }

  if (sim_xp > 0)
    ret += 20 * sim_xp;
  ret /= total_xp;
  return ret;
}

632
DF Dwarf Mode Discussion / Re: Research: Crossbow with axe and shield.
« on: January 15, 2013, 03:46:14 am »
A miner with a crossbow / mining pick wouldn't shoot because of a lack of quiver and bolts in his uniform. Drafting him might work, but I think he would use one weapon for mining and another for a weapon.
I don't know enough about modding to say if it could be used for a crutch.

I think bayonet crossbows should work fine. In melee the dwarves bash with their crossbows anyway, so a bayonet would be just another type of attack and should be used.

633
Mod Releases / Re: Fallout: Equestria (v0.95 beta) Feather and Flame
« on: January 15, 2013, 02:22:50 am »
Hey guys, hold your horses. (That was a joke.)

I've only said, that I was considering doing a table with skill rates castes, not that I was making it. When I'm in the considering phase of something, it may still be months away. Besides, between recent additions to Dwarf Therapist, Replica's work in progress and a total overhaul in unspecified feature, as well as whatever else I'm doing at the moment, there is little reason for me to do it.

Another thing I'm considering is starting a fort after the next update. What's planned after the robot arc? Ministry of Peace? Combat drugs would be nice, but I can live without them. More creatures would be good, though. I've developed an aversion for feral ghouls and dogs from Ponderplanned, just as pretty much everyone else has an aversion for radscorpions.

Has anyone tested the "Rage" spell recently? Does it still affect liaisons, merchants and other friendlies?

634
DF Modding / Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« on: January 15, 2013, 02:00:39 am »
Thistleknot:
While Splinterz rejected the simulation approach on the grounds that it cannot be done for military skills (which is true), if you implemented it in a short program, you might as well get the proper numbers out of it. You want to print the "sr_factor", which is the average skill level over 500 jobs. This is obviously higher for better skill rates and skill levels. With this method "sr_factor" would be a good benchmark for both.
In a production code, you'd want to replace as many additions as you can with multiplications, but for testing, simplicity of a loop is OK.
I'd also use an array with XP levels and a function searching over them with bisection method, rather than hard-code lots of ifs into a function. That way it is easier to answer other questions, such as "How much XP till next level" by re-using the array.
Instead of using integer values for levels, it would also be OK to use interpolated ones based on XP, like I've shown in one of my earlier posts. The only difference is that the "sr_factor" would be slightly higher.

In your example using my formula the "Initial formula" looks good and this is what you want. I don't even know where "Factored" and "Averaged" come from.

Quote
but this still doesn't solve the issue with learning rates below 50%.
It does. You just neglected to test it for skill rates such as 35% or 20%. Even for the 50% rate you chose 18000 XP, which is closer to Legendary+5 than to Dabbling, so of course the formula gave you something above 0.5.
So what exactly makes you think that this is wrong?

Oh, and as for displaying skill rates, I recommend the following: If any skill rate is other than 100%, display it, even for dwarves with 0 experience in that skill. The 25% threshold in the big tooltip over a dwarf that recommends skills is good.

EDIT: After some thinking about it, I've come to the conclusion that the simulation method can still be used for military skills. Granted, it won't be using the exact number of jobs, but the slopes are the same and there will still be multiple (measuring pints? what word?) and the proportions between their number will be correct, which is what matters. With the simulation method for military skills the numbers will be distorted from what actually happens, but I believe they will still have enough value to be reliably used for comparison. I've come to this conclusions after staring at level(jobs, initial_lvl) graphs and thinking how to calculate integrals on them. Simulation method FTW! Try it.

635
DF Modding / Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« on: January 14, 2013, 02:52:12 pm »
Quote
i'd really like to try implementing this, but 60xp isn't a constant rate per job. it's different depending on the skill, and even varied for any military skill experience (training vs actual combat).
You're right, of course, it was too good to be true and I got too fixated on crafting. I made several beds and got 60 XP for each (so the wiki must be incorrect with 30 XP for some reason), so I guess 60 XP should be correct for most crafting skills and for things like smoothing, farming, etc, there are just different values, maybe even 10 XP per job, like the wiki says. For social skills this is probably different and military skills are notorious for erratic learning. There are different values for combat, sparring, different attacks with the same weapon, demonstration XP scales with several skills, etc.
Since it would be overly complex to have different methods of taking learning rates into account, just try adding the formula that spits out <0, 1> along with what you have for current skill level to your weighted average and see what happens. For some combination of weights level 8.3 with 50% learn rate should come ahead of 0 skill with 100%, which is what you want. My guess is this should happen around 75% skill formula, 25% rate formula.

While I would like the part based on learning rates to behave as nicely as possible, truth be told, a lot of time I'm just looking at lots of dwarves with 0 skill to choose whomever seems like a good replacement for my recently deceased worker. For this, even most Thistleknot's proposals (such as about scaling learning rates to <0, 1>, regardless of skill) would be enough. They just don't have as nice properties for skill levels in-between 0 and 20, so this is what should be a true test for learning rates formulas.

636
DF Dwarf Mode Discussion / Re: Research: Crossbow with axe and shield.
« on: January 14, 2013, 02:17:24 pm »
Quote
I just added on a bayonet to my crossbows. Functionally its just a spear tip, but it lets dwarves with crossbows stab at things in melee with their bayonets in addition to bashing at them with their crossbows.
You wouldn't be the first one; some mods had bayonet crossbows for a long time. As ridiculous as that sounds, a mod I play has a chainsaw and a ripper variants of rifles. :D

637
Mod Releases / Re: Fallout: Equestria (v0.95 beta) Feather and Flame
« on: January 14, 2013, 12:56:31 pm »
I considered doing this myself. A good way would be to just have a table with EPs and Unicorns, then a sortable table with CMs, description, deltas from their race and "mics" (useful for things like what spells they can learn).

EDIT: Hey, I said I considered doing it, not that I'm doing it now or plan to do it in the next few days. I think I'll try to finish my combat guide first in any case. I've found lots of good info in this thread: http://www.bay12forums.com/smf/index.php?topic=97090.45

638
DF Modding / Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« on: January 14, 2013, 12:32:28 pm »
Quote
why doesn't a custom role column work for this?
I've never used custom roles before. I don't even know what those are. I'm mostly fine doing this on my own anyway.

Quote
u touched on minor rate differences having large affects (i.e. 80% vs 90%). i wouldnt think this would b an issue since its merely a min/max approach (which you recommended for attributes). however. i was thinking of using a skill rate category that instead shows how many jobs is needed until legendary (similar to your original formula).
If you just add skill rates on their own to a weighted arithmethic average, then yes, both methods are equivalent, but for <0, 100> you would want smaller weights. In any case I disagree with this approach. Time and time again I explained that skill learning rate only means something when you know the skill level. For a Legendary +5, skill rate 30% or 300% is irrelevant, but close to 0 XP those are very different. Therefore any method for taking skill rates into account must take skill levels into consideration as well and not just scale skill rates to some interval and add that with a weight to the goal function.

Quote
The reason I don't think a min/max approach would matter, is because the max represents the highest skill learner in the game... which uni formally applies throughout the game.  A different mod, would have a different feel for this value, but it would still mean the fastest learner.
Splinterz just bashed me for this with his example of a Dwarf with Level 8.3 with 50% learn rate and I must agree with him. The "simulation" method is the best I can think of, when it comes to skill level and it's learning rate. My formulas aggregated with current skill level are a distant second.

Quote
also, we used to use min/max for attributes...  that was my original idea... but we changed it since the wiki had good information on bin's... and since the bins are not symmetrical, it makes more sense to use them.
The way I see it, you did something stupid in a smart way. I'll try to explain the flaws of the current system from a user's standpoint.
1) The most recent DT only uses a few discrete values to represent attributes. There should be more of them.
2) Dwarves are scaled according to their castes, so you can't compare their attributes by just glancing at the grid. (Well, you can in vanilla, but not in caste-heavy mods.)

Quote
the 0-1% and 99-100% represents dwarf's who have fallen below minimum, or gained above maximum attribute value (as defined in bin's).
Except military dwarves will usually go above their maximum and there are more than 1% of them.

Quote
The wiki does state a dwarf can gain half his starting value (I believe it's half), but we just opted for this method instead, and it works.
I think it says that for adventurer mode. I've never seen a military dwarf cap agility in fortress mode, but I wasn't looking very closely. I would prefer to see the whole range of attributes, but capping them at max and min for all castes works too.

Quote
as to the 16.333, I originally had it 98/6, but SOMEBODY changed it, supposedly makes for faster code.
0.98/6.0 :D Compilers calculate constants and macros made of constants during compilation, so the speed is the same. Even if it wasn't, this is not a place where you need all the speed you can get, like the inside of a loop inside a loop. In most cases it is better to make code human-readable rather than micro-optimise it.

Quote
I wasn't showing you the bins for learning rate purposes... I was just showing you the research we've put into coding up each different category.
Well, there is no talking you out of this now, so have fun. I just want to add a few things:

Just remember to handle things like [1000:1000:1000:1000:1000:1000:1000] or [3000:3000:4000:5000:5000:5000:5000] and other edge cases gracefully.

My first method for attributes would be to just display real values, where 0 is min and 5000 is max. The problem here is that with the square / diamond method pretty much everyone would have a red square, so OK, this wouldn't work so good and you want the graphical and numerical representations to be consistent.

My second approach would be to find:
* Min of attribute for { all caste minimums, regardless of frequency; all current citizens }.
* Max of attribute for { all caste maximums, regardless of frequency; all current citizens }.
If Min and Max are very close, scale them further away from their mean. Say at least 300 points apart.
This would work better, except for two problems:
1) As military skills up agility, the others appear to be regressing in it.
2) 0 is not the average. This could be fixed by finding the average, like you do, and scaling everything above and below linearly. Personally I'd settle for this. 

Whatever you do with attributes, just keep these things in mind:
* The more values we get, the easier it is to compare dwarves at a glance. To keep attributes consistent with skills, you could use -20 to -1 (red), 0 (empty), 1 to 20 (blue). 41 different values would be enough for clarity.
* If dwarf A has a higher attribute than dwarf B, the value displayed in grid view for A should be at least as much as B, so I can see the difference at a glance. Don't just scale them inside their own castes.
* Average for entire population / all castes being displayed as 0 with red below and blue above has a lot of appeal... Though I think you want the median, not average for this.

As long as whatever method you use satisfies the first two guidelines, I should be happy with it.

639
DF Dwarf Mode Discussion / Re: How do attributes influence skills?
« on: January 14, 2013, 11:30:58 am »
how can you see the personal characteristics of your starting 7 before embark?  I've often wondered at that...
I don't know. I just set them to whatever I wanted with Runesmith after embark.

640
DF Modding / Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« on: January 14, 2013, 08:05:19 am »
Quote
i did some testing with the sorting on skills/labors with one of the formulas you supplied in particular: [50.0f * (1.0f - (((29000-current skill xp)/skill rate)/290.0f))]. now for me, this isn't very intuitive. i had a level 8.3 with 50% learn rate ranked below ~60 dwarves with ~0xp and 100% learn rate. personally it seems like it punishes skill rates below normal far too much. now if i compare with the current weighted method, sorry, current incredibly flawed incorrect method, the same dwarf gets ranked near the top (perhaps too near) but is still outranked by those with over 100% learn rate and a few levels less xp.
Level 8.3 with 50% learn rate will max out his skill slower, but will continue to be better most of the way there. If you use your weighted arithmetic means for some weights this formula should still be OK, although a more intuitive formula for skill rates would have to sort-of simulate getting to Legendary +5 and give points for how high the skill is along the way... or maybe just pretend performing 500 jobs at (60.0 / 100.0) * skill rate and add skill levels along the way, then divide them by 500. (with some optimisations to substitute multiplication for addition where applicable). The basic formula for current skill and skill rates would therefore be: 
Code: [Select]
double sr_factor = 0;
int xp = dwarf.get_xp_per_skill(skill);
for (int i=0; i<500; i++)
{ sr_factor += get_skill_level_from_XP(xp);
  xp += 60 * skill_rate;
}
sr_factor /= 500.0;
You get a number in <0, 20> This is the simple and stupid version, without speed optimisations.

Quote
so thinking about this more, there's still two parts to the skill rates: the column sorting method, and how to add it into the roles. for the sorting, i'm trying to get something setup so you could right click on a column header, and choose the sorting method, either for all columns of that type, or that particular column. for example:
I'm guessing most people would want to apply the same method to all columns, so a radio button in the options would work better. Or maybe even your arithmetic mean with setting the weights, like it does now. I did some thinking on this and while there are other methods of aggregating goal functions, and some might be better, none is as intuitive as weighted arithmetic mean. It is for this reason that I changed my mind about it being "flawed and incorrect beyond redemption".

Quote
for roles, well that's another issue, and i'm not completely decided on what to do there. your comment about skill ratings dropping below 0, i assume is also related to your function returning negative values. this is why it was mentioned that we prefer values are all normalized to an equivalent scale of 0-1.
The "simulation" method above will always return values >=0. It may even replace both a goal function for skill rates and goal function for current skill levels as a suitable alternative for both.

Thistleknot couldn't quite make up his mind where he wanted me to scale those values, which caused some confusion. This is an example mapping into <0,1>. It even punishes low learning rates somewhat less.
Code: [Select]
int XP = (current_XP > 29000) ? 29000 : current_XP;
int rate = (skill_rate < 1)? 1: skill_rate;   // 0 or 1 doesn't really matter.
double jobs_left = (29000.0 - XP) / rate;  // Ignore division by 60.
double normalised_XP = 0.5 * (1.0 - jobs_left/290.0);    // Scaled to <-49.5, 0.5>
if (normalised_XP >= 0)
  normalised_XP += 0.5;    // Values <0, 0.5> reserved for those suitable for a task.
else
  normalised_XP = -0.5 / (normalised_XP - 1.0);

Quote
2) as you said, the gridview can handle this somewhat.
For better or worse, it also makes me prioritising attributes in my head rather than present me with an aggregating function. But I only ever care about attributes for my military and even that takes the form of "no penalties and preferably good recuperation and disease resistance".

Quote
4) getting the base speed is trivial, however the current speed is based on many factors: (environment, mood, race, caste, exhaustion, hunger, strength, agility, etc) if i add this i'll probably just show the base (race/caste) + attribute modifications and note that it's the uninfluenced speed or something.
You could get some error reports about the speed being incorrect, but if you can get it or dig up the formulas, it would be useful. If possible, I'd like this to factor in the carried equipment.

641
DF Modding / Re: Dwarf Therapist (LATEST 0.6.12 5/23/12 see first post)
« on: January 14, 2013, 05:06:12 am »
Thistleknot, it takes most of my focus, concentration and linguistic ability for me to understand you, but I'll try to answer nonetheless.

Quote
the more and more i think about it. the more i dislike skill % being modified by skill rate. skill % is already modified by skill rate by attaining skill faster.  to me it would b better to have a group by option for it, ot own category (such as attributes, skills, traits, preferences, skill rate), or an option to modify existing skill by skill rate (but not enabled by default)
Current skill and the speed of gaining that skill are two different things. Both matter and should be separate categories.

Quote
what could be done to make it it's own category is to read all rate modifiers for castes, multiply this rate modifier by the castes frequency then do something like set the lowest value to 0, highest to 100 Something similar is being done for attributes
That could work, but this method ignores how skill rates really work. If you had two castes: one with 80% and another with 130% learning rates, the relative difference is +0.625 / -0.385. With your method one would be be set to 0 and the other to 100, which looses information about their relative importance. For a more extreme example, consider two castes having 95 and 105 learning rates in some other skill. That's not that big of a difference, but they still get set to 0% and 100%.
One way to fix this method would be to set minimum to 0 and bottom-cap maximum to 100. That way with the first example, you'd get weights 61.5 and 100, while for the second example 90 and 100, respectively. If for all castes the highest learning rate of something was 10%, you'd get 10 or less for all. Come to think of it, setting the minimum to always 0 is more important with this method than what you do with maximum.
Even with all that, I still say my proposition is better.

Quote
here's the code for attribute bins[...]
I don't see why you'd need bins like this for learning rates. I don't care about probability distributions. For traits, attributes and learning rates, just knowing min and max for all castes and everyone in the fort would be enough. Yes, you can get a nicer curve with bins and set the average properly, but I don't need this kind of behaviour. Besides, it might look nice in the grid view, but for weighting attributes and traits into recommendations, just multiplying their values by weights should be better.

"Cumulative distribution function" is What you call "density". Probability density would be (temp.probability / ((temp.max - temp.min !=0) ? (temp.max - temp.min) : 1)), since DF assumes uniform distributions within bins.

The code for traits looks OK, but the code for attributes looks strange. Here is what I see in there:
* Cumulative distribution function, which you for some reason call density, doesn't add up. For each bin it should be equal to that bin's probability plus it's value from the previous bin. Just needs two fixes.
* Why do you need a zeroth bin? By your code a Dwarf has a 0.01 chance of getting an attribute below the minimum for that caste. Is this the case? Does this emulate attribute rust? What is it?
* If you have the zeroth bin, why not also add a last one with min as the caste maximum and max as 5000? NVM, the code after the loop seems to be responsible for this, assuming raws[7] is always 5000. It seems to forget to add 0.01 to temp.density, though. There is nothing above it anyway.
* What is 0.16333333333? Did you mean (1.0 - 0.01 - 0.01) / 6.0 ? Just let the compiler calculate that for you.
* The fist bin generated by the loop has "density" 0. Did you mean 0.01? If so, delete the "if(i>0)".
* The max value for this bin should be one less than the min value for next bin.

Quote
the traits and attributes use known knowledge to find their mean of 50.  I did the research on the traits myself using 16,000 dwarf's, which provided me with about 46k data points to draw the statistics from.
Ah, so you did the research. The 0.01 probabilities for being below or above the racial minimum and maximum were there, yes?

Quote
The attributes were verified once it was found dfhack was exporting names of attributes in the wrong order, I started a big fight on the wiki saying stuff was inaccurate...  the attributes follow a simple 1/6 breakdown per bin category (remember what I was saying about frequency bins, at least that's what I told a frequency bin was).
I remember dfhack (the command to dump Dwarves to xml), Dwarf Therapist and Runesmith not quite agreeing on what attributes of my Dwarves were in 31.25. I didn't know which was correct, but I think I assumed dfhack to be wrong. 

Quote
we hope to incorporate better traits for castes by incorporating the castes min/max values that vanilla traits don't have.  The formula is pretty basic, it's[...]
Yeah, so long as Min and Max are correct, this will behave well. The Mean will be correct and everything above and below will scale linearly. That said, I'd be content with just:
Code: [Select]
return 100 * (Value-Min) / (Max-Min);
Quote
we hope to multiply these values by the castes frequency, so we can see where a dwarf fits within the whole fortress mode race.
Yes, that's the logical thing to do once you went that far to get the average. I imagine you get your averages by taking the middles of all bins, multiplying that by their probability, then dividing that by the number of bins (or rather 6/8 the number of bins).
But once again, I'd be pretty content with just linear scaling between absolute minimum and maximum for all castes and current citizens or displaying rounded values when I set the grid to display numbers.




Quote
I finally get what your formula is doing
double jobs_left = (29000 - XP) / rate;  // Ignore division by 60.
means treat each job * rate as the # of exp gained.
Interesting concept.
Yes, I omitted the 60 XP per job (or 120 per three mugs or whatever you get per weapon swing), but those are constants for any given skill (or reaction, in case of mugs) and therefore don't matter for comparison. All skill learning rates do is alter the number of XP gained. My formula is just an approximation, since I imagine XP is integer, while I use doubles. My formula is an answer to a question "How many jobs will it take this dwarf to max out his skill?" (except it ignores the 60 XP per job). It is also a good reason to ignore probability distribution for learning rates. You simply don't need this information to decide who is better for a job.




Quote
Here's another hopefully simple suggestion (should be much easier to fix than the current optimization/sorting formulas discussion). The optimizer has an "exclude active military" option. How hard would it be to change that to (or add an additional) "exclude squad members" option to avoid having soldiers that just happen to not have active orders at the moment getting included for optimization?
When I look for dwarves to assign them civilian labours, a workaround I use is to sort by military status, but I don't use the "train all the time" schedule, so the soldiers get off-duty and get mixed up with civilians. It would be useful to have an option to treat everyone having a squad as military, regardless of schedules, or if their alert is set to active/training.
I just use the grid view to do this, I didn't even know there was a job optimizer other than all the suggestions for roles and sorting by them.




I propose "soft capping" learning rates by 1/x function, not just cutting them off at 50%. That way for things like 0-10% learning rates you get values close to -2 (and you normally really don't want a dwarf with learning rate below 50 to perform a job) and for 50 and above you get a nice linear progression. While Masterwork never goes below 50%, I've seen people "disabling" skills in their mods by setting their rates to 0 or 10 or something like that, therefore for generality you want to take that possibility it into account. To patch this in replace with:
Code: [Select]
if(aspect_value < -1.0)
  aspect_value = -1.0;
Code: [Select]
if(aspect_value < -1.0)
  aspect_value = -2.0 - 1.0/aspect_value;

Looking at the code some more:
Code: [Select]
skill_rate_value = (skill_rate_value < 100) ? 100: skill_rate_value;Wait, what? You're capping skill rate at 100%?! It should be capped at 1% and only to avoid division by 0!
Code: [Select]
if(a->is_neg)
    aspect_value = 1-aspect_value;
This looks suspicious, but I have no idea what it is.

Ah, so skill ratios are factored in last... Hm, looking at this, if skill ratios are very low, then the Recomendation can go below 0%. If this is a desired behaviour is up for debate.



Well, since I can't fight job recommendations, I might as well try to help you improving them. I believe the choice of the right Dwarf for the job (or the military) comes down to answering and prioritising these fundamental questions:

1) "Which one of you has the highest skill now?"
2) "Which one of you has the best attributes and traits and likes for the job?" OR "Which one of you will make the most quality items when you max out your skill?"
3) "Which one of you can get to legendary+5 with the fewest number of jobs, thus wasting the least materials?"
4) "Which one of you is the fastest?"

Are there any more fundamental questions?

I'll give you my perspective on them:

1) Old DT used to sort by this exclusively. You already have this included, but I'd like to add a twist. I was wrong when I wanted this to be sorted by XP, because that would work for sorting by skills alone, but not when this has to be aggregated with other criteria. I have another proposal. Instead of just taking integer skill levels into consideration, scale them linearly to next level according to XP. Just have an array with it, except set 0 as the minimum for Dabbling. http://dwarffortresswiki.org/index.php/Experience Instead of using just skill levels, scale them linearly according to XP. You might do something more sophisticated here, like fit a spline, but the old good linear interpolation is simple and good enough. An examples:
A Proficient (lvl5) Dwarf having 3600 XP, has effective lvl 5.1.
A Proficient (lvl5) Dwarf having 4000 XP, has effective lvl 5.5.
Code: [Select]
double eff_skill_level = dwarf.getSkill(skill_no);
if (eff_skill_level < 20.0)    // Don't care anymore for Legendary +5
{ double skill_xp = dwarf.getSkillXP(skill_no); // double is important. You want floating point arithmethic for this.
  double min_XP = XP_per_level[(int) eff_skill_level];  // static_cast<int>(eff_skill_level) if the compiler screams.
  double max_XP = XP_per_level[1 + (int) eff_skill_level];
  eff_skill_level += skill_xp / (max_XP - min_XP);
}
// Scale eff_skill_level from <0, 20> to whatever you need.
// Take it into account for recommendations, sorting or whatever.
If you want to make skill levels more apart, choose and alpha from  <0.5, 1> and use this instead:
Code: [Select]
eff_skill_level += alpha * skill_xp / (max_XP - min_XP);
2) This is actually a series of questions about attributes and traits and likes. I have very little clue to how this works, you are away ahead of me and so I don't have anything to contribute. In DT you can already have a grid view with attributes and see personality traits. There is even a normally hidden window where preferences can be seen and filtered by.

3) For Vanilla this is the same as 1, really. For mods with learning rates, this is a separate category, because a dwarf with 29000/2 XP and 50% learning rate is obviously better than one with 0 XP and 100% learning rate; even though they will both reach Legendary+5 after the same number of jobs, the first one will be better up to that point and work faster, while creating higher quality items. We have recently discussed this point.

4) Speed affects everything: Walking to the workshop, gathering materials and completing the job itself. There should be some way to get it from the game and I wouldn't mind a column in the grid view with speed. The speed that corresponds to "wait 9 frames" should be considered average. I'd scale the rest with 1/x function before using it for your aggregated goal function, but I would need some additional data to submit a proposal. A downside of using speed from the game might be that a dwarf's speed drops drastically when he is carrying a heavy cage or bin or something.



Right, so unless someone wants to discuss any of this, that's it from me for now.

642
Mod Releases / Re: Fallout: Equestria (v0.95 beta) Feather and Flame
« on: January 14, 2013, 02:02:26 am »
> The Nurse Redhearts are indefinite use for now. Once the chem industry is implemented you'll need to replenish their supplies of Med-X and healing potion once a year.

I prefer the system we have now, where it is assumed that a crates of chems / ammo / whatever, while not an infinite supply, last you for years on average and leftovers from destroyed robots are used to replenish the existing ones. At least that's my head-cannon explanation.

More in-crunch, it will be terribly inconvenient to watch this and micro-managy to keep at least one NR supplied at all times. I mean I try to make a stack of coins once a year and I often forget and skip years. This is why I'm against this.

> Has anyone managed to get the robotics industry up and running?
Sorry, not me. I'm sure someone will provide the information eventually.

643
DF Suggestions / Re: Better Livestock Management and Behavior
« on: January 13, 2013, 05:54:34 pm »
My grazers usually just hang around in the dining hall till they die of hunger unless I bother setting up a pasture outside. I have a different annoyance with animals. I captures some wolves and once in a while they have puppies, so I have to go to the Z->Animals, look for pups and assign them "Any trainer". Then I have to look over the animal list and assign any mature wolves to war training. I'd like this to be automated or at least have a filter in the animals menu.

644
DF Community Games & Stories / Re: Fallout: Equestria - Pineapple
« on: January 13, 2013, 05:27:23 pm »
I like the update. It is entertaining, as usual.

I also like the portrayal of my character, except he is a bit exaggerated and has severe case of low spatial awareness, which I dislike. At first I was like "Wut? I have a wife?", but I like her now.

As for the upcoming conversation with Replica, keep in mind that my character is pissed at loosing 2 ponies and dwarves get good thoughts for "He yelled at someone in charge lately." He will be rather impressed that they did so much in such a short time. After calming down a little he will even admit that the ponies down here couldn't save them if they tried and were brave even for opening the way for them. He will also like having turrets, but other than that he won't like his current situation one bit. It is not even that his family won't get a nice room, it is other things. Firstly, this place obviously didn't get the supplies they were supposed to. Secondly they were told that this was an established salvaging outpost, not a hole in the ground. Thirdly, they need defences badly and he won't even be able to do his job properly without a bucking rifle, dammit. Finally, WTF, what kind of lunatic designed this architectural nightmare? The place is a confusing clusterfuck with narrow corridors and you can't get anywhere without having to walk long distances and getting lost in the process. Were they hoping to confuse ghouls if they got inside, or what?

For the time being he will consent to help with whatever civilian labours get assigned to him, but he will insist that his best qualifications are as a soldier.

If he gets a room he will carve his name on it, to stop making mistakes by walking into other ponies' rooms. I imagine at some point somepony will write "He bites" below, giving him another reason to get pissed at vandalism. I also think he will rub some ponies the wrong way, even though his desire is just to keep everypony safe. Well, he did consider leaving Coldnar behind, but sacrificing one pony was simply the only option for the rest of them to live another day. I mean if it wasn't for Poet, I might just face the ghoul myself, letting others escape, but I have a family. No hard feelings, right kiddo?

A biofuel refinery and some ore would be useful right now.

645
Mod Releases / Re: Fallout: Equestria (v0.95 beta) Feather and Flame
« on: January 13, 2013, 04:13:41 am »
I already know enough about this mod and reading RAWs to not need the flowcharts, but they should be helpful to others.
I like how you included the sources for raw materials. Stockpile settings hints would also be great so we can easily set up stockpiles for these things. There is already info on the front page and it works well, but it took me some figuring out to finally get it that I need to select Finished goods -> Type: Toy, Tool, Then what "materials" I want under Stone/Clay.
You missed the pasture with robots, chickens, dogs and slaves and a stockpile for upgrade potions on that flowchart.

Pages: 1 ... 41 42 [43] 44 45 ... 94