Damn it, the browser hanged on me when I was writing... again.
> I was talking with splinterz, I was thinking of putting it into the frequency bin formula's we have setup.
The bin method and simulation method are different and don't mix. The bin method is about what you can get from migrants. The simulation method is about what you can can do with what you have now.
> I'm not sure what 2000 is for, so instead I set it to what a dwarf can possibly gain, his max - initial
It is an arbitrary number of attribute points to gain. It must be the same for all dwarves for the simulation method to work properly. The only reason I can think of that you would set this to something dependant on att and initial is that you don't understand these lines, because they take care of capping the attribute already.
int max_delta = ...
ret += (att_sim - max_delta) * att_cap;
2000 is pretty high, actually. Only the military has a hope of gaining this much and only in some attributes.
> I made a sim2 that replaces 2000 with max - current.
This won't fix it. It will only reverse a small anomally, depending if att or initial is bigger, because depending on that you cap out and "ret += (att_sim - max_delta) * att_cap;" kicks in.
> let me know if I fucked it up
Yes. I explained it above. With different numbers of attribute points gained by different dwarves, this method no longer works properly.
This is what I would do:
int sim3 (int att, int initial)
{ int att_cap = initial * 2; // Actually: int att_cap = initial + ((initial > median) ? initial : median);
att_cap = (att_cap > 5000) ? (5000) : (att_cap); //caps at 5000
// If att > att_cap, there can be no gain, except by interactions.
if (att > att_cap)
return att;
int att_sim = 2000; // Or whatever you think is prudent. This is where you can factor in attribute rates.
int max_delta = (att_cap -att) > att_sim? att_sim : (att_cap -att); // min {att_sim, att_cap -att}
long long ret = ((att + att + max_delta) * max_delta) / 2; // Or att * max_delta + (max_delta * max_delta) / 2
ret += (att_sim - max_delta) * att_cap;
ret /= att_sim; // Ret is now the average value for this attribute when you gain 2000 times in it and cap at some point.
return (int)ret;
}
> errors on 2500 5000 as input values...
int att_sim = att_cap - initial; // = 5000 - 5000 and later causes division by 0.
> new million dollar question
You lie. I won't get a million dollars for answering this.
> what about modifying the above formula for attribute rate gain?
Simple, if you know how those work. "int att_sim = 2000;" Modify 2000 by the gain rate, similar to sim1 for skills. You want to use the first number, the "cost to improve". I think it should be "att_sim = att_sim * 500.0 / CTI;" assuming the lower cost the better.
> Anyways. If DT could auto-optimize in a way that you would like, how would it go about it?
* Highlight labours with no assigned dwarves in the grid view. (Or fewer than a set number)
* Let me sort dwarves by suitability for a labour, so I can manually pick however many I want.
* Have an option to quickly select multiple labours for a single dwarf. I think this is possible now, but I haven't figured it out.
In other words, I prefer to do this manually, just have a few shortcuts.
> I mean if we're hitting on the skill thing you want, then can't you just weights skills the most important and then auto-optimize?
If sim1 is going to be there with a settable weight, I can sort by mostly it, yes.
> You said something about assigning the undesirable effect of militia dwarf's being assigned to labors?
If I have a DT option to filter out military (all of them, not just the ones currently on duty), then I can manage. Nobles are less important, because I only have a few of them, overlap their responsibilities (manager + record keeper) and can remember or rename them.
I don't mind the military as haulers, butchers and so on, but I don't want them to do any of the important jobs, unless they mood out.