Home » PLAYER'S HQ 1.13 » v1.13 General Gameplay Talk » Handgrenades
Handgrenades[message #278501]
|
Sun, 24 April 2011 14:51
|
|
Buns |
 |
Messages:655
Registered:September 2010 |
|
|
Not sure where to place this, Bug? Features? Refinement?
I think there is something wrong with the way throwing handgrenades is calculated. On the one side it seems my mercs are not able to throw handgrenades over more than 13 tiles. Taking weapon range for comparison, this is in fact a very extreme distance of 130 meter. Handgrenades are meant to be thrown at ranges of 50 meters and below; even Olympic throwing disciplines (spear, disc, hammer) don't reach 100 meters.
But then we have the enemy.... The largest distance I had measured for an enemy throwing a grenade was 25 tiles. But I had definitly seen them throwing grenades over even larger distances, in one occasion even over a house. Giving that standard maximum vision range is 26 and that enemies usually do not attack without visible contact, we can say that range to throw grenades for enemies seems to be unlimited.
Obviously this shouldn't be the case. Even the 13 tiles allowed for the player would be a bit to much, but acceptable for gameplay reasons. The 25+ tiles achievable by the enemy would be completly out of question.
The next question would be hitting: In most occasions I can be happy if the grenade lands in the same zip code as the target is in. Giving that throwing a grenade usually consumes most APs for a turn, and to not have them becoming useless ballast, I have developed a habit of save-load to repeat the throw until at least any enemy suffers some damage by the grenade - not demanding that it should be the enemy I actually had been throwing at. And even then I need four or five attempts - if not giving it up and making three aimed shots instead.
And then there is the enemy.... I cannot recall to ever have seen an enemy grenade obviously missing. I sometimes do witness them failing to go boom because of crappy status. But they always land right between the feet of the target (not knowing which character the enemy had been targeting, of course, but it's always a full hit on someone).
Both shouldn't be the case either. Most grenades have a radius of something around 5 tiles. They should neither usually land so far away for the player that they don't do any dammage at all (that would be more than 50 meters off the target), nor should there be a guarantee for the AI to have an easyer time hitting with handgrenades than with scoped rifles.
Another thing I notice, or rather "not notice", is any difference between the mercs. I would, for example, expect Ira to seriously suck at throwing grenades because of her low strength and marksmanship, and in return Ivan to be an excellent thrower. But that doesn't seem to be the case. Regardless whom I have throwing grenades the result always seems to be the same - or differences are so marginal that I cannot notice, or there are some many requirements involved that all mercs fail in the end? Also in this case it would be questionable how the enemy manages to pass them all all the time.
Report message to a moderator
|
First Sergeant
|
|
|
Re: Handgrenades[message #278583]
|
Mon, 25 April 2011 19:58 
|
|
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
|
|
|
|
|
|
|
|
Re: Handgrenades[message #278684]
|
Tue, 26 April 2011 18:59 
|
|
ctiberious |
 |
Messages:605
Registered:March 2007 |
|
|
A soldier with a 100 str has a throw range of up to 35 tiles IF the grenade being thrown is under ubWeight 3. Because of how rounding works, if a weapon has ubWeight 0-2, then you'd end up with "(Item.ubWeight) / 3" = 0. This means the break light and flare can be thrown up to 35 tiles with any kind of accuracy. If the weapon has ubWeight 3-5 (which is just the mini grenade) then it would have a top range of 25 tiles. Grenades with ubWeight 6-8 (stun, tear gas, mustard gas, mk2, smoke and flashbang) have a top range of about 20 tiles. All assuming a soldier with a 100 str. And this is just their "accurate" range. Beyond this max range, it's still possible to land a grenade but your CTH is all but nothing because not only are you being hit with a huge cth penalty, you're also getting your final cth cut in half.
Also, range is effected by breath/fatigue and stance. You lose a bit of range due to low fatigue:iRange -= (iRange * (100 - pSoldier->bBreath)) / 200; And you lose 30% of your max range if you're crouching:iRange = (iRange * 70) / 100; I tested a throw using Gus [STR 82, breath 83, crouching, throwing mk2 grenade) and he ends up with a 12 "maxRange". Although the red crosshair only went out to 9 tiles and I'm not sure why that happens.
Report message to a moderator
|
|
|
|
|
|
|
Re: Handgrenades[message #278719]
|
Wed, 27 April 2011 13:18 
|
|
Buns |
 |
Messages:655
Registered:September 2010 |
|
|
ChrisLGrenades with ubWeight 6-8 (stun, tear gas, mustard gas, mk2, smoke and flashbang) have a top range of about 20 tiles. All assuming a soldier with a 100 str. And this is just their "accurate" range. Beyond this max range, it's still possible to land a grenade but your CTH is all but nothing because not only are you being hit with a huge cth penalty, you're also getting your final cth cut in half. And that's what I am witnessing in game: The only grenades available in my mod are the Mills Bomb, MK2, Stielhandgranate and the three smoke-makers. The enemy I was able to measure was throwing a smoke grenade over 25 tiles and had it landing on the spot right in front of the closest merc.
I have been toying around with vision range, means enemies are now more likely to see my mercs at longer range. The result was that I was showered with grenades of all kinds, all thrown far, far beyond the range any of my mercs was able to throw, and all landing right between the feet of one of my mercs. The test only became further playable with denying the enemy grenades at all.
Quote:I tested a throw using Gus [STR 82, breath 83, crouching, throwing mk2 grenade) and he ends up with a 12 "maxRange". Although the red crosshair only went out to 9 tiles and I'm not sure why that happens. Well, that's at least a different result. In TB combat I only came up with 13 tiles flat for all. With two exceptions: Vicky already named and I had Ivan throwing a grenade from a roof over 17 tiles, otherwise I had not been able to get a red crosshair beyond 13 tiles for him either. And grenades thrown by my mercs at this distance are most likely to go wide (I am waiting for the first one acutally throwing it behind him).
Report message to a moderator
|
First Sergeant
|
|
|
|
|
Re: Handgrenades[message #278732]
|
Wed, 27 April 2011 19:10 
|
|
ctiberious |
 |
Messages:605
Registered:March 2007 |
|
|
Throwing from a roof to the ground does increase range, so Ivan throwing further in that situation makes sense. And keep in mind that the "maximum range of 35" is only for extremely light "grenades". Even the standard mini-grenade doesn't have a max range of 35 because of it's weight. As I indicated, break light and flars have a 35, mini-grenades have a 25 and all the other grenades have a 20. And that all assumes max strength, full health, full breath, perfect conditions and standing. I'll acknowledge that throwing a frag 200m is a bit ridiculous, but that's simply a game play thing, just like a pistol being able to accurately hit targets 120m away. If we made grenades have a realistic range, they'd be useless. And if we lower the current maximums, more "average" mercs wouldn't ever have the opportunity to use grenades without hurting themselves in the process.
As far as enemy soldiers throwing extreme distances, I've not encountered that in my test games. Of course, I almost never see the enemy throwing grenades at me at all. The only "grenades" they ever hit me with are break lights which do have a pretty extreme range.
Report message to a moderator
|
|
|
|
Re: Handgrenades[message #278793]
|
Thu, 28 April 2011 13:30 
|
|
Buns |
 |
Messages:655
Registered:September 2010 |
|
|
Quote:As I indicated, break light and flars have a 35, mini-grenades have a 25 and all the other grenades have a 20. No, as stated I had measured one of them throwing a smoke grenade over 25 tiles - not saying that this had been his maximum range.
IIRC a smoke grenade has a weight of 5. This would make for someone with strength 100:
iThrowingStrength = ( 100 * 2 + 100 ) / 3 == 100
iRange = 2 + ( 100 / (3 + 5 / 3 )) == 37
A strength of 50 would already be sufficiently to throw a smoke grenade over 25 tiles:
iThrowingStrength = ( 50 * 2 + 100 ) / 3 == 66
iRange = 2 + ( 66 / (3 + (5) / 3 )) == 26
ChrisLAs far as enemy soldiers throwing extreme distances, I've not encountered that in my test games. Of course, I almost never see the enemy throwing grenades at me at all. The only "grenades" they ever hit me with are break lights which do have a pretty extreme range. Yes, I too wasn't aware that there is a problem with grenades until raising maximum vision range. The result is that the enemy sees me earlyer, more often, and at larger distances. This in general does the AI good and improves gameplay - if there was not that rain of grenades thrown from far beyond SMG range.
With normal JA vision range you wouldn't see an enemy throwing a grenade over 25 and more tiles because he isn't able to see your merc at that distance. Even when fighting at daytime most enemies in the late game wouldn't be able to fire a single shot, so the chance for seeing any of them throwing a grenade is extremly small.
Report message to a moderator
|
First Sergeant
|
|
|
|
Re: Handgrenades[message #278881]
|
Fri, 29 April 2011 14:05 
|
|
Buns |
 |
Messages:655
Registered:September 2010 |
|
|
ChrisLAnd I guess I'm not understanding your math cause "2 + ( 100 / (3 + 5 / 3 )) == 37" is not a true statement. That equation adds up to 23 (27 with rounding), not 37. My bad: I made that 2+(100 / ((3+5)/3))
Quote:Of course, since the weight is actually 6, the result should really be 22 at STR=100 and 15 at STR=50. Which evidently not is the case because I had an enemy throwing a Smoke Grenade over 25 tiles.
Quote:I've tried increasing the sight range beyond 15 but the only problems I noticed there were enemies wasting ammo trying to shot 40+ tiles with a pistol. No excessive grenade use, though. So?
[Updated on: Fri, 29 April 2011 14:07] by Moderator Report message to a moderator
|
First Sergeant
|
|
|
Re: Handgrenades[message #278907]
|
Fri, 29 April 2011 20:58 
|
|
ctiberious |
 |
Messages:605
Registered:March 2007 |
|
|
Well, again, the "max range" is just the maximum accurate range. It's possible to throw a grenade a few tiles further then max (not sure what the absolute max actually is) but it's extremely inaccurate because there is that extra "chane/2" penalty that's tacked on top of all the other modifiers whenever you try to throw at a tile further then max range. Also, if you miss, the grenade will bounce in a random direction for a random distance so this also makes it possible for grenades to end up beyond max range.
As for the range thing, I was simply explaining why I don't increase my sight range much beyond 15. The AI doesn't seem to be able to handle the ability to see further then that because it doesn't make logical decisions on when to shot and when to move. But, ultimately, my point was that even when I have tested with higher sight ranges, I didn't notice alot of grenade use nor alot of grenades being tossed by npcs well beyond what the max range should have been.
As with all bugs, if I can consistantly recreate it, I can usually fix it. But in the case of this issue, I can't consistantly get an enemy soldier to throw a grenade from extrememly long range, so I can't trace out the problem. In fact, I was trying to point at that I don't really see this happening at all. The only "grenade" that I ever see flying at me from "extreme" ranges are break lights and those have something like a 37tile max range anyway. But if you have a savegame I can use that consistantly displays this behavior, send it to me and I'll work on it.
Report message to a moderator
|
|
|
|
|
|
|
|
Re: Handgrenades[message #278969]
|
Sat, 30 April 2011 14:26 
|
|
Buns |
 |
Messages:655
Registered:September 2010 |
|
|
ChrisLAs for the range thing, I was simply explaining why I don't increase my sight range much beyond 15. The AI doesn't seem to be able to handle the ability to see further then that because it doesn't make logical decisions on when to shot and when to move. But, ultimately, my point was that even when I have tested with higher sight ranges, I didn't notice alot of grenade use nor alot of grenades being tossed by npcs well beyond what the max range should have been. My experience would rather be the exact opposite: I went up to 20 tiles. In my opinion this does the AI good because it has a habbit of running circles around the tile at maximum vision range from where it should be able to see the enemy in case of being shot at from an unseen opponent. This behaviour always is fatal because you end up with a dozend enemies circulating around a magical hotspot who never have a chance of seeing the enemy who is shooting at them because he is, for example, camoed and prone in high gras. That way a single sniper can clear a sector with 32 enemies at full daylight on his own; he just needs some flank protection.
A higher vision range doesn't end this behaviour, but in general the AI has a better chance of seeing the enemy while moving around, for example when rounding a corner in an urban sector. Even when the AI again becomes stalled around the "spotting tile", this one now is much larger distance of some 40 tiles, outside the range of most weapons.
Of course, this does lead to the enemy shooting at extreme distances too, but I would see an AI shooting with only little chance to hit an improvement over an AI never shooting at all.
The problem is map-design: in case a lot of enemies have a clear LOS to the edge of the map the player might get instantly pinned when entering the map. I am confidnent that smeagol's bigmaps together with a more careful placement of enemies can solve this.
So far it went good until the enemy became equipped with grenades in larger numbers. The first troop of blackshirts I run into in fact wiped out my team with a hail of grenades thrown from far beyond SMG range with high precission. And there is close to nothing you can do about it because at ranges of 30 and beyond you need a scoped rifle shot with full aimed single shots to hit. So, no chance to kill enough blackshirts in one turn to prevent them from throwing the next round of grenades.
Quote:As with all bugs, if I can consistantly recreate it, I can usually fix it I am not saying that this is a bug. As far as I see it, the game is doing what is intended by the code. I would rather say that the way grenades are calculated needs to be rethought.
Another thing I noticed is that the 13 tiles flat-range for my mercs seems to be the case when throwing a grenade while couched. Range while standing is higher (I usually don't have my mercs standing in battle, and getting up to throw a grenade is suicidal because you won't have enough APs to go couched again).
Report message to a moderator
|
First Sergeant
|
|
|
|
|
Re: Handgrenades[message #279166]
|
Mon, 02 May 2011 19:54 
|
|
ctiberious |
 |
Messages:605
Registered:March 2007 |
|
|
BunsQuote:As with all bugs, if I can consistantly recreate it, I can usually fix it I am not saying that this is a bug. As far as I see it, the game is doing what is intended by the code. I would rather say that the way grenades are calculated needs to be rethought.
Another thing I noticed is that the 13 tiles flat-range for my mercs seems to be the case when throwing a grenade while couched. Range while standing is higher (I usually don't have my mercs standing in battle, and getting up to throw a grenade is suicidal because you won't have enough APs to go couched again). Whether it's a "bug" or not, I still can't "fix" it if I can't consistantly recreate the behavior. From what I'm reading in the code, and from what I'm seeing with my own experiences, grenade ranges are consistant for everyone whether we're talking enemies, militia or mercs. If you want to decrease the range at which grenades can be thrown, the easiest option would be to edit your Items.xml file and increase the ubWeight value for all your grenades by +3, +6 or even +9. This will reduce the max range.
And as I already pointed out, when crouching, the max throw range is reduced to 70% of normal.
I'll say one more time, the "red target" cursor does have a shorter limit and I have so far not been able to determine how that limit is calculated, other then to know that it DOES pull the value using the same "max throw range" function. It just uses that function in a way I'm not fully understanding right now. But the to-hit calculation is basically as I've described it in previous posts on this thread. And the only issue I can see with the entire procedure is that there is functionality for aiming which you can't actually do.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Handgrenades[message #279905]
|
Sat, 14 May 2011 02:04 
|
|
gas |
 |
Messages:8
Registered:May 2011 Location: Italy |
|
|
Blue_FoxI never had these issue btw.
I think that you never had that issue cause you just consider it normal gameplay, as tbh if i had to write a wishlist of fixes/improvements this thing doesnt go in my top 10 sure.
I recall even in vanilla ja2 anyway the AI can throw granades in example from quite a distance diagonally into a window without any problem while as human player you cant do the same, prolly cause if you dont see the landing zone you cant see the red cross so you cant perform the throw, while the AI surely works bit different.
So i think some differences between the AI throws compared to the player come anyway from the original code and its part of the original gameplay.
What i think is just this behaviour may be more visible since there are the new traits.
the specialist enemy solider new option maybe can result into some elite demolition soliders with too much cth bonus or too much throwing range, or stats, or a mix of those.
Or even it can happen only with a specific kind of granade that maybe result lighter then it should.
But anyway i dont see better snipers or better something else then before, so duno its just an idea.
Ofc its just speculation as i didnt go to read the code and tbh prolly im not even able to do it , but i think it could have some logic as idea.
Or there is another idea, wich is the enemy is using a mini grenade launcher with a bouncing grenade but graphically you see a normal hand throw (also the audio is not the one of a grenade launcher) so it could mislead to consider the throw manual as its visually shown while the game is actually calculating a launcher one... as when it happens the super throw the grenade seems to fly low and bounch on the floor reaching the target a bit like the mini bouncing granades do.
I can provide a savegame but there is not a high chance to see this if not playing for long i guess, cause its really situational.
It can happen to play 4 hours and never see a granade launch, even a normal one.
The place where i saw it more frequently is the NE sam site cause militia tends to pack in the sam entrance "tunnel" and the enemy AI seems to be more tempted to throw uber granades in this situation.
Anyway as i wrote also before its something i can confirm, but its not something that i consider game breaking or really an issue.
Report message to a moderator
|
Private
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Wed Feb 19 03:58:29 GMT+2 2025
Total time taken to generate the page: 0.03368 seconds
|