Copying the important bits from my highly detailed forum thread for ease on the eyes.
https://forums.dust514.com/default.aspx?g=posts&t=96217
#1Posted: 2013.07.21 16:56 | Report
3
NOTICE: This is going to bevery long, very complicated and readers who dont care to read all of it may want to stay away.
This thread isregarding Skills and how they apply to items and their overall impact on your resources for your dropsuit. Ill try to be as brief as possible but theres a lot to cover in this.
First of all.. Skills apply different bonuses to different things and this is good. However, theres some discrepancy and important stuff not mentioned. We'll look at Assault Rifles as our main example. When used on a Gallente Assault Suit, theres a 5% reduction to CPU/PG needs. Lets focus on that CPU requirement for a bit. When combined with Light Weapon Operation theres a 3% per level reduction.
Its important to understand that those values dont work in tandem and what I mean by this is the percentages dont add. Lets say I hve Gallente Assault Suits 5 and Light Weapon Operation 4. Their values are -25% and -12% accordingly, which when combined add to -37%, but the reduction is based on the result, not the total. Heres an example:
Duvolle Assault Rifle
Gallente Assault 5: 90 x .75 = 67.5
Light Weapon Operation 4: 90 x .88 = 79.2
Combined Bonus of Two Skills: 59.4
This is because each skill operates separately, reducing from the result of the previous. It works in any order as basic math applies and the formula is the same either way. Now if it had reduced from the total, the end result would be 56.7, 2.7 less than thecurrent value.
Bear in mind that these results are rounded off, so 59.4 is actually 59. Had it been 56.7 it would have been rounded to 57. This is important as this is going to heavily affect our next example.
Now that that is out of theway we can move on to the important bit. How these skills apply to your suit. Be aware, readers, that Nanohives benefit from a stealth bonus from Nanocircuitry as a 5% CPU reduction per level that isnt stated on the skill. I have a separateforum thread regarding this.
Im going to list a fitting and with each item Im going to list the actual CPU cost and the skills associated that reduce the value.
Example Suit:
Gallente Logistics G-I (5% reduced CPU/PG for equipment per level) skill level 1.
Duvolle Assault Rifle (Light Weapon Operation 4): 79.2
Hacked EX-0 AV Grenade (Explosives 3): 21.25
K-2 Nanohive (Nanocircuitry 3): 33.915
K-2 Nanohive (Nanocircuitry 3): 33.915
K-2 Nanohive (Nanocircuitry 3): 33.915
Total CPU Cost: 202.195
Now, because each item is rounded off to whole numbers individually..
Actual CPU Cost: 204
Basically what this means is if you've ever been short one CPU or one PG on a tight fit, its almost inevitably because the items are rounded off rather than calculated via a decimal system. The actual values are less than what they really are. This problem was recognized in Eve Online and thats why Ships have 000.00 as their CPU/PG format as the fittings, being unbelievably tight in some cases, needed the decimal system to provide room for the numerical values.
This is most noticable for Veteran players who have skills at level 5 when their suit needed -just one more- and inevitably find that they wasted hundreds of thousands of skill points for no gain as the value was still rounded off in the end, whereas if it were decimals they would have had the necessary room to complete their perfect fitting.
#14Posted: 2013.07.21 19:03 | Report
Here's what my friend on Eve Online, Verik dra'Har, has to say:
"The problem here isn't that they're rounding, but that they are
rounding everytime something new is applied to save memory space on
the server.
An integer takes up four bytes of space in memory, whereas a double
takes up eight. Double precision math is what you refer to as decimal.
In a computer decimal math and integer math are totally separate and
integer math is much, much faster. In fact, double precision math
being slower is the entire point of a GPU which amounts to specialized
hardware that just does math.
Size of char: 1
Size of int: 4
Size of short int: 2
Size of long int: 4
Size of float: 4
Size of double: 8
Size of wchar_t: 4
In theory they could switch to floats, but that would require a ****
ton of hand edits to the codebase since they're a pain in the ass to
work with in some cases. A float is a double but smaller. It's also a
decimal number, but takes less space i nmemory. It also requires
special notation in code most f the time which is why no one uses them
for the most part.
Problem is, you're talking a **** ton of man hours to edit the code
for float friendliness. The switch from int to double would take one
guy about 20 minutes. So, the fix is dependant upon how player files
are stored in memory, stored in file/database, and when those
calculations are actually made.
Basically, the calculations need to all be done in one single line of
code and rounded at the very, very last second when stored.
For an unfixed amount of mods, because why do math when the answer is
just 0 since you don't have skill/modifier, you just dont't know how
many modifications you are going to have to make. So as modifications
are discovered, each calculation happens separately until you run out
of necessary calculations.
The most liekly scenarios where you store the mods in a list, now we
discussed that everything is probably stored as a whole number
(integer) for space/efficiency. Those long lists of equations cann0ot
be performed on a computer unless there's a fixed amount. Not in one
single line which would result in an optimal calculation. You have to
loop through the list performing a single calculation on each
mod/member of that list, which results in rounding every time, which
is how this error occurs.
How to fix this without changing the codebase big time? Can't without
making the final result a double.
On a character load, the current values for the items you own are
loaded in from the respective item database, skill mods applied, etc.
This way nothing you do to your character actually effects anything
but your character.
1.) They could change the value thats stored in the player file memory
to a double with some code edits.
2.) they could change it to a float to use the same amount of memory
space as an integer, but that would require a larger series of code
dedits depending on the language they used but since it's probably
C/C++ floats are typically a pain in the ass to use.
So it's not a rookie error, it probably was a decided trade off
between player convenience and efficiency and you lost out. At least
now you know, and can explain, why it probably is happening."
No comments:
Post a Comment