Amineri Posted November 5, 2013 Share Posted November 5, 2013 I was digging through the code and found the place where the "Dense Smoke" perk's increased radius is implemented. The function is XGVolume.InitVolumeEffect : if(((kUnit != none) && kUnit.GetCharacter().HasUpgrade(52)) && GetType() == 1) { fRadius = m_kTVolume.fRadius * XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.1.250; } else { fRadius = m_kTVolume.fRadius; }The fRadius will normally be drawn from the Weapons entry in the DGC.ini. Dense Smoke is here hard-coded to grant an extra +25% to the smoke radius. The default radius is 336 (so at 96 units/tile is ~3.5 tiles, the same as a rocket). I didn't realize the perk was adding smoke radius, and is an interesting design choice since combat drugs doesn't add the additional smoke radius. It would be quite easy to change the radius bonus (just a float value change) or to grant the radius bonus for combat drugs instead of dense smoke. With a little more work it could be worked to grant the radius bonus for both perks. My initial cut at new code would be something like: fRadius = m_kTVolume.fRadius; if(((kUnit != none) && (kUnit.GetCharacter().HasUpgrade(52) || kUnit.GetCharacter().HasUpgrade(51))) && GetType() == 1) { fRadius *= 1.250; } This +25% increase was implemented via a constant (instead of a config variable) which means that it was set at compile time. Since EW is supposedly shifting a lot of these values from constants to config variables, this value may be one of them. Guess we'll know in a few more days! :smile: -------------- Also, because I'm not sure if I've posted this generally, I created a modlet that alters the Smoke Grenade perk to make using a Smoke Grenade a move action instead of a fire action. This was originally developed for Long War because the smoke grenade was added as an item but the perk choice was also retained. Giving the perk (and only the perk) the ability was done to keep the perk as an attractive option compared to the use of a single item slot. This was done by tagging on to the end of the XGAbility.ApplyCost code -- the same code that implements the Bullet Swarm and Double Tap perks. The hex code snippet that does this is: if(((m_kUnit.m_kCharacter.m_kChar.aUpgrades[44] & 1) > 0) && (GetType()) == 23) 07 BC 05 82 97 9C 1A 2C 2C 35 D1 0D 00 00 D5 0D 00 00 00 01 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 09 00 C3 A2 00 00 00 01 C3 A2 00 00 26 16 25 16 18 0F 00 9A 1B 1E 35 00 00 00 00 00 00 16 2C 17 16 16 ++ m_kUnit.m_iMovesActionsPerformed A5 19 01 E6 7B 00 00 09 00 B6 30 00 00 00 01 B6 30 00 00 16 This caused a small glitch in which the number of smoke charges wouldn't refresh after tossing an initial smoke grenade, which was fixed by adding a call to m_kUnit.BuildAbilities(true); at the end of ApplyCost. Since this modlet changes the same functionality as the "unlock bullet swarm and double tap" modlet it can't be applied separately. Link to comment Share on other sites More sharing options...
Bertilsson Posted November 5, 2013 Share Posted November 5, 2013 (edited) I didn't realize the perk was adding smoke radius, and is an interesting design choice since combat drugs doesn't add the additional smoke radius.I think it actually makes sense that dense smoke is adding to the area and combat drugs does not. The easiest way to create denser smoke is to just add more smoke which will then spread to a bigger area (think of it as throwing two smoke grenades at the same location at the same time). The discrete on/off area of effect for all grenades and explosions is what does not make sense :smile: Edit: The proper way that area of effects should have been implemented should according to my book have been as full effect * %distance of radius... or at least partially factoring it in, together with explosives respecting cover. Edited November 5, 2013 by Bertilsson Link to comment Share on other sites More sharing options...
Amineri Posted November 5, 2013 Author Share Posted November 5, 2013 In theory the Unreal Engine should support this, as the smoke/combat drugs (and poison, too) are implemented by creating volumes. Each tile could in theory have a slightly different smoke volume applied to it which would provide differing to-hit modifiers. I think the problem with that is more in the player being able to predict how much cover will be granted by the smoke. Also don't forget the other major benefit of being in smoke -- the unit is no longer exposed and so enemies don't get the bonus crit chance. I don't think this applies to combat drugs, which motivates me again to want to tweak combat drugs radius up a bit. The bonus of +25% increases the radius from 336 units (3.5 tiles) to 420 units (4.375 tiles), which isn't that much of an increase (~ +56% area increase). In comparison the Danger Zone perk increase rocket radius from 336 units (3.5 tiles) to 528 units (5.5 tiles), which is much greater (~ +150% area increase). Link to comment Share on other sites More sharing options...
Recommended Posts