Coder Social home page Coder Social logo

Comments (12)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 4 Mar 2011 at 1:11

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Actually... 

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

Hahah!  I am so persistent!

Original comment by [email protected] on 4 Mar 2011 at 1:59

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 4 Mar 2011 at 5:47

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 4 Mar 2011 at 6:01

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
// 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 [email protected] on 4 Mar 2011 at 6:09

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
[deleted comment]

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
[deleted comment]

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
1.33 = 4:3

Original comment by [email protected] on 9 Mar 2011 at 2:59

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Yeah, got it.  accuracyMultiplier should just be Round(106.0/aspectRatio).  
Pretty slick.

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

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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

from shifterdx.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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

  • Changed state: Invalid

from shifterdx.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.