In this section I will be just going over some very simple diminishing returns functions for starters. There are all kinds of expressions that can be used, so I am not going to even start to scratch the surface here. However one has to start somewhere when it comes to this sort of thing.
There are making full featured like functions where I can pass a min, and max value, along with an additional argument that is the current skill point amount. However those kinds of functions stroke me more so as additional functions that have expressions that would involve calling a diminishing return function actually. The core of the idea here I think is to have a function that returns a value in the range of a fraction between the values of 0 and 1. That is that the function would have at least one argument that is the value of the skill points invested in an upgrade, and as that value goes up the return value will approach, but never truly reach 1. Failing that it should at least require a very large number to get to one to say the least.
So right away there is just thinking in terms of fractions, where I just divide 1 b the given skill point value, or for this example say the skill point value is an argument called n. When diving 1 over n, as n approaches positive infinity, the return value will approach but never truly reach zero. This is similar to what I want, but I want to approach 1, which is no big deal as I can just subtract this return value from 1 to get what I want. There is then just maybe adding 1 to n in a group to address an issue when a value of 0 is given for n.
This is more or less the basic idea of what I would want. However I would not stop here, as I would likely want to adjust things at least a little when it comes to getting this kind of value to be used in a larger expression in an additional expression that uses this. That is that when I give a value of 500 I get a value that is very close to 1 all ready, this might not be a big problem if the skill points come slowly in the game, otherwise it is a problem as it allows for a player to advanced to fast maybe. So maybe there is a need for some additional basic examples on this, that have at least one additional argument that will effect the rate at which the return value approaches 1.
This example of a diminishing returns function is just slightly more advanced then the one that I just coved above.
So now that I got the basic out of the way, it is now called for to take a look at some quick use case examples of this kind of function. So far I would use this kind of function when it comes to game development as it is a great way to make it so that there is a way to keep getting stronger over time as a player keeps spending more and more time playing.
This is an example in which I am using a diminishing returns value to create another value that I might use to set some kind of value for an object such as an attack property.
So far the concept of a diminishing returns function is the kind of function that might come up when making source code for a game, typically code that has to do with an experience point system, or code that closely tied to such a system.