diwako / armor_plates_system

Standalone Arma 3 Alternative Medical System
Other
7 stars 9 forks source link

Add down timer regen by direct calculation #91

Open amsteadrayle opened 2 years ago

amsteadrayle commented 2 years ago

Cleaned up and implemented on newest master branch.

diwako commented 2 years ago

I am not sure what this does. Can you explain. A coefficient is always a multiplied thus linear, I am seeing a square root in here so I am doubly confused.

amsteadrayle commented 2 years ago

Oh yeah, I forgot to include an explanation. The original iterative regeneration process can be approximated with an equation: $d' = \sqrt{d_0^2+c\cdot 2\Delta t}$ $d'$ - New down timer $d_0$ - Unmodified down timer $\Delta t = t'-t_0$ - Time since last down - Current time minus time of last down $c$ - Regen coefficient

To hopefully make the process clearer in the code, I'm doing it in two steps with $regen=d'-d_0$ then $d'=d_0+regen$. Here's a spreadsheet you can copy and tinker with.

diwako commented 2 years ago

NGL that sounds way too complicated

diwako commented 2 years ago

See it in a perspective of a player. How do you think this will work if you never interacted with it before?

amsteadrayle commented 2 years ago

That's fair. What do you think about having a down timer regen speed and regen acceleration? Speed would be a simple linear increase, and this formula would be the acceleration. The speed is easy to understand as a baseline and the acceleration can then be "this part makes it goes faster when you're almost dead".

This is also the kind of thing that would only be tweaked by an admin every once in a while, so being complicated shouldn't be a big problem.

diwako commented 2 years ago

An admin is also a player. If you need a spreadsheet to figure values out, then it is too complicated.

amsteadrayle commented 2 years ago

Do you think the accelerating down timer recovery is worth having? I really like it, but it's your call. I haven't found a simpler way of expressing that kind of behavior. Danvers was the one who original devised it, so we could see if they have any ideas.

In the mean time, I can implement the constant rate recovery easily enough, if we want to get this out and come back to the acceleration later.

diwako commented 2 years ago

The idea itself sounds good. it is just a bit convoluted atm. Coming up with an easier calculation would be the key.