Try reducing the replace with sparring chance due to xp gain overkill.

Also add more debug spam to make behavior tracking easier.
develop
Alexander Gavrilov 2012-11-18 22:06:47 +04:00
parent ae7bf5aca6
commit 902d2d5597
1 changed files with 11 additions and 5 deletions

@ -797,10 +797,10 @@ struct military_training_ct_hook : df::activity_event_combat_trainingst {
// If the xp gap is low, sometimes replace with sparring
if ((maxv - minv) < 64*15 && spar == units.size() &&
random_int(20) >= 5 + (maxv-minv)/64)
random_int(45) >= 30 + (maxv-minv)/64)
{
out.print("Replacing %s demonstration (xp %d-%d) with sparring.\n",
ENUM_KEY_STR(job_skill, sd->skill).c_str(), minv, maxv);
out.print("Replacing %s demonstration (xp %d-%d, gap %d) with sparring.\n",
ENUM_KEY_STR(job_skill, sd->skill).c_str(), minv, maxv, maxv-minv);
if (auto spar = df::allocate<df::activity_event_sparringst>())
{
@ -822,13 +822,19 @@ struct military_training_ct_hook : df::activity_event_combat_trainingst {
// If the teacher has less xp than somebody else, switch
if (best >= 0 && maxv > cur_xp)
{
out.print("Replacing %s teacher %d (%d xp) with %d (%d xp)\n",
out.print("Replacing %s teacher %d (%d xp) with %d (%d xp); xp gap %d.\n",
ENUM_KEY_STR(job_skill, sd->skill).c_str(),
sd->unit_id, cur_xp, units[best], maxv);
sd->unit_id, cur_xp, units[best], maxv, maxv-minv);
sd->hist_figure_id = sd->participants.histfigs[best];
sd->unit_id = units[best];
}
else
{
out.print("Not changing %s demonstration (xp %d-%d, gap %d).\n",
ENUM_KEY_STR(job_skill, sd->skill).c_str(),
minv, maxv, maxv-minv);
}
}
}
}