I have some DOT (damage over time) implementation problems. My game runs on 30 FPS speed. Current implementation is: let's say the hero castcasts a spell which makedeals 1 damage per second. So onOn every frame iI do (pseudo code):
damage_done = getRandomDamage() * delta_time;
I accumulate damage and when it becomes more thenthan 0 then, I subtract rounded damage from current health and so on. With 30 FPS and 1 DPS it will be 1/33 = 0.05... We know that floats aare not precise enough to sum 30 circulating decimals and have exactexactly 1 in the end. But HP is a discrete value and that's why 1 DPS will not haveresult in 1 damage after 1 second, because the value will be 0.9999....0.9999... instead. It's not sosuch a big deal when you have 100000 DPS - +/- 1, ±1 damage will not be noticeable. But what if iI have 1, 55 DPS? How do modern RPG's implemented DOT'sRPGs implement DOTs?