Home » PLAYER'S HQ 1.13 » v1.13 General Gameplay Talk » Handgrenades
Re: Handgrenades[message #278583] Mon, 25 April 2011 19:58 Go to previous messageGo to previous message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Looking at the code related to throwing, I can say that strength is used to determine range but not accuracy. It's also based on the weight of the item being thrown. The equations used as as follows:
iThrowingStrength = ( EffectiveStrength( pSoldier ) * 2 + 100 ) / 3;
iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));
So a merc with a 50 strength would have a iThrowningStrength of 66 and if this merc was throwning a "Mk2 Grenade" (ubWeight = 6) the iRange would be 15. This range is finally adjusted with the mercs current breath percent:
iRange -= (iRange * (100 - pSoldier->bBreath)) / 200;
This does allow for pretty excesive ranges but that's for game playability. If we limited throwing range to realistic values, they'd be completely worthless. Anyway, that's how maxThrowRange is calculated. Though I should point out that is really just the maximum "accurate" throw range. You can attempt to throw a grenade (or anything else) as far as you want to but you'll get significant penalties for doing so, as I talk about in the next section.


As far as accuacy, the base cth for throwing is based on MRK and Dex:
iChance = ( EffectiveDexterity( pSoldier ) + EffectiveMarksmanship( pSoldier ) ) / 2;
Morale, "fatigue" and throwing at the same target all have an effect. Also, there is a range modifier which is based on the actual range versus the maxThrowRange (calculated above). You can get up to a +50% cth against a target that is 0 tiles away which gets progressively lower the further the target is. At maxThrowRange, the modifier is -50% to cth, though it doesn't actually stop there. In a test I just ran, my target is 36 tiles away and my maxThrowRange is only 12. This results in a -250% cth. On top of this, throwing at anything beyond maxThrowRange results in an additional "cth/2" penalty. Though, considering the huge negative numbers you can be working with, this can actually result in a higher cth, though its still below 0 which makes it effectively 0. My test shot at 36 tiles (the -250% cth penalty) droped my CTH from 92% before range, to -158% after the initial range penalty and then to -79% after the "cth/2" penalty. But it's still less then 0 meaning I can't hit at all.

One thing I do notice is that there is a code fragment that grants a bonuse for aiming:
if (ubAimTime)
{
	iChance += (AIM_BONUS_PER_AP * ubAimTime); // bonus for every pt of aiming
}
But I don't know of any way to aim a grenade whether we're talking about thrown grenades or those launched from a GL or mortar (which seems to use the same system). Not that it would make a huge difference even if you could aim since the bonus really isn't significant enough to overcome the range penalties (AIM_BONUS_PER_AP = 10). Even if I could spend "5 clicks" aiming, that extra 50% isn't going to mean anything when compared to the -250% AND "cth/2" penalties I'm suffering for range. Though it would at least compensate for some or all of the range penalty when throwing at or withing maxThrowRange. But anyway, since you can't aim a thrown shot to begin with, this code is moot. And since allowing aiming for thrown shots would not be easy to do (not to mention cost effective since it does take so many APs to throw anything) maybe we just need to adjust the range penalty so that it isn't as extreme as it currently is.

Report message to a moderator

First Sergeant
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: JA2 1.13 - Runtime Error at launch
Next Topic: What is "External Attachment 2" for? Other BETA comments too...
Goto Forum:
  


Current Time: Wed Feb 19 04:00:49 GMT+2 2025

Total time taken to generate the page: 0.01325 seconds