Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ohartenstein23

Pages: 1 ... 119 120 [121] 122 123 ... 129
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:
  • 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.

1802
Work In Progress / Re: a different shotgun behavior
« on: August 12, 2016, 10:06:22 pm »
I think I've got a nice working version of the second idea too now - the gist of it is that I save the position of where the 'first' pellet hits (I think of it being where your soldier ended up aiming when they pulled the trigger), then the remaining pellets spread around that with accuracy (100 - shotgunSpread)%, affected by the range/accuracy of the gun.  Thus, shotgunSpread: 0 means all pellets should hit the target at ranges up to the accurate range of the gun, and 100 means they'll spread around the first impact like taking 0% accuracy shots.  Maybe the best way to think about is that on average, shotgunSpread percent of the extra pellets will hit the same target as the first.

I'll upload the edited source files once I clean things up a bit and make it less hacky-looking.

Edit: Based on the discussion in this thread, I'm thinking of adding a shotgunChoke parameter to the weapon item in the ruleset that would be a multiplicative modifier to shotgunSpread, so that both weapon and ammo would affect the final pellet spread.  Something like choke > 1.0 decreases spread, choke < 1.0 increases spread, and choke = 0.0 is maximum spread.

1803
Work In Progress / Re: a different shotgun behavior
« on: August 12, 2016, 06:54:47 pm »
Okay, I've tried an implementation of the first idea:

In src/Mod/RuleItem.cpp, I added a function getShotgunSpread that looks for the line shotgunSpread in an ammo item
Code: [Select]
/**
 * Gets the number of projectiles this ammo shoots at once.
 * @return The number of projectiles.
 */
int RuleItem::getShotgunPellets() const
{
return _shotgunPellets;
}
In RuleItem::load(...), I added the line
Code: [Select]
_shotgunSpread = node["shotgunSpread"].as<int>(_shotgunSpread);

Then, in src/Battlescape/ProjectileFlyBState.cpp, I changed the section governing the additional shotgun pellets to
Code: [Select]
https:// special shotgun behaviour: trace extra projectile paths, and add bullet hits at their termination points.
if (shotgun)
{
_spread = _ammo->getRules()->getShotgunSpread();

int i = 1;
while (i != _ammo->getRules()->getShotgunPellets())
{
https:// create a projectile
Projectile *proj = new Projectile(_parent->getMod(), _parent->getSave(), _action, _origin, _targetVoxel, _ammo);
https:// let it trace to the point where it hits
_projectileImpact = proj->calculateTrajectory(std::max(0.0, (_unit->getFiringAccuracy(_action.type, _action.weapon, _parent->getMod()) / 100.0) - i * 5.0 * _spread / 100.0));
if (_projectileImpact != V_EMPTY)
{
https:// as above: skip the shot to the end of it's path
proj->skipTrajectory();
https:// insert an explosion and hit
if (_projectileImpact != V_OUTOFBOUNDS)
{
Explosion *explosion = new Explosion(proj->getPosition(1), _ammo->getRules()->getHitAnimation());
int power = _ammo->getRules()->getPowerBonus(_unit) - _ammo->getRules()->getPowerRangeReduction(proj->getDistance());
_parent->getMap()->getExplosions()->push_back(explosion);
_parent->getSave()->getTileEngine()->hit(proj->getPosition(1), power, _ammo->getRules()->getDamageType(), 0, _action.weapon);
}
}
++i;
delete proj;
}
}

The result is that setting shotgunSpread: 100 in the ruleset for an ammo type returns the current behavior (I made this the default value for backwards compatibility on mods), shotgunSpread: 0 makes the spread of pellets equal to the accuracy of the weapon, removing the decreasing accuracy per pellet beyond the first.  I've attached .zip files containing the changed files for OXCE and OXCE+, to be able to use it you'll have to compile either Yankes' or Meridian's version of the source code after replacing the files included here (sorry, I don't know how to use GitHub well enough to post any changes there).  I can create a nightly version if someone wants that too.

1804
Work In Progress / Re: a different shotgun behavior
« on: August 11, 2016, 08:29:06 pm »
Looking at the code for determining shotgun-like behavior (lines 556-581 in ProjectileFlyBState.cpp on the latest nightly in particular), each additional pellet after the first has it's own unique trajectory, but with accuracy decreasing by 5.0 * (number of pellet after the first).

Actually, can someone who has worked on the code comment on this?
Code: [Select]
_projectileImpact = proj->calculateTrajectory(std::max(0.0, (_unit->getFiringAccuracy(_action.type, _action.weapon) / 100.0) - i * 5.0));In this line, the impact from each additional pellet is traced from a new trajectory based on the firing accuracy / 100.0 minus the number of the pellet * 5.0; looking at the function getFiringAccuracy, the value returned should be the same as the percentage displayed on the crosshairs, so approximately between 0 and 150 (more for ridiculously accurate weapons).  This is then divided by 100.0, leading to a value between 0.0 and ~1.50, which means taking the maximum between 0.0 and this number minus the number of the pellet * 5.0 should always be 0.0, making any pellet after the first a shot with zero accuracy.  Am I interpreting this code correctly?

Edit:
I have two ideas for modifying the shotgun behavior here:
1.  Have that 'magic number' 5.0 be exposed to the ruleset as a 'pellet spread' number, which can be defined in the weapon or ammunition part of the ruleset, or both with either one superseding the other or combine them by an average.  This would be the easier of the two methods, and is more or less just being able to tweak the current behavior more.

2.  Add a second type of shotgun behavior, that rather than getting a completely new trajectory off of each particle, calculates a modified trajectory for each additional pellet beyond the first, that is based on the first.  The implementation in my head is saving the targetVoxel from the first fired projectile (first pellet), and using applyAccuracy to get a new target for each additional pellet, using a 'pellet spread' parameter instead of firing accuracy to pick a randomized target in the area of the impact from the first projectile.

1805
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 11, 2016, 08:01:35 pm »
I think you misunderstand; two guys on the ship with mininukes panicked and blew up every last tile around the elevator, lol.

The mission itself that the screenshot was taken from was a complete, casualty free success.

As for the XG weapons, what are those again?

Ivan's post will take some time to digest so I'll get around to it later.

Ah, I missed that detail when I was looking at it on my phone.

XG weapons are the manufacturable version of Gauss weapons, though they perform more like upgraded versions of smartrifles, smartpistols, and smartguns, with a lighter version of the slugthrower added to the mix.

1806
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 11, 2016, 03:46:25 pm »
Just don't give it to anyone of Bravery 90 or less, to be super-sure. Problem solved. You'll need to train Bravery a bunch first, but there are outfits with +20 or +30 bonus. With 90 Bravery, you can pretty much ignore even psi-induced fear.

It's not my hands with the baby nukes I'm worried about, it's the panicked GO who is firing blindly at the demons in the smoke :P

1807
XPiratez / Re: Suggestions on how to improve the mod
« on: August 11, 2016, 03:08:57 pm »
Exe in debug mode split all meta data of scripts to log. For what script are used is in readme.

Thanks!

1808
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 11, 2016, 02:59:06 pm »
I also did most of the raids with the Pachyderm, though mostly with the B or C team.  Exactly for this reason:

Curses, hoisted by my own petard (or when berserk mininukes go wrong):

https://i.imgur.com/zIgLiPH.png

I like to think of it as an extreme risk vs. reward situation: are the gals and equipment I brought with risking a beserk baby nuke for 2 mil in loot?

@KateMicucci: Yes, yes, and yes on the ol' carbine, smartrifle, and slugthrower.  I love any rifle that can aimed shot twice per turn, and the firepower of the slugthrower is brilliant.  Perfect for standing to the side of a door and blowing away anything coming out with that accurate snap shot.

Was anyone underwhelmed by the XG weapons besides the chaingun?  They're a nice firepower upgrade and all, but I found them rather quickly sent to the security details of secondary bases and forgotten.


1809
XPiratez / Re: Suggestions on how to improve the mod
« on: August 11, 2016, 01:17:58 am »
Yankes, do you have a reference for what can be done with scripts?

1810
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 10, 2016, 09:48:11 pm »
Eh, I just like being able to sprint everywhere with the amazon armor - hide n' stab was my favorite game for the hideout/supply ship raids.  I did plenty of supply ship raids, but worrying about not having a perfect smoke screen and eating a baby nuke to the face was a bit too stressful.  I probably could have just brought more smoke, or just used more expendable crews.

1811
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 10, 2016, 09:40:07 pm »
I still tended to use the amazon/spear kit on supply ship raids too - didn't want to risk resources for better armor to a chance baby nuke.  That's actually why I started raiding the base instead - I didn't have to wait until the supply ship, no worrying about day vs. night, and no baby nukes to fret over.  You can still farm them too, more often than supply ships, and they have the bonus of being able to drag VIPs out alive whenever you need them.

I researched plate later on, and by the time I had plate armor, I was used to the insane mobility offered to my melee gals by not wearing heavy armor.  Hit and run tactics are very effective when breaking line of sight is as easy as it is in a hideout.

1812
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 10, 2016, 09:22:05 pm »
115 laser damage with no need for ammo manufacturing? Hmm.

Balanced by huge encumbrance, lack of auto fire, and only one shot per turn even with snap shots.  The laser weapons seem outdone in the anti-armor department once heavy plasma rolls around, and you can loot enough of that by shooting down ships on crackdown missions that manufacturing doesn't matter anymore.  It'd be nice to feel like my shoulder-mounted laser isn't a step down in utility to a much lighter weapon the size of a large rifle.

1813
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 10, 2016, 09:15:55 pm »
Seriously?

You've done hideouts with mostly spears?

What difficulty?

I'm on Blackbeard difficulty (equivalent to vanilla's veteran?), so there aren't ridiculously huge numbers of enemies in the hideout.  And these were just raids for a few gauss weapons - small crew, pick a section of the base, kill everyone in that area, sneak away with the loot.  It's mostly about staying in the dark and skewering targets from behind - I figure that a gal taking a gauss bullet is dead anyways, so the amazon outfits are for high mobility and nice bonuses to the spear's damage.  Seriously, try it with a couple of gals in training so you're not so worried about losing them.  The tight corridors are a melee playground, and the only real trouble would be power armor (or mercs, but I haven't seen a merc base yet).

1814
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 10, 2016, 06:41:44 pm »
I like the MP Lascannon a lot for its gratuitous firepower, I even find myself still using it though I have battle lasers available.  I feel that it needs an upgrade though - nuclear-powered lasers seem to be an improvement over every standard laser weapon, save for the MP Lascannon.  Maybe give it an option to manufacture a nuclear-powered version out of the original once the correct prerequisites are researched?

1815
XPZ Strategy/Tactics / Re: Weapon Discussion Thread
« on: August 10, 2016, 05:50:39 pm »
Aw man, the death blossom.  It never goes out of style for me.  Great breaching weapon when you first get it and wonderful to pair with a melee weapon, then it sees a resurgence as the sidearm for gals in power armor.  I love the API ammo for lighting up targets at night, chem rounds are never a bad thing, and HVAP is a great improvement to the gun's quality of life later in the game.

Pages: 1 ... 119 120 [121] 122 123 ... 129