trait 'Long Stride' effect description inaccurate
issueid=1371 12-03-2012 01:20 AM
Ancient Member
Number of reported issues by Mobius: 63
trait 'Long Stride' effect description inaccurate

Long Stride talent 'movement costs 950 energy points'
However, when I use :t to show the energy used, it says 952.

This is a bit odd. Only a 1/500 difference, but ??? It could save me!

I happen to be Sick and Satiated, current speed 99.
Issue Details
Issue Number 1371
Project ADOM (Ancient Domains Of Mystery)
Category Mac OS X 10.4
Status Won't Fix
Priority 6
Affected Version ADOM 1.2.0 pre 5
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 3
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




12-03-2012 01:46 AM
Ancient Member
From the ADOM manual:

Note that the 'energy cost for the last action' display option does not necessarily show the expected value for energy costs below 1000. This is so because ADOM's internal rating system for action costs relies on relative measurements (e.g. if your potion of speed results in an 800 energy point cost for movement and due to your class you also would be able to move for 800 energy points, this is scaled to a cost of 100000 / {100 + [(100000 / 800) - 100] * 2} = 666 energy points). If you don't understand the formula, simply look at the source code. ;-) Not understanding it is *not* a sign of being stupid ;-))

12-03-2012 03:44 AM
Ancient Member
100000 / (100 + ((100000 / 950) - 100)) =
100000 / (100 + (105.26 - 100) =
100000 / ( 100 + 5.26) =
100000 / 105.26 = 950.02

Since I didn't have a potion of speed, or other effect modifying speed, I don't understand.

12-03-2012 05:26 AM
Ancient Member
It's not straight forward what the 100's in the formula represents, but you said your's was 99.

12-03-2012 10:20 AM
Pim Pim is offline
Member
I have a speed of 105 and the Long Stride talent, and also end up with 952 for the actual energy cost, which is different from the advertised 950. Therefore I am voting for "able to reproduce this bug." ;)

Also, it has been this way in every version I can remember since talents were added.

12-03-2012 02:25 PM
Ancient Member
N.B.: I mention this only because it differs from the behavior of movement modifiers due to class. The barbarian move cost goes to exactly 750 at level 12, as do the other class level abilities.

Mumble something about 'limited floating point precisions' and 'reverse the polarity of the neutron flux' and I'll withdraw the issue.

12-03-2012 04:07 PM
Ancient Member
Please disregard my previous post, too early in the morning, only one cup of coffee situation.

I can confirm speed of 117 and energy of 952.

12-03-2012 08:02 PM
Ancient Member
Perform that calculation with integers (the decimal part of the result and every subresult is truncated after every step), and it indeed gives 952:
100000 / (100 + ((100000 / 950) - 100)) =
100000 / (100 + (105 - 100)) =
100000 / (100 + 5) =
100000 / 105 =
952

100000 / 950 = 105.26... which is 105 truncated, causing somewhat severe rounding error. Again 100000 / 105 = 952.38... which is truncated to 952.


If done without rounding, it of course gives exactly 950:
100000 / (100 + ((100000 / 950) - 100)) =
100000 / (((100000 / 950) - 100) + 100) =
100000 / (100000 / 950) =
100000 * (950 / 100000) =
950 * 100000 / 100000 =
950

12-03-2012 08:43 PM
Ancient Member
Quote Originally Posted by Sami
Perform that calculation with integers ...
ah, you are right. So the description is indeed inaccurate, but within tolerance I suppose.

Probably too late to suggest using floating point throughout the system.
Look, a [+1.302, +5.9] long sword! Does 2.4d6.24 of damage.

12-03-2012 08:51 PM
Ancient Member
If you are correct, then it only applies to Long Stride.

Barbarian class 12:

100000 / (100 + ((100000 / 750) - 100)) =
100000 / (100 + (133 - 100)) =
100000 / (100 + 33) =
100000 / 133 =
751

12-08-2012 07:35 AM
The Creator
I don't think it's worth fiddling with the integer calculations to get this fixed.

12-08-2012 08:09 AM
Senior Member
Quote Originally Posted by adom-admin
I don't think it's worth fiddling with the integer calculations to get this fixed.
So perhaps make a minor adjustment to the description, instead? Something like...

"movement costs approximately 950 energy points"

Adding the "approximately" makes it clear that it's not an exact number.

12-11-2012 02:33 PM
Ancient Member
Accuracy of the formula can easily be increased (also without fear of overflowing) by changing 100000 to 1000000 (add one zero) in the formula. With this change any single reduction will give exact result (single reduction as in applying any integer reduction on base value of 1000).

+ Reply