For example, you might have a gun that costs 500. Then to upgrade, 2000. Another upgrade could set you back 8000. Is there a reason to this rhyme? My simple solution would be this. You are upgrading from level 5 to level 6. We will call the level n. (n*1000)2
Therefore, the upgrade cost would be 36000 while the next one would be 49000. But I don't like that.
Does anyone have anything better? Maybe an asymptotic doohickey?
Another method of looking at it is to establish a window of opportunity for the gun, say player level five to player level five + 10 hours, and how much money the player will have made during that time -- perhaps a million credits average. At this point the developer can then decide how expensive the gun will be. Maybe the gun is a very expensive item to the player, and we want the total upgrade cost to consume 1/3 of all the money the player would make in that window. So 1/3 of 1 million, rounded to approximately 300 000 credits to reach level cap for the gun.
Breaking up the individual level-ups within that time line is just a matter of marking off points on the 300 000 credits where the level ups will occur. Maybe thinking a bit about what's going on during that segment of time, and how much the player will have, and what else the player wants to spend it on.
After roughing out the price points, then it's possible to create a formula that maps closely to the desired values.