[WIP] Focus, Skill, and Proficiency rates balancing
Summary
Balance "Rebalance focus mechanic"
Purpose of change
#84059 prompted me to examine the numbers and mechanics involving focus and its relationship with experience gain to see how it currently is and how I can nudge things to make the situation better and better follow the vision from times past.
Findings:
- Skill practice from crafting happens every second
- Skill practice has a base focus drain of max(1% of current focus, amount), where for crafting, amount is .1% of current focus. This base consumption is squared for drain less than 1% focus, so the less focus you have the less drain you get.
- 1 + 2 results in focus cratering from 100 to the low 20's in less than 3 minutes. Meaning, managing focus is near useless because it'll crater too fast for focus to matter
- Despite the above, right now, you can level up from 0 to 1 in less than 3 minutes! Going from 0 to 4 takes around 6 hours of constant crafting, 0 to 7 takes only 30 hours. Provided materials and survival supplies and enough time left to scavenge more, you can take one crafting skill from 0 to 7 in a week, and be done with skill leveling by early summer.
There were already plans and visions laid out in past PRs and issues to slow down skill gain as practice activities, proficiency system, and NPC-aided crafting has become more robust than it was 5~10 years ago, so I feel like it is also prime time to apply those changes with this PR.
Describe the solution
- Remove the 1% of current focus cost per practice that dominates focus drain in status quo, making focus drain solely based on XP gained.
- Removed focus_drain squared safeguard from skill XP gain, XP gain falloff from low focus is sufficient
- Make crafting give XP every minute instead of every second for skill XP and every 5% of craft for proficiency
- Slow focus regen from 1% per minute to 0.5% per minute
Consequences:
- Skill gain from crafting slowed down by 8~10x overall (60x slower from changing gain rate every second to every minute, partially negated by much higher focus equilibrium). Current state of the PR makes it so that getting from 0 to 1 takes ~2 hours, 0 to 4 takes 58 hours, 0 to 7 takes 275 hours.
- Learning drains less focus, which means more time spent learning in higher focus, buffing XP gain overall
- Learning one thing at a time only slightly lowers focus. Learning multiple things at a time (crafting with missing proficiencies, intense fighting) can meaningfully lower focus, which makes taking a break worth doing
- Focus becomes much more of a long-term mechanic, being consumed and regenerated less than it used to
- Learning proficiency on the go while crafting a recipe that suffers from time penalty from the proficiency being learned missing is kinda weird. As you learn the proficiency, the craft speeds up and so does the rate of learning, which shows up as accelerating focus loss up until you complete learning the proficiency. bug or feature?
Describe alternatives you've considered
- Change XP needed per skill level (requires migration?)
- Implement #53372
- Give a base XP gain multiplier to make XP gain not fall off so much from status quo
- Pick from any of the other mult/regen value combination. Interest in particular toward decreasing focus regen rate further?
Testing
Modeled a few mult/regen value combination with the same methodology as existing focus test (from 100 focus, how long of an uninterrupted craft does it take to raise a level?) and put the data into a sheet. Unit tests related to focus and learning are definitely borked with these changes
Additional context
Change XP needed per skill level (requires migration?)
Isn't this what #67580 lays out 🤔
Regardless of how it's done, the rates of that issue call for even higher times(~x4 from just 0->1 compared to this PR's values)
Learning one thing at a time only slightly lowers focus.
This resolves to, "just grind one skill at a time continuously", that's not something we want to encourage. As we've laid out elsewhere, focus should take a lot longer to drain and a lot longer to recover, but it should resolve to a fixed amount of productive practice time per day, not continuously in any circumstances as this seems to.
A very invasive overhaul like this needs a clear statement of desired outcomes and tests that assert those outcomes, like "expected time to gain each level in certain circumstances", "number of effective focus minutes per day at a given morale level", etc.
Whatever system is used has to be capable of handling the resolution of the events processed. This means evaluating crafting every minute is not suitable, because any crafting taking less than 1 minute counts as nothing, so batch crafting becomes better than a sequence of single crafting simply because there are fewer minutes lost at the end of each craft. That's a bad mechanic discrepancy.
If you want the gain rate to be lower, reduce the amount gained at each step a gain is made to something smaller. This may call for type changes to allow you to represent such smaller increments properly.
A very invasive overhaul like this needs a clear statement of desired outcomes and tests that assert those outcomes, like "expected time to gain each level in certain circumstances", "number of effective focus minutes per day at a given morale level", etc.
Right now I'm aiming to have level 1 take roughly 4 hours of raw XP, and the following levels to still follow the exponential curve. That should translate to around 7~8 hours of repeated 'learning from 100 focus to 20'. The easiest solution I see right now for that from the current state is to increase base skill XP requirement from 10k to 25k.
I'm set on implementing "XP gain cost more focus" and "focus regen slows down while in learning activity" to solve the high focus equilibrium problem, but now I need to explore how to implement those and what knock-on effects will it have on other systems. Adding in both seems to be needed since the math really doesn't work out otherwise.
The specific numbers I'm aiming for:
- Focus equilibrium when crafting is 20% of morale+100. Working the math on this tells me that during crafting, focus regen rate is 1/4 of drain rate. It's a simple F_eq = regen/(drain+regen) relationship, so tweaking this on its own is easy enough. Could even be zero, no focus regen when crafting.
- Recovering 90% of missing focus takes ~8 hours. 0.5% regen per minute is a nice round number for that purpose.
- Spending roughly 80% of the surplus focus above the crafting focus equilibrium take around 3 hours. This one is tricky because the math isn't so clean as to be able to solve for the correct numbers, so I'm testing out numbers manually. For 20% equilibrium, 0.7% drain (at x7 focus cost) seems satisfactory.
Whatever system is used has to be capable of handling the resolution of the events processed. This means evaluating crafting every minute is not suitable, because any crafting taking less than 1 minute counts as nothing, so batch crafting becomes better than a sequence of single crafting simply because there are fewer minutes lost at the end of each craft. That's a bad mechanic discrepancy.
In the current state of the PR, crafting gives at least 1 tick of learning. The amount of learning tick in a craft is max(1, craft time / 60 seconds), and then those ticks are spread throughout the duration of the craft, or simply done at the end of the recipe if it only has one tick. So repeating recipes less than a minute are actually disproportionately more effective at learning, which is clearly broken. Not that there's a lot of recipes less than a minute that'd be useful for that purpose, but still.
The biggest obstacles I see to making XP skill gain more proportional to the duration of learning for such extreme cases are: 1. Skill xp is stored as an integer, 2. Character skill gain function accepts integer then inflates it internally to then multiply with focus, still as an integer. Due to that, I'm working on the base of 1 minute = 100 skill xp and 100 focus consumed instead of 60 for proficiency. In a way, this still works out anyway if you think of skills being more complex overall than a single prof. That still means I can't change to give less than 100 skill xp at a time without needing to change all other instances of skill learning... Lowering skill gain could run into integers being too low of a resolution, yes. Maybe I do need to do that. I'll look into it. Proficiencies are already working on the basis of 1 second of learning = 1 xp, plus it handles fractions just fine, so it'll be nice for skills to be the same