3
\$\begingroup\$

I want this because I am making a game where you control a bunch of units, and each of them have different health and weapons. I want to make a weapon that deals damage to everybody on the enemy team, but to prevent spamming that unit it deals a specific damage type and each unit can only take a certain amount of damage from that unit every second.

Some things I have considered is having it be linear up until the cap, but that feels like the sudden stoppage of damage these units would do would be too abrupt. I have also considered doing something logarithmic with a hard cap.

My question is what other options are there that would make sense in this scenario?

\$\endgroup\$
6
\$\begingroup\$

Use a sigmoid curve, like these computationally cheap examples.

If you want a smooth approach to zero with no upper limit, use tangent.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.