willcast / shifterdx

Automatically exported from code.google.com/p/shifterdx
0 stars 0 forks source link

Line 904 in AugmentationDisplayWindow.uc increases accuracy of all ranged weapons... intentional? #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In AugmentationDisplayWindow.uc on line 904:

mult = FClamp(weapon.currentAccuracy * 60.0 * (width/640.0), corner, 60.0);

The original line is:

mult = FClamp(weapon.currentAccuracy * 80.0 * (width/640.0), corner, 80.0);

The change made from the value 80 to 60 has the effect of increasing the 
accuracy of ranged weapons... effectively making the game easier by reducing 
the need to train weapon skills.

This change is present in the code since r4, when the mod was in beta...

Is this change intentional?  It seems unlikely, since it is undocumented.

Original issue reported on code.google.com by surma.an...@gmail.com on 3 Mar 2011 at 1:05

GoogleCodeExporter commented 8 years ago
Nevermind... 

I see it was intentional, since weapon accuracy is decreased as the screen 
resolution increases.  60 isn't perfect, but neither will any other value at 
different resolutions.

Original comment by surma.an...@gmail.com on 4 Mar 2011 at 1:11

GoogleCodeExporter commented 8 years ago
Actually... 

With values of 66, @1680x1050 it matches up perfectly with the cross squares 
@640x480!

Hahah!  I am so persistent!

Original comment by surma.an...@gmail.com on 4 Mar 2011 at 1:59

GoogleCodeExporter commented 8 years ago
Hey man... problem solved.  Here's the code:

w = width;
h = height;

.
.
.

aspectRatio = w / h;
accuracyMultiplier = 80;      // 80 was original, 60 is Shifter

if (aspectRatio == 1.6)       // DJ: 16:10 aspect ratio
{
     accuracyMultiplier = 66;
}               
else if (aspectRatio == 1.25) // DJ: 5:4 aspect ratio
{
     accuracyMultiplier = 85;
}
// else: assume 1.33 aspect ratio, so stick with 80

// mult = FClamp(weapon.currentAccuracy * 80.0 * (width/640.0), corner, 80.0);
mult = FClamp(weapon.currentAccuracy * accuracyMultiplier * (width / 640), 
corner, accuracyMultiplier);    

Original comment by surma.an...@gmail.com on 4 Mar 2011 at 5:47

GoogleCodeExporter commented 8 years ago
Someone else will have to test 16:9... I can't do it (hardware limitations)

I'll take a wild guess and say 60 

Original comment by surma.an...@gmail.com on 4 Mar 2011 at 6:01

GoogleCodeExporter commented 8 years ago
// other if statements
.
.
.

else if (w >= 1920.0) // assume 16:9 aspect ratio (leaves out people on 
1280x720 though)
{
     accuracyMultiplier = 60;   // Just a guess ;)
}

Original comment by surma.an...@gmail.com on 4 Mar 2011 at 6:09

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
1.33 = 4:3

Original comment by surma.an...@gmail.com on 9 Mar 2011 at 2:59

GoogleCodeExporter commented 8 years ago
Wow, good catch.  This is a rather neat solution to the issue.  I'll tweak it a 
bit so it can account for any oddball aspect ratios with a best-guess solution. 
 Thanks a lot.

Original comment by yukichigai on 18 Jul 2013 at 1:06

GoogleCodeExporter commented 8 years ago
Yeah, got it.  accuracyMultiplier should just be Round(106.0/aspectRatio).  
Pretty slick.

Original comment by yukichigai on 18 Jul 2013 at 1:10

GoogleCodeExporter commented 8 years ago
Oop, actually I realized something: that 60 was adjusted to bring the reticle 
size inward to match the absolute outer edge of where bullets can go.  This is 
on a 4:3 screen.  It doesn't actually improve weapon accuracy, it just makes 
the display more truthful regarding where bullet distribution is.

Given this, the code should actually be 80.0/aspectRatio

Original comment by yukichigai on 18 Jul 2013 at 1:22

GoogleCodeExporter commented 8 years ago
Welp, so much for that theory.  Turns out the code ALREADY corrects for aspect 
ratio stuff.  I checked the 60 value against a variety of resolutions and 
aspect ratios using the laser sight.  The laser sight simply adjusts its Pitch 
and Yaw (rotational components) randomly based on the raw accuracy value of the 
weapon, which (I did check) isn't based on resolution or aspect ratio.  The 
hardcoded 60 value keeps the reticle's edge lines EXACTLY lined up with the 
range of the laser dot no matter what the resolution or aspect ratio.  
Shifter's current accuracy calculation uses a similar formula.

In short, no fix needed, working as intended.

Original comment by yukichigai on 18 Jul 2013 at 1:50