Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab  » LMG Updates
LMG Updates[message #267991] Wed, 08 December 2010 19:53 Go to next message
ctiberious

 
Messages:606
Registered:March 2007
This thread is to discuss the code work related to updating LMGs so they are slightly more effective in their expected role. I've discussed some of what I am hoping to do in a feature request thread so I won't repeat too much of what's been said there, here. As briefly as I can, I'll try and explain the purpose of this project and what steps I'm taking to effect the changes.

LMGs are not supposed to be the same as Assault Rifles and Battle Rifles (henceforth simply refered to as "ARs"). In many cases, LMGs use the same type of ammo as ARs, though normally in much higher capacities. And unlike ARs, most LMGs have a very limited number of attachments they can make use of. Most LMGs also only have autofire capabilities with no option for burst or single fire modes. Unlike ARs, LMGs tend to be heavier, less weildly weapons, designed as support weapons. Where an AR's lighter weight and smaller size is perfect for a "mobile soldier", LMGs are best suited for emplacement to cover an area (a firing arc in this case).
In the current code, there really is no difference between an LMG and an AR. In fact, the current code will allow many ARs to function almost exactly like LMGs. The purpose of this project is to alter this.

To that end, what I'm working on is a reduction in the firing AP cost for LMGs under specific circumstances. Those circumstances are as follows:
1- The AP reduction can only take place when a merc (or enemy soldier) is prone or crouched.
2- The AP reduction can only take place after the weapon is "setup". For game purposes, the weapon will be considered "setup" once it's been fired and will remain "setup" so long as the merc doesn't do anything to "un-ready" the weapon (such as move or change stance).
3- The AP reduction can only take place if the weapon is fired in the same arc as the previous shot. I'm going to allow mercs to turn without losing the AP reduction to simpulate the mercs ability to "look around" but you'll lose the AP reduction if you attempt to fire in a new direction.
Also, I'm going to try and include a slight bonus to the Interrupt chance for "setup" LMGs.

I'm going to include the following JA2_Options.INI settings to allow users outside control over how effective (if at all) this project will be in their game:
LMG_PRONE_FIRE_DIVISOR - Divisor applied to an LMGs base fire APs when shooter is prone and above criteria are met
LMG_CROUCHED_FIRE_DIVISOR - Divisor applied to an LMGs base fire APs when shooter is crouched and above criteria are met
In both case, the valid range will be 0.1 - 10.0 with 1.0 resulting in no change from the current system. 0.1-0.9 will result in a HIGHER AP cost, while values of 1.1-10.0 will result in lower AP costs
LMG_INTERRUPT_BONUS - Bonus applied to a shooters chance to interrupt when the above criteria are met

Re: LMG Updates[message #268131] Fri, 10 December 2010 23:10 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
At the moment, and after discussion on the Feature Request thread related to this project (http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=267892#Post267892), I'm limiting my changes to the autofire and tracer system. I'm not going to go into details as to why I'm making these changes, or how I figured out changed needed to be made because that's already been discussed on the previous thread. What I will do is post an excerp of one of the tests I had been running:ChrisL
I have the AIMING_BURST_PENALTY set to 1. I've got a Merc who has the Autoweapon trait, who is kneeling, firing a 10 round autofire burst at a tile 12 tiles distance, using a FN Minimi fitted with foregrip and tracer ammo. The CTH for each of those 10 round is: 42, 30, 23, 16, 9, 2, 0, 1, 0, 0. If I take the foregrip off and make the exact same shot, my CTH for each round is completely unchanged.

I've made a number of changes to both the burst/auto fire system as well as the tracer system
To the burst/autofire system I've:
  • reworked the CTH function so that recoil only effect subsequent shots. The first shot of a burst or autofire shot is basically treated as if you were firing a single shot.
  • adjusted the AutoFireToHitBonus and BurstFireToHitBonus values for a weapon, it's ammo and all it's attachments, are applied to the weapons AutoPenalty or BurstPenalty as a percentage reduction instead of simply canceling the penalty directly.
  • I added in INI value (AUTOFIRE_TOHIT_BONUS_MULTIPLIER) to convert the standard AutoFireToHitBonus and BurstFireToHitBonus to a value that can be used as a viable percentage for the above. As an example, the default value for AUTOFIRE_TOHIT_BONUS_MULTIPLIER is 5. If a weapons total AutoFireToHitBonus value comes to 6, we'll reduce the weapons AutoPenalty by 30% per round fired (5 * 6 = 30).
  • We no longer apply the AutoPenalty or BurstPenalty from a weapon twice
To the tracer system I've:
  • Reworked the portion of the function that determines the number of tracer rounds that have been fired in the current burst so that we take into account the rounds that have been fired prior to the current burst. In other words, if you fired of 12 rounds of your weapon, then you fire a 5rnd burst, we want to know how many tracer rounds are being fired for rounds 13-17 of your mag.
  • I've adjusted the max "bump" bonus that a tracer can give. Before, the max was basically based on the number of tiles you were beyond 10, times the RANGE_EFFECT_ON_MAX_TRACER_CTH_BONUS, and disregarding the number of tracer rounds fired. This meant if you set RANGE_EFFECT_ON_MAX_TRACER_CTH_BONUS=1, and were firing at a target 12 tiles away, you would only get a 2% CTH bonus regardless of the number of tracer rounds that were fired. With the update, we calculate the max bonus the same way, but then we apply that bonus to each tracer. So if you fired 4 tracers at this point in your burst, you get an 8% bonus.
  • I've added an INI value (MIN_RANGE_FOR_TRACER) to allow players to control the minimum range at which tracer bonus comes into play. The default is 10, meaning you will get your RANGE_EFFECT_ON_MAX_TRACER_CTH_BONUS/tile (up to CTH_BUMP_PER_TRACER max) after you pass 10 tiles. Within 0-10 tiles, you'll get no benefit from tracer rounds.
The results of these changes brought the following. I've run Burst and Autofire tests with a number of mercs using a number of different weapons. In all cases I have REALISTIC_TRACERS=2, NUM_BULLETS_PER_TRACER=4, CTH_BUMP_PER_TRACER=20, MIN_RANGE_FOR_TRACER=10, RANGE_EFFECT_ON_MAX_TRACER_CTH_BONUS=1, AIMING_BURST_PENALTY=1, and AUTOFIRE_TOHIT_BONUS_MULTIPLIER=5.
Test 1 - Merc with MRK97, no autoweapon trait, crouched, firing 10rnd burst from P90 equiped with trigger group no attachments with AutoFireToHitBonus returned the following CTH: 46, 41, 35, 30, 24, 18, 13, 7, 2, 0
Test 2 - Same merc, using the same weapon on Burst mode, and no attachments with BurstFireToHitBonus. CTH results: 46, 42, 37
Test 3 - Merc with MRK94, no autoweapon trait, crouched, firing 10rnd autofire burst from FN SCAR-68 SV with trigger group and no attachments with AutoFireToHitBonus. CTH results: 41, 33, 25, 17, 9, 1, 0, 1, 0, 0
Test 4 - Same merc from test 3, firing same weapon in burst mode. Weapon has no attachments that grant BurstFireToHitBonus. CTH results: 41, 34, 27
Test 5 - Merc with MRK91, one level of STOMP autoweapon trait, crouched, firing 10rnd burst from FN Minimi equipment with tracer ammo and grippod, both of which combine (because of REALISTIC_TRACERS=2) to a AutoFireToHitBonus of 10 (tracer=6, grippod=4). CTH results: 42, 40, 40, 37, 35, 33, 32, 30, 27, 25
Test 6 - Same merc from test 5, in the same situation, but this time REALISTIC_TRACERS=1 meaning we don't count a tracers AutoFireToHitBonus in the recoil calculations. Only in the tracer calculations. So the AutoFireToHitBonus is only 4. CTH results: 42, 39, 37, 33, 29, 25, 23, 19, 16, 11
Test 7 - Same merc and setup as test 6, but this time without the grippod. CTH restults: 42, 40, 35, 30, 27, 22, 17, 12, 9, 4

I believe the reason the 2nd shot with the grippod is worse then the 2nd shot without is simply because of the way the tracer rounds lined up. Either way, it looks like these changes actually make autofire a functional system without letting it go over the top. For best results I'd suggest using REALISTIC_TRACERS=1, RANGE_EFFECT_ON_MAX_TRACER_CTH_BONUS=3, and AIMING_BURST_PENALTY=2. The settings I used were a bit leveled out so I could see how the fuction handled the changes without too much INI interferance, but with the default settings, you'll end up with a bit more deviation between shots while still allowing autofire bursts to remain reasonably accurate for longer.

As for LMG specific modifications, so far I haven't included any. I'm still looking into options. Possibly just improving how LMGs work in the suppression fire system.

Re: LMG Updates[message #268232] Mon, 13 December 2010 20:59 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
I've added a slight adjustment to the "Shot" AP cost when firing a weapon using a bipod (meaning, prone and bipod attached). One purpose of a bipod is to reduce the effects of recoil. And part of the "shot" AP cost involved in firing a weapon is recovering from the recoil of the shot. To reflect this, if you're prone and using a bipod, the BaseAPsToShootOrStab will be reduced by the bipod's bonus (the Bipod value in Items.xml) as a percentage. I.E., a standard bipod has a Bipod value of 10 so when using a standard bipod you'll receive a 10% reduction in AP cost.

This feature can be turned off by turning off the LMG Update. Just set AUTOFIRE_TOHIT_BONUS_MULTIPLIER = 0 in INI file.

Re: LMG Updates[message #268532] Sat, 18 December 2010 18:04 Go to previous messageGo to next message
Wil473

 
Messages:2843
Registered:September 2004
Location: Canada
I like the idea of Bipods's reducing AP cost; some of us already have CTH bonuses for going prone as a XML method to achieve similar results (higher base CTH means less aiming is needed). However does the AI "know" that going prone will give it a bonus?

[Updated on: Sat, 18 December 2010 18:05] by Moderator



Re: LMG Updates[message #268536] Sat, 18 December 2010 20:22 Go to previous messageGo to next message
Minty

 
Messages:115
Registered:July 2009
Location: UK
Yeah, that's part of the issue, Wil. Take IoV, for example. The heavier weapons that come with integrated bipods tend to have a to-hit bonus of -70 or so, but the bipods give a bonus of 90-ish. However, the AI seems to ignore this, and tries to hip-fire Kords, Barretts, etc.

So no, it doesn't seem the AI knows about bipods, and only uses em by accident. I think.
Re: LMG Updates[message #268544] Sat, 18 December 2010 22:30 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
No wil. At present I haven't given the AI that ability because I'm not familiar enough with the AI system.

And the current dev branch has my LMG (actually, just auto/burst fire) updates that I've completed so far. That includes a modification to how Bipods work. They still grant their value as a CTH bonus but they also reduce the BaseAPtoShotStab cost of the weapon by their %. In other words, the standard bipod grants it's usual +10 CTH and also reduces the base "shot-AP" cost by 10%. The grippod is a +7 and 7% respectively. Of course, only when prone.

Re: LMG Updates[message #268545] Sat, 18 December 2010 22:34 Go to previous messageGo to next message
Minty

 
Messages:115
Registered:July 2009
Location: UK
Ohh.. Here's a one.. Is there any way to allow bipod bonuses if the actor's knelt down as well as prone? But only if they're behind, and facing a chest-high obstruction, such as wall, rock, or window.
Re: LMG Updates[message #268547] Sat, 18 December 2010 22:36 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
Presently no. But it's something we can look into. My fear here is that the terrain system might think that a "chest-high" bush would grant the bipod bonus.

Re: LMG Updates[message #268548] Sat, 18 December 2010 22:42 Go to previous messageGo to next message
Minty

 
Messages:115
Registered:July 2009
Location: UK
Ahh, good point. Hm.. Just thinking out loud, and possibly derailing the thread a little (If so, I apologise).. But objects have their opacity stored in the .JSD file or somesuch, right? So, if an object's opaque, it's a safe bet that it's solid enough to rest a weapon on, as a rule of thumb? Or, going even more in depth, maybe a tag in the .JSD files? Meh. Pipedreams, I know, but suggestions and ideas never hurt, right? Wink

Again, apologies for attempted hijack. Smile
Re: LMG Updates[message #268556] Sun, 19 December 2010 02:30 Go to previous messageGo to next message
ctiberious

 
Messages:606
Registered:March 2007
No worries, Minty. It's a valid request whether for LMGs, straight up autofire or any other weapon that uses a bipod.

Re: LMG Updates[message #269098] Wed, 29 December 2010 19:15 Go to previous messageGo to next message
Alex_SPB

 
Messages:170
Registered:February 2008
Location: Russia, St.Petersburg
In line with you work on NCTH the balancing issue for the LMG -s could be the following:

1) Heavier in comparison to AR, lighter then Heavy Mashine guns
2) Ready costs heavier then for AR but lower then for heavy MG-s
2) Less recoil comparing to AR, but more comparing to Heavy MG-s. At the same time heavy MG-s have little recoil only while prone, it is almost impossible to shoot them while standing. LMG-s will allow effective shooting while standing but will be less effective while prone being in the middle between AR-s amd heavy MG-s.
3) Will take more aim clicks to AIM then AR-s and less aim clicks then heavy MG-s
4) Less suppression efficiency comparing to heavy MG-s (vertical bullet deviation due to recoil greatly affect suppression, so the less is vertical recoil- the more efficient suppression is)
5) Better barrel treatment then AR (NCTH weapon accuracy) but worst then heavy MG-s
Re: LMG Updates[message #269116] Thu, 30 December 2010 02:40 Go to previous message
usrbid

 
Messages:1558
Registered:December 2008
Yo ChrisL, Did you get a chance to look at the DOM code? I don't know if they changed how the CTH is calculated for auto fire, however what I can tell you is that most of their energy weapons work by firing a large amount of shots using very few APs and you can see the rays zeroing in on the target, which seems different from 1.13 where supposedly the CTH decreases with the amount of shots fired.

Also they have aimed auto, meaning you can spend aim clicks before you switch to auto fire. Not that this will be useful for what you are trying to do, just another indicator that they might have modified the auto fire code.


Previous Topic: Combat Movement
Next Topic: Source code- update nr 4000
Goto Forum:
  


Current Time: Thu Nov 15 14:42:10 EET 2018

Total time taken to generate the page: 0.01540 seconds