MOrlando616
New member
- Joined
- Mar 29, 2019
- Messages
- 7
The title is probably grossly misleading. I have a programming task to implement a poison in a game. The poison will deal some amount of damage (say 200 damage) over some amount of time (say 15 seconds). It will deal damage every tick (say a tick is every 1 second, so 15 ticks of damage that will total the full 200).
The tricky part is, I want the damage to start off low and increase in severity as the poison reaches its full duration. To be linear, I can simply divide my total damage by the number of ticks, and that'll be how much damage each tick will deal. Another problem, however, is that the duration and damage can be upgraded, and so a tick may not cleanly fall onto the duration (maybe some damage left over, which I can just add to the last tick to compensate if that makes sense).
So x damage over y seconds, dealing damage on each tick (which is every z seconds)...but starting at a small value, like 2, and increasing until the last tick is something like half the damage (or 100). These numbers are arbitrary, I haven't done any balancing yet, but I can't wrap my head around calculating a curve for the values. Do I use log? Some exponential thing? I have no idea!
As an example: 200 damage over 10 seconds with a 1 second tick.
2, 4, 6, 10, 14, 18, 24, 30, 40, 52 (These values I just came up with by hand, but that helps convey what I want).
Thanks in advance!!
-Matt
The tricky part is, I want the damage to start off low and increase in severity as the poison reaches its full duration. To be linear, I can simply divide my total damage by the number of ticks, and that'll be how much damage each tick will deal. Another problem, however, is that the duration and damage can be upgraded, and so a tick may not cleanly fall onto the duration (maybe some damage left over, which I can just add to the last tick to compensate if that makes sense).
So x damage over y seconds, dealing damage on each tick (which is every z seconds)...but starting at a small value, like 2, and increasing until the last tick is something like half the damage (or 100). These numbers are arbitrary, I haven't done any balancing yet, but I can't wrap my head around calculating a curve for the values. Do I use log? Some exponential thing? I have no idea!
As an example: 200 damage over 10 seconds with a 1 second tick.
2, 4, 6, 10, 14, 18, 24, 30, 40, 52 (These values I just came up with by hand, but that helps convey what I want).
Thanks in advance!!
-Matt
Last edited: