When designing the costing for the building I stumbled upon the official cookie clicker building cost wiki page and copied the formula from there. Or so I thought.
Here is the original formula:

Fig1
cookieclicker.fandom.com/wiki/Building
The formula is fairly straightforward. I was able to completely omit the need for “F” as I don’t currently have any options for free buildings. Here is my formula:

price = Math.ceil(originalPrice * exponent * buildingAmount));

Notice any issues?

In hindsight, this was a silly error as I completely read the formula wrong. I should have multiplied the exponent by the buildingAmount.

Fig1
Fig 1

Figure 1 shows the error in my formula compared to the official game. As you can see, mine is very linear with a more expensive start up but leading to easier prices later in the game.

But this is a simple fix with:


price = Math.ceil(originalPrice * Math.pow(exponent, buildingAmount));
Fig1
Fig 2

Figure 2 shows the original pricing along with the new pricing. They are now identical, which is cool.

I then changed the exponential value to 1.2. Figure 3 shows the result of this. The new pricing is a lot more costly.

Fig1
Fig 3