More Awesome Than You!

The Bowels of Trogdor => The Large Intestines of Trogdor => Topic started by: pbox on 2010 January 14, 16:13:11



Title: Info: Career metrics and the <MappingsX> key
Post by: pbox on 2010 January 14, 16:13:11
This doesn't seem to be documented anywhere yet: I'm about to make some overrides for the EA careers, and found out how to use the <MappingsX>keys for career performance metrics.  

Every job level has a performance meter in-game; what exactly constitutes "performance" is defined in the <Metric1>,  <Metric2>, <Metric3> etc keys. Four parameters will fit into the UI; I haven't tested what happens when one tries to use more than four. Most of the EA careers have one or two of these values already defined in the template (the first entry in every career list; Metric1 is usually "Mood") but you can safely remove that default and use whichever metrics you want.

Each of the entries for the different career levels have their own set of parameters. They are not dependent on each other.

Sample:

  <Title>TheDishwasher</Title>
[..]
  <Level>1</Level>
  <Metric1>SkillX</Metric1>
  <Mappings1>0,1,2</Mappings1>
  <Args1>Cooking</Args1>
  <Metric2>SkillX</Metric2>
  <Mappings2>0,1,4</Mappings2>
  <Args2>Charisma</Args2>

This means that this career level uses two parameters for job performance: Cooking skill and Charisma skill - the parameter is "skill X", the argument it takes is the name of the skill. Other parameters I've found that will always work are Mood, RelCoworkers and RelBoss (as long as HasBoss is True, at least) - some of the EA careers also have custom parameters, e.g. MedicalJournals for the medical career. Those do not take any arguments.

The mappings, and this took a little bit of testing to figure out (which is why I'm writing this), define how a number of skill points (or whichever other value you use) is mapped onto the performance meter. The syntax seems to be min, normal, max - min is what's regarded as horrible, normal is normal, max is excellent. The range between normal and max will be circled in white on a sim's skill meter (= this is the stuff they need to learn in order to boost their performance).

Here's an example that illustrates the influence of the min value - this is a sim with no skills at all (same sim in both screenshots, only the min value is different):

(http://www.moreawesomethanyou.com/crapola/pbox/jobmetrics-01.jpg)

Note how in the first screenshot, the minimum is negative - so even though they have no skills, their performance is only "bad" (they can't very well have negative skillpoints so they'll never drop below "bad"). In the second screenshot, the min is at zero - this time, no skills will be regarded as "terrible" which is worse than just "bad". The EA defaults very often use -2 for entry level positions, presumably to make the 12s happy (completely unskilled sims will still have "normal" performance or better).


Another example to show how the normal, max range is reflected in the UI:

(http://www.moreawesomethanyou.com/crapola/pbox/jobmetrics-02.jpg)

This is with the unedited EA default for Metric1 (i.e. super easy mode for that parameter .. note how the min is at -500? Is it even possible to reach -500 mood in-game short of being about to die?).


The mappings appear to be working exactly the same no matter what the parameter is. RelBoss with a mapping of -40, 20, 40 means -40 will be regarded as terrible, 20 is normal, 40 is excellent. And so on.

See this thread (http://www.moreawesomethanyou.com/smf/index.php/topic,15936.0.html) for how to tune the EA careers without clashing with AwesomeMod.

Also note that I'm using Awesome with <ScaleJobProgressToAging value="True"> and <JobDifficultyScaling value="5"> so the values I'm using in my examples may or may not work well for you.


ETA: also, twallan just filled me in (http://www.modthesims.info/showthread.php?t=388865) on the actual calculation that is used here:

Where <MappingsN>mNegMap3,mMap0,mMap3</MappingsN>

Code:
public int CalcMetric(Career career)

{
    career.LastTimeCalculated = SimClock.CurrentTime();
    float num = FindMetricValue(career);

    if (num == mMap0)
    {
        return 0x0;
    }
    if (num < mMap0)
    {
        if (num <= mMapNeg3)
        {
            return -3;
        }
        if (num < ((mMapNeg3 + mMap0) / 2f))
        {
            return -2;
        }
        return -1;
    }
    if (num >= mMap3)
    {
        return 3;
    }
    if (num > ((mMap3 + mMap0) / 2f))
    {
        return 2;
    }
    return 1;
}


Title: Re: Info: Career metrics and the <MappingsX> key
Post by: J. M. Pescado on 2010 January 14, 16:18:30
This material is really more technical than strategy-related, so it is now Bowels of Trogdor material.


Title: Re: Info: Career metrics and the <MappingsX> key
Post by: pbox on 2010 January 14, 16:22:51
Oh, oops. I wasn't aware that mere peasants were supposed to post there =).