Author Topic: Range Calculator  (Read 8702 times)

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Range Calculator
« on: September 11, 2014, 09:52:27 AM »

The whole 'effective range' thing isn't all that clear to me, and I don't think I'm the only one with this problem. So I cooked up a tiny program to make the math for you. Can't say if it's all correct - it's based on the info in the wiki alone.

Python source (will need Python 2.x, not sure it it's 3.x compatible):
http://pastebay.net/1494622
Windows binary (py2exe):
https://www.sendspace.com/file/vqbh5y
Screen (Warning! Ugly Tkinter!):
Spoiler for Hiden:

If You like it/use it donate a bottle cap to any random, new player.

EDIT:
Links replaced, there was a small error and the displayed values where off by one.

EDIT2:
Now the accurate perk gives +30%, new links above.
« Last Edit: September 18, 2014, 12:26:19 PM by 3.14 »
Logged

paragon

  • Guest
Re: Range Calculator
« Reply #1 on: September 11, 2014, 11:20:54 AM »

Yay! Great. Gonna use your work for character planner, may I?
Logged

baskila

  • Wastelander
  • **
  • Offline Offline
  • Posts: 117
    • View Profile
Re: Range Calculator
« Reply #2 on: September 11, 2014, 11:35:00 AM »

Interesting how much skill affects accuracy but i.e. 2 special point difference in PE effect is minor...
Logged

Fox

  • Wanderer
  • *
  • Offline Offline
  • Posts: 35
    • View Profile
Re: Range Calculator
« Reply #3 on: September 11, 2014, 11:37:08 AM »

Good job, pal, very useful thing. Thanks a lot.
Now it's time for charity.
Logged

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #4 on: September 11, 2014, 12:15:07 PM »

Yay! Great. Gonna use your work for character planner, may I?
Use it as you will. It's MIT license.
Interesting how much skill affects accuracy but i.e. 2 special point difference in PE effect is minor...
If the wiki is true then PE only affects aimed shots, or if you have less then 5 of it (perception not wiki - silly English).
Logged

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #5 on: September 11, 2014, 01:42:27 PM »

There was a small error, the value shown for range of 1 was really calculated for range=0. Links to a updated version are now in the first post.
Logged

Prosector

  • Wastelander
  • **
  • Offline Offline
  • Posts: 64
    • View Profile
Re: Range Calculator
« Reply #6 on: September 12, 2014, 11:26:17 PM »

Good job, this is very useful program if its reliable.
but the 'accurate' weapon trait aint modify anything for me at all. it may be a bug?
although PE, sharpshooter and scope only affects aimed shots. is it true? i'd be be glad if a dev have confirmed this! if true, i wont waste point on 'sharpshooter' perk or 'gain PE' (i have 8) cause its very marginal.
btw its funny that scope helps almost nothing for those who have very good eyes (Pe 10 + sharpshooter) + 250 skill, even for aimed shots
Logged

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #7 on: September 13, 2014, 03:58:59 AM »

the 'accurate' weapon trait aint modify anything for me at all. it may be a bug?
My bad. It is a bug. Fixed it in a new version (links in the first post).

I'm not sure how the scoped perk works wit scoped x2. x3 and so on. Should it give +2 PE, +3PE... and so on?

Also if the Devs would be willing to share the burst mechanics formula I'd add that as well.
Logged

Lidae

  • No Name Yet Team
  • Outdoorsman Veteran
  • *********
  • Offline Offline
  • Posts: 644
  • Wasteland scientist
    • View Profile
Re: Range Calculator
« Reply #8 on: September 13, 2014, 05:21:08 PM »

Scoped weapon perk only affects sight range, not hit chance. Also, weapon minimum strength affects hit chance as well.
Logged

paragon

  • Guest
Re: Range Calculator
« Reply #9 on: September 15, 2014, 09:09:06 AM »

Quote
Skill below 150:

baseHitChance = 0.95*(skill-50) + rangeModifier

Skill above 150:

baseHitChance = 95 + (skill-150)*4 + rangeModifier


The range modifier is given by:

Distance to target less than effectiveRange:

rangeModifier = 95*(effectiveRange - distanceToTarget)/effectiveRange

Distance to target greater than effectiveRange:

rangeModifier = 1000*(effectiveRange - distanceToTarget)/effectiveRange

And in your code you have:
        if distanceToTarget<effectiveRange:
            rangeModifier=95.0*(effectiveRange - distanceToTarget)/effectiveRange
        else:
            rangeModifier = 1000.0*(effectiveRange - distanceToTarget)/effectiveRange

if skill<150:
            baseHitChance = 0.95*(skill-50) + rangeModifier
            if perc<5:
                baseHitChance-=10
        else:

Are you sure about not strict comparisons in first cases?
Logged

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #10 on: September 15, 2014, 11:05:17 AM »

No, not sure at all :]
Logged

paragon

  • Guest
Re: Range Calculator
« Reply #11 on: September 15, 2014, 11:28:37 AM »

I'm gonna do it opposite way xD
Logged

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #12 on: September 15, 2014, 11:32:20 AM »

In the face of ambiguity, refuse the temptation to guess.
Logged

paragon

  • Guest
Re: Range Calculator
« Reply #13 on: September 15, 2014, 12:37:53 PM »

With weapon range 90 and skill 150 you have 95% at 61 hexes. I guess it's 1 hex away from right.
Logged

Prosector

  • Wastelander
  • **
  • Offline Offline
  • Posts: 64
    • View Profile
Re: Range Calculator
« Reply #14 on: September 16, 2014, 12:01:50 AM »

Isn't something wrong with sharpshooter? if i test with 3 PE+sharpshooter, it gives worse result than 5 PE without sharpshooter.
Isn't sharpshooter supposed to count as 2 PE?
Logged

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #15 on: September 16, 2014, 05:33:42 AM »

My bad. Here's a fixed version, but the fix was made on a phone, so it may be wrong.
pastebay.net/1494622
I'll post a exe when I'll make one (when/if I get home).

I'm starting to regret not putting it all on github.
Logged

PusiteGA

  • Phoenix Contributor
  • Outdoorsman Veteran
  • ****
  • Offline Offline
  • Posts: 501
    • View Profile
Re: Range Calculator
« Reply #16 on: September 18, 2014, 12:18:52 PM »

My bad. Here's a fixed version, but the fix was made on a phone, so it may be wrong.
pastebay.net/1494622
I'll post a exe when I'll make one (when/if I get home).

I'm starting to regret not putting it all on github.
so is the version at first post working or what ?

3.14

  • Wastelander
  • **
  • Offline Offline
  • Posts: 155
    • View Profile
Re: Range Calculator
« Reply #17 on: September 18, 2014, 12:27:00 PM »

Sorry, updated the post.
exe here: https://www.sendspace.com/file/vqbh5y
py here: http://pastebay.net/1494622
Logged

PusiteGA

  • Phoenix Contributor
  • Outdoorsman Veteran
  • ****
  • Offline Offline
  • Posts: 501
    • View Profile
Re: Range Calculator
« Reply #18 on: September 18, 2014, 01:18:52 PM »

 



SMF 2.0.2 | SMF © 2011, Simple Machines
Simple Audio Video Embedder - Theme by Crip