Back in the late 1990s I was working on a game inspired by the old BBS game Trade Wars 2002. I was looking to have a more advanced value system for traded goods. The other day I was interested in the algorithm I had come up with because I knew it was rather strange. So I decided to find the code and graph the value function I had created. Here is a graph of the function I created.
The purpose of the algorithm was to produce a monetary value based on several attributes that summed to an overall quality rank. Think of this like a gemstone where 100% would be completely flawless and 0% complete flawed. One of the attribute flags could change the value by a scale factor.
When I wrote this algorithm I didn’t know much about the curving numbers. I setup a kind of liner piece-wise function. Six of the steps are fairly obvious: 30, 50, 80, 92 and 98. Probably less intentional were the last two steps. The first happens at 19/32768, and the second 448/32768. My goal was likely to make the slope toward zero more gradual near the end, but since I didn’t understand graphing a function the actual results were not at all what was expected.
The graph is shown on a logarithmic scale so the nuances like the strange end are clearly visible. All the values are actually linear and the curves of (like the one from 2% to 30%) is just a result of the logarithmic scale.
By varying the coefficients a, b, and c I would have a continuous function that curved. The exponential function
will produce the following graph which is fairly close to what the game would have needed.
Like most of my programming projects the game never amounted to much more than a concept. I spent more time fighting with the 640 KiB barrier at the time than doing much development work. It is interesting to look at how I approached math problems when I didn’t know any formal math outside of arithmetic.