How much does it cost to learn the proficiency?
Describe the bug
I looked at the dialog and saw a value of $1800. That value has always stopped me from learning it. But trying to check out a way to cheat NPCs out of money, I decided to learn knitting. And was very surprised to see a debt of $18.
Hence the question, how much should it cost to learn and where is the error?
Thanks to Uyen from the refugee center for helping me learn. The save is made next to her.
Attach save file
Steps to reproduce
- Load the save or find Uyen at the refugee center
- Start a dialog and select skill training.
- Choose knitting training, note the cost in the dialog and the cost in the exchange.
Expected behavior
The same price.
Screenshots
Versions and configuration
- OS: Windows
- OS Version: 10.0.19043 (21H1)
- Game Version: cdda-experimental-2024-05-25-0347 388ca6c [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], Stats Through Kills [stats_through_kills] ]
Additional context
I was confused the whole time by that $1,800 price tag. Too much for at most a couple days of self-study. Especially considering the promise to train at 3%. But it never occurred to me to check if that was actually the case. Cataclysm developers: "The player must suffer"
I assume the value is in cents in json, and in dollars (so multiplied by 100) in the source code, should be easy to fix either way.
https://github.com/CleverRaven/Cataclysm-DDA/blob/388ca6c0d72bdffb2a2ab357ba74bdc058ccdb49/src/talker_character.cpp#L1055-L1068
https://github.com/CleverRaven/Cataclysm-DDA/blob/388ca6c0d72bdffb2a2ab357ba74bdc058ccdb49/src/talker_character.cpp#L1091-L1101
The process to fix the issue itself is quite trivial, just add the missing / 100 to proficiency_training_text like the way in proficiency_training_text.
https://github.com/CleverRaven/Cataclysm-DDA/blob/388ca6c0d72bdffb2a2ab357ba74bdc058ccdb49/src/npctalk.cpp#L319-L350
But I'm confused by the function calc_proficiency_training_cost. It is used to calculate the money needed, but is returning to_seconds<int>( calc_proficiency_training_time( teacher, student, proficiency ) ), which is the time needed to train the proficiency?
As you can see, for training skills, the time and money needed are calculated separately.
Edit:
So, as the time_to_learn a proficiency is defined in hours in the json files, I can't say the function is wrong. But it's still weird to directly use the time needed directly as the cents needed IMO.
I assume the value is in cents in json, and in dollars (so multiplied by 100) in the source code, should be easy to fix either way.
Well, it's just the opposite. The time_to_learn a proficiency is defined in hours in the json files, and calc_proficiency_training_cost is returning the time needed in seconds.
The value returned by calc_proficiency_training_cost is then considered as cents when paying the NPC, but is displayed as dollars in the dialog.
Is it kind of complicated? I thought learning time was fixed. Something like, I'm willing to spend an hour and teach you ... And how much you learn depends on your intelligence. And the cost is fixed and depends on the level of skill.
And so it turns out that it is based on learning time? Should a smarter NPC then explain faster and take less?
Is it kind of complicated? I thought learning time was fixed. Something like, I'm willing to spend an hour and teach you ... And how much you learn depends on your intelligence. And the cost is fixed and depends on the level of skill.
And so it turns out that it is based on learning time? Should a smarter NPC then explain faster and take less?
As far as I can see, the time needed is not relevant to anything except the time_to_learn defined in the json files and the PROFICIENCY_TRAINING_SPEED scale set in the option.
And the way to fix the issue itself is quite trivial, I already created the PR.