• The VOIDRUNNER'S CODEX is coming! Explore new worlds, fight oppressive empires, fend off fearsome aliens, and wield deadly psionics with this comprehensive boxed set expansion for 5E and A5E!

The formula for magic item prices

Truename

First Post
I was working on a spreadsheet to track magic items today and I had to figure out a formula to convert magic item levels to prices. It was a bit tricky, so I thought I'd share it with you.

First, the formula. "$A1" is the item's level. I'll explain it below.

Code:
=360*POWER(5,INT((-1)/5))+((360*POWER(5,INT((-1)/5))/2.25)*((MOD(-1,5))))
Now, how it works.

Magic items are divided into "half-tiers." Items of levels 1-5 are in a half-tier, levels 6-10 are in another half-tier, and so forth. We'll number those tiers starting with zero, so levels 1-5 are in tier 0, levels 6-11 are in tier 1, and so on.

Code:
half_tier = int((level - 1) / 5)
There's a big jump in price between half-tiers. Each half-tier has its own "base price," which is the same as the price of the first item in the half-tier. So the base price of half-tier 0 (levels 1-5) is 360 gold, the base price of half-tier 1 (levels 6-11) is 1800 gold, and so on.
Code:
base_price = 360 * (5 ^ half_tier)
Within a tier, the price increases more slowly. It increases differently in each tier, but always by the same amount. For example, in tier 1 (levels 6-10), level 7 items are 800 gold more expensive than level 6 items, and level 8 items are 800 gold more expensive than level 7 items. In tier 0 (levels 1-5), the price increases by 160 gold each time. We'll call this the "per-level increase."

Code:
per_level = base_price / 2.25
To calculate the price of an item, we need to know the level relative to its tier. We'll count from zero again. For example, a level 6 item is level 0 relative to its tier (which starts at 6), and a level 18 item is level 2 relative to its tier (which starts at 16). This is the "relative level."

Code:
rel_level = (level - 1) % 5
Given an item's relative level and how much the price increases every level, it's easy to calculate the price increase within the tier. For example, an item of level 8 is in tier 1, which has a per-level increase of 800. It has a level of 2 relative to its tier (which starts at level 6), so the item is 1600 gold more than a level 6 item. We'll call this the "relative price."

Code:
rel_price = per_level * rel_level
Once we have the relative price, we just add in the base price for the tier, and we're done!

Code:
price = base_price + rel_price
Now, to put it all together...
Code:
price = (360 * (5 ^ (int((level - 1) / 5)))) + (((360 * (5 ^ (int((level - 1) / 5)))) / 2.25) * ((level - 1) % 5))
Simple. ;)
 
Last edited:

log in or register to remove this ad




Asmor

First Post
Cool, now if you could figure out the mathematics behind the XP levels, you just might win the Internet.

There's no need to be snarky.

I think he was being serious. The XP chart is also non-standard.

Of course, if you want to be really technical, it's possible to create a polynomial to fit any given set of data points. In particular, it would be possible to create polynomials f and g such that f(x) = the exact amount of experience needed for level x and g(x) = the exact amount of gold required for an item of level x.

They wouldn't be pretty, mind you, but it would work.

Personally, I'd just use an array.
 

castro3nw

First Post
I think you've got a really good idea there, but I think there's a simpler way.

Consider 2 facts.*
1) The sale price of an item is 1/5 of its purchase price.
2) The sale price of an item is the purchase price of an item 5 levels lower.

This gives a repeating pattern where every for 5 item levels, you multiply the price by 5. (That would be your half-tiers) You get this number by dividing the item level by 5, and rounding down to the nearest whole number.

You'd do this in excel with...
Code:
=INT(level/5)
This repeating pattern means you only need the prices of items from levels 0-4, and then you can multiply it by 5 a number of times equal to the half-tier number.

To figure out which item level to start with, you can MOD the level you're trying to calculate by 5.

In Excel...
Code:
=MOD(level,5)
From here, all you need is the theoretical price of a level 0 item and the amount the price increases by for the next few 5 levels.

To get the price of a level 0 item, use fact #2 to see that the sale price of a level 5 item is 200g.
Truename has already told us that it increases by 160g per level.

So, if you combine these various facts into one equation, the price of an item of level A1 is...

Code:
=(160*MOD(A1,5)+200)*5^INT(A1/5)
*from looking at PHB 223 -prices
 
Last edited:

Truename

First Post
I think he was being serious. The XP chart is also non-standard.

Oh. Sorry for overreacting. Well, by way of apology, here's what I figured out about the XP charts.

There's two things going on here. First, the important thing to remember is that one level equals ten level-appropriate encounters, and ten level-appropriate encounters = 1 standard monster per PC. So the actual amount of experience needed to go up a level SHOULD be 10 * the "standard monster" column on DMG p.56.

But it's not. That's because 4e ROUNDS UP at certain points, like this:

When the total is...
< 25,000: don't round
25,000 < 150,000: round up to nearest multiple of 1,000
150,000 < 500,000: round up to nearest multiple of 5,000
500,000 < 950,000: round up to nearest multiple 25,000
> 950,000: round up to 1,000,000

For example, following the monster XP chart gives you (210,000 XP at level 22 + 41,500 XP from ten encounters equals) 251,500 XP to reach level 23. The actual XP requirement is 255,000. Looking at our round up chart, we see that we have to round the XP requirement up to the nearest multiple of 5,000. Similarly, at level 27, ten encounters gives us 540,000 XP, and we round up to the actual requirement of 550,000.

That takes care of one anomaly in the chart. The second thing we need to derive is the monster XP chart. It's easy (almost). Levels come in sets of four. Each set of four sees the monster XP increase by the same amount.

For example, level 5 monsters are worth 25 XP more than level 4 monsters, which are worth 25 more than level 3 monsters, and so on. For levels 6-9, monsters are worth 50 more than the preceding level. Here's the complete chart:

Levels 2-5: 25 XP
Levels 6-9: 50 XP
Levels 10-13: 100 XP
Levels 14-17: 200 XP
Levels 18-21: 400 XP
Levels 22-25: 950 XP HUH???
Levels 26-29: 2,000 XP WHUT?
Levels 30-33: 4,000 XP
Levels 34-37: 8,000 XP
Levels 38-40: 16,000 XP

The amount monsters goes up doubles every four levels... except for the places I've marked "Huh?" and "Whut?". Those spots are special, presumably for rounding reasons again. There may be tidy rounding rules like there is for the XP chart, but it's late and I'm not going to try to figure it out right now.
 

Truename

First Post
I think you've got a really good idea there, but I think there's a simpler way... This repeating pattern means you only need the prices of items from levels 0-4, and then you can multiply it by 5 a number of times equal to the half-tier number.

Code:
=(160*MOD(A1,5)+200)*5^INT(A1/5)

VERY nice. Yeah, that's tons simpler than mine, and it works great. I've updated my spreadsheet to use your version.
 

castro3nw

First Post
I was looking at the Xp/level chart in the PHB, and it goes in chunks of 4 levels too. It also seems to change to a different formula from level 22 up.

Up to level 21, it looks like the formula for the amount of Xp you need to gain to get to the next level is...

Code:
=(250*MOD(G1-1,4)+1000)*2^INT((G1-1)/4)
It's not perfect. You need 500 more than it says at level 10, 4000 more at 20, and 3000 more at 21. It's a work in progress though, and I need to sleep. So I figured I'd throw it out for whomever would like to continue playing with it.

Basically, it looks very similar to the magic items, except the base increase is 250 instead of 160, it starts at 1000 instead of 200, and it increases by factors of 2 instead of 5.
 


Remove ads

Top