I’m currently making a simulator game where you eat food to become bigger and bigger. Though I’m having problems with the sizes. I want it so that the size of the player is equivalent to the fatness you have. But if I were to just set the size to how much fatness you have, you would’ve become to big. I solved 1 issue, but then another one came. Sorry if my math or scripts really suck.
Edit: The result I want is those simulator games like Munching Masters Simulator
Edit 2: If you were wondering, I have been playing around and testing different values. None of them seem to work well.
Do you mean you want it to increase quickly in the beginning when you increase by 1000, but later when your size is already big you want the increments to be less?
You could try using math.log or any other variation of it like math.log10.
This math function decrements its increment as the value passed grows, which may be what you want, though the value of this function can be negative, so you’d have to do a few changes to it.
You could also use math.sqrt, which slowly decreases its increment as the value passed grows, in this case the value of the function is never negative.
If you don’t wanna use any of those options, you could do a simple condition chain to change how the size is calculated depending on how much fatness you have, example:
if fatness > 100 then
-- Formula to grow fast
else if fatness > 10000 then
-- Formula to grow slower
-- ...
end