[Feature Request] average cost for craft + recraft until inspiration
domi1294 opened this issue ยท 4 comments
I would like to request a feature that allows to calculate how expensive it would be on average to craft + recraft an item until inspiration procs. Might be a bit ambitious but maybe it can be considered somewhere down the line. This feature would be useful for pricing crafts where one offers to craft an item until it procs for a fixed sum of gold (either in trade chat or on other sites like ForgeFinder).
Here is a very basic example:
- Crafting a new blacksmithing weapon with an inspiration chance of 40%
- On average 2.5 attempts, 1 initial craft and 1.5 recrafts, would be needed (1/40% = 2.5 attempts)
- The initial craft costs 10k and recrafts cost 4k (arbitrary numbers)
- Average cost would be 16k (10k initial and 6k from 1.5 recrafts)
- Now that I know that it costs me on average 16k to craft this weapon at max quality, I could add whatever my target margin is to the price and offer it for let's say 20k and make an average profit of 4k on each craft
Some potential design considerations/issues I came up with would be:
- How to determine how many materials a recraft costs?
I do not believe the API can give this information, so the addon would need to provide this data somehow or gather it the first time it sees each recraft. Alternatively a placeholder value of 40% of the initial craft gold cost + price of 5 mettle (if set in price override) could be used since 40% of initial craft mats seems to be fairly close to reality for most crafts. - How to incorporate non-permanent bonuses into this calculation? (finishing reagents, incense, alchemy discovery)
Takes are already taken into account for profit calculations on commodities, so should be doable. Maybe a best combination button could be added that calculates all combinations and shows the one with the best value? Would be useful for both commodities and gear crafts. - How to account for material bonus on recrafts fluctuating in certain situations?
So basically the material bonus tends to fluctuate a bit when using tier 2 mats, this reddit post explains it a bit (I believe it to be accurate from my own testing).
Lets assume we need 80% of the available material bonus to craft an item, the first craft would need to use a mix of tier 2 and tier 3 materials but all subsequent recrafts could use only tier 2 materials and the bonus would not dip below 80% but alternate between 80% and 100%. Similar if only 60% material bonus are required then after the initial craft any tier of materials could be used since the bonus can't go below 60%.
The biggest issue are already existing items a customer might want to have recrafted since there is no way to tell what the item was crafted with originally (before actually getting it in a recrafting order). For price calculations it's probably best to assume every item was crafted with tier 2 materials since those are usually cheapest and most common, alternatively assume tier 1 materials were used but I feel that it would be too conservative.
If you choose to implement this in some way I would be more than happy to assist with testing and data gathering, got tournament realm access and can play around with crafting as much as I want on there.
As cool as this feature would be, since inspiration will be removed in TWW I will save me some time and not implement it for dragonflight only
- You can actually determine the materials a recraft needs via api!
- I would maybe base it on the current selection? So if for the initial craft a finishing reagent was used, I could assume that its also used for recrafts?
- This is the main problem, where each recraft itself can actually determine the real bonus (from api comparisons) its not possible to forecast it or look into an items past :/
And I think this is the main blocker of this idea
- You can actually determine the materials a recraft needs via api!
Never really looked into it because I didn't expect it to be possible, that makes things a lot easier tho
- I would maybe base it on the current selection? So if for the initial craft a finishing reagent was used, I could assume that its also used for recrafts?
Yeah, that's a fair assumption to make, in most cases it won't matter anyways and it would probably be a lot of work
- This is the main problem, where each recraft itself can actually determine the real bonus (from api comparisons) its not possible to forecast it or look into an items past :/
And I think this is the main blocker of this idea
For new crafts it wouldn't be an issue since you know the entire history of the item, only for recrafts it would actually be a problem. Maybe this could be solved by an extra box where you can guesstimate what the current % material quality bonus of the item is or something in that direction?
I've written a JavaScript program for that, that can be run with Node.js:
const costForCraft = 0
const costForRecraft = 674.36
const chance = 0.43
function calculateCraftingCostWithRecrafts() {
let cost = costForCraft
let artisanMettle = 0
let i = 2
let extraCostWeighted = calculateExtraRecraftCostWeighted(i)
while (extraCostWeighted >= 1) {
cost += extraCostWeighted
artisanMettle += calculateExtraArtisanMettleCostWeighted(i)
i++
extraCostWeighted = calculateExtraRecraftCostWeighted(i)
}
return {
gold: cost,
artisanMettle,
}
}
function calculateExtraRecraftCostWeighted(i) {
return (
(calculateChanceForAtLeastOnce(i, chance) -
calculateChanceForAtLeastOnce(i - 1, chance)) *
costForRecraft
)
}
function calculateExtraArtisanMettleCostWeighted(i) {
return (
(calculateChanceForAtLeastOnce(i, chance) -
calculateChanceForAtLeastOnce(i - 1, chance)) *
5
)
}
function calculateChanceForAtLeastOnce(n, chance) {
return 1 - (1 - chance) ** n
}
console.log(calculateCraftingCostWithRecrafts())
Just set the three variables in the first 3 lines. Chance is the inspiration proc chance. It prints you how much the crafting costs on average in terms of gold and artisan mettle.
Node.js can be downloaded from here.
You can run the script from the terminal with:
node recraft.js
If the file is called recraft.js
I provide this script under the MIT-0 license. So you can legally use it and port it.