1801
OXCE Suggestions DONE / [DONE] [Suggestion] 'Realistic' Shotgun Behavior
« on: August 13, 2016, 06:46:51 pm »
'Realistic' Shotgun Behavior Executable
Link for Google Drive Archive with Test Mod
Link for Test Mod Only
Link for OXCE+ Executables
Link for GitHub OXCE+ Repository
Based on the discussion in https://openxcom.org/forum/index.php/topic,4744.0.html, I've created an edited version of Yankes' OpenXcom Extended executable to better model realistic shotgun behavior, or at least make the spread pattern of shotgun pellets configurable enough to look realistic. I've attached a link to a zip archive of the edited source code (in the subfolder OXCE/src) and a mod that demonstrates this new behavior on a few different shotguns. There's a compiled executable for Ubuntu 14.04 and Windows. Here's the rundown of what this modification does:
The base behavior of shotgun pellets starts by calculating a normal trajectory like any other weapon for the 'first' pellet projectile. The following pellets, up to the number defined by shotgunPellets on the ammunition in the ruleset, take the previous trajectory and modify it by the accuracy of the shot minus 5% for each pellet after the first, leading to a wide cone around wherever you clicked.
The new behavior starts the same way by calculating the first trajectory by the normal weapon/firing accuracy, but then each subsequent pellet is spread around the point of impact, with the spread defined by a few new definitions in the ruleset, affected by the range dropoff of the weapon:
All the ruleset defaults are set such that these changes will not affect weapon/ammunition definitions in current mods, ensuring compatibility and no unexpected changes.
The attached mod borrows a few shotguns from Dioxine's XPiratez mod (https://openxcom.org/forum/index.php/topic,3626.0.html), and adds possible values of the parameters above to give a feeling of what's possible using these changes.
Edit 170130 This has been included in OXCE+ long ago, so the above links to my repositories and .exe's are deprecated in favor of the current OXCE+ version.
Based on the discussion in https://openxcom.org/forum/index.php/topic,4744.0.html, I've created an edited version of Yankes' OpenXcom Extended executable to better model realistic shotgun behavior, or at least make the spread pattern of shotgun pellets configurable enough to look realistic. I've attached a link to a zip archive of the edited source code (in the subfolder OXCE/src) and a mod that demonstrates this new behavior on a few different shotguns. There's a compiled executable for Ubuntu 14.04 and Windows. Here's the rundown of what this modification does:
The base behavior of shotgun pellets starts by calculating a normal trajectory like any other weapon for the 'first' pellet projectile. The following pellets, up to the number defined by shotgunPellets on the ammunition in the ruleset, take the previous trajectory and modify it by the accuracy of the shot minus 5% for each pellet after the first, leading to a wide cone around wherever you clicked.
The new behavior starts the same way by calculating the first trajectory by the normal weapon/firing accuracy, but then each subsequent pellet is spread around the point of impact, with the spread defined by a few new definitions in the ruleset, affected by the range dropoff of the weapon:
- shotgunSpread: Defined on an ammunition type as a number between 0 and 100 with a default value of 100. With shotgunBehavior: true, this is approximatley the percent of pellets after the first that will hit the same tile/target as the first at the maximum accurate range. With shotgunBehavior: false, it is a multiplicative modifier to the 5% rule for the previous behavior, such that 100 means full normal spread, 0 means spread only from the weapon's accuracy.
- shotgunBehavior: Defined on an ammunition type as 1 or 0, default 0, determines whether or not the new spread calculation will be used (= 1).
- shotgunChoke: Defined on a weapon type as a number between 0 and 100 (or higher) with a default value of 100. Used only for shotgunBehavior: true, acts as a percent modifier to the 'accuracy' of the pellets from shotgunSpread - 100 means only the shotgunSpread value defines the spread pattern, 0 gives maximum possible spread regardless of the shotgunSpread value.
All the ruleset defaults are set such that these changes will not affect weapon/ammunition definitions in current mods, ensuring compatibility and no unexpected changes.
The attached mod borrows a few shotguns from Dioxine's XPiratez mod (https://openxcom.org/forum/index.php/topic,3626.0.html), and adds possible values of the parameters above to give a feeling of what's possible using these changes.
Edit 170130 This has been included in OXCE+ long ago, so the above links to my repositories and .exe's are deprecated in favor of the current OXCE+ version.