I'm currently developing a game that is meant to be very similar to mining games such as Motherload and Miner Disturbance. If you haven't heard of them before, the main goal of the games is to dig down underground to gather ores that gives the player points that can be used to upgrade their gear, or just achieve a higher score. The ores you find change as you get further down, with rarer ores becoming more common the further you progress.
My game involves the same system, though I am struggling on coming up with an algorithm to achieve it. I have never implemented something like this before so I am unaware if there is actually an optimal way to implement this type of system. My current attempt of it has specific ores having a Common Depth variable that is used to say at which depth the ores are the most common. So at their specific common depth, the ore will have a 100% chance to spawn, which will decrease as the player is further away (Either being at a higher or lower depth). This from what I can understand should be fine, though It's checking the distance between the current achieved depth and that common depth which is where I'm really struggling.
Currently I get the distance between the depth of the block the ore will be placed within and the common depth by simply Common Depth - Depth. I then use this offset/distance to get a percentage away from that Common Depth by (DepthOffset / Common Depth) * 100 to see if that type of ore should spawn. The main issue comes when we start getting to much larger distances. For example: I have a Copper ore that has a Common Depth of 1. I want it to be the first ore the player encounters and something that while get rarer as they get deeper, is still present in much smaller amounts. At a depth of 1632, the percentage chance to encounter the copper ore becomes 163200%. Obviously I can understand why, dividing 1632 by 1 (The Common Depth) * 100 isn't going to give anything ideal but I'm honestly just not sure how to handle these depths with much higher distances. At this point I am basically asking for maths help as I'm unsure about how to change the algorithm to solve this problem. I have tried several things such as capping the percentage but that doesn't help either.
I'd really appreciate any maths help, but also any possible recommendations for other algorithms to use would be amazing. While I don't see an issue with the system I've implemented (Aside the maths), I strangely feel that it isn't ideal.