How to avoid multiplication by 0 and 1 in incremental game

I’m trying to make a simple incremental game where there is cash, multiplier and so on.

I’m a bit dumbfounded by this formula z.Value = x.Value * y.Value. I have seen it on multiple websites as just multiplying the values like this will work.
Let’s say “z.Value” is is value that passively generates income. Then “x” is base value (1) and “y” is multiplier (0-2). If multiplier is 0 then you have no income at all and the game doesn’t work. If multiplier is 1 then it’s the same as the multiplier not being there at all. If the multiplier is 2 it works.

So what am I missing? I tried using math.ceil on 0, but that doesn’t work and doesn’t solve the issue of 1.

That’s the wrong formula - or at least, it’s not entirely correct.
The formula you’re looking for is: realIncome = baseIncome * (1 + multiplier), where multiplier is percentage/100.

So if my baseIncome is 100 and I am getting a 1% multiplier, my result will be:
100 * 1.01 = 101

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.