Author Topic: [Suggestion] sqr formula for throwing range  (Read 3090 times)

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
[Suggestion] sqr formula for throwing range
« on: May 10, 2019, 05:21:05 am »
I think it would help immersion (and balance) to have a more realistic shorter throwing range, as an option to be enabled by modders. Grenade launchers seem kinda redundant when you can accurately throw your grenades across the whole map anyway.

According to https://www.ufopaedia.org/index.php/Throwing_Accuracy#Throwing_Distance, throwing distance is about:
2.5 × Strength / Weight

I would suggest a sqare root funtion:
10 x sqr(Strength) / Weight

resulting ranges for a weight 3 item:
str 70 - 27 tiles
str 60 - 25 tiles
str 50 - 23 tiles
str 40 - 21 tiles

Might still be a bit too much range...

While we are at it we could add some more throwing ruleset functionality, I think these don't exist yet:
- custom range multiplier for underwater environment
- min/max range parameter for throwing
- throwing aim range dropoff, default if enabled something like range 15, dropoff 3

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [Suggestion] sqr formula for throwing range
« Reply #1 on: May 10, 2019, 08:55:59 pm »
Some thing like this could be done by scripts, this is simple calculation task, that scripts can handle fine.
It could do even more, each armor could have different throw ranges (or per item).

[ps]

After fast looking on code, I see that logic is bit more complicated: https://github.com/OpenXcom/OpenXcom/blob/master/src/Battlescape/ProjectileFlyBState.cpp#L693

Nowhere in code we have `2.5 × Strength / Weight` it only have `dz -= (double)(50 * weight / strength)/100;` in loop.
« Last Edit: May 10, 2019, 11:02:07 pm by Yankes »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9089
    • View Profile
Re: [Suggestion] sqr formula for throwing range
« Reply #2 on: October 08, 2020, 08:21:47 pm »
While we are at it we could add some more throwing ruleset functionality, I think these don't exist yet:
- custom range multiplier for underwater environment
- min/max range parameter for throwing

See here: https://openxcom.org/forum/index.php/topic,8273.msg132698.html#msg132698