Grid Sage Forums

Cogmind => Bugs => Fixed Bugs & Non-Bugs => Topic started by: R-26 Lightspeed on March 28, 2024, 12:03:29 PM

Title: [Beta 13] (Spoilers) Momentum melee modifier isn't applied accurately
Post by: R-26 Lightspeed on March 28, 2024, 12:03:29 PM
As visible in the attached screenshot, i have 3 momentum and am moving at a speed of 22 (454,545454...%), which means my melee modifier should be ((3 * 454 / 1200) * 40) = 45.4%, which caps to 40%, which means this can't be some issue where the value would be 39.99 and then be visually rounded up in Cogmind's stats.
Despite having a 40% melee modifier, my 50-100 melee weapon only goes up to 69-139 instead of 70-140.
Title: Re: [Beta 13] (Spoilers) Momentum melee modifier isn't applied accurately
Post by: Kyzrati on March 29, 2024, 08:48:38 PM
Yeah this can happen in some Cogmind combat calculations. It is being applied correctly there, but because it involves decimal math and there is no attempt to ensure that the results of said math don't end up truncated due to, well, computer math, it's possible to lose a 1 in some instances. It is consistent though. The result of 50*1.400000000 is actually not quite 70, and the same formulas are used throughout, so what it shows is what you get (your actual damage range is as displayed).

Personally I would prefer to only use integer math for absolutely everything, and tend to in the vast majority of places, but combat in particular ended up using decimal math for some things early on, and continued that trend rather than try to rewrite it all.