Z
Z
Zerstoren2012-08-13 15:19:59
Algorithms
Zerstoren, 2012-08-13 15:19:59

Choosing a price increase algorithm

I am writing my strategy now and one of the chips is the creation of armor / units with their own unique parameters.
And naturally, the higher the parameter, the more expensive it will cost.

I came to a dead end when the question went beyond the price increase algorithm itself.

The first time the eye fell on the percentage increase. But I quickly abandoned it, because. he has a big flaw.
When the parameter rises by 1,2,3 levels, the price almost does not change, but when the level changes by 1000 points (yes, this is also possible), then the prices rise from the conditional 1000 coins to 1kkk or more, which is not very good.

The second option was to use a fixed price per level. But then I came across a nasty bug.
For example, a unit has an Agility stat that costs 1200 coins and has an armor that has an Agility stat that costs 1000 coins per level. If the player merges -100 character dexterity and adds them to the armor, then he will receive 200 coins, at each parameter level.

I cannot make the same price everywhere, because making plate armor with very good maneuverability is almost impossible, so the price for the dexterity parameter will be very high, and it is difficult to add resistance to hits on leather armor.

Maybe someone has experience in solving similar problems?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Singerofthefall, 2012-08-13
@Zerstoren

Try something like this.
For each stat in each armor, you need to set something like "rarity" or "value". For example, on heavy armor, the mana bonus will be almost worthless, and the bonus, for example, to hp, will be expensive.
Next, select some function by which the price will increase depending on the value of the attribute. If your attribute grows slowly at first, and then “accelerates” (for example, normal armor at level 5 is 10, at 10m - 20, and at 15 - immediately 100), then some logarithmic function will probably suit you. If, on the contrary, it rarely grows at first, and then slows down (for example, at level 5 - 10, at 10 - 20, at 15 - 27, at 20m - 30, etc.), then some exponential function will do.
Well, then you can calculate the price change for each attribute depending on this function, multiply by the "utility" coefficient for the attribute, and get the price.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question