Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realistic gun cleaning #34470

Merged
merged 44 commits into from Dec 9, 2019

Conversation

misterprimus
Copy link
Contributor

@misterprimus misterprimus commented Oct 5, 2019

Summary

SUMMARY: Content "Makes gun cleaning more realistic."

Purpose of change

Cleaning a gun requires solvents. After using a solvent, a gun must be oiled to make it function. Some guns (esp. budget guns) don't even come oiled and must be cleaned/oiled before first use or else they will fail to cycle. Previously, the game just used an unlimited use bore rod to clean the gun.

Describe the solution

Using a kit or bore rod now also requires the use of solvents like gas or alcohol. It also creates an unlubricated malfunction after using the solvent, which then requires the use of a lubricant like lamp oil or cooking oil to make the gun work properly again. Unlubed guns will fail to cycle and can be damaged eventually, but are definitely better than a very dirty gun in the heat of battle.

Describe alternatives you've considered

Nothing seriously.

Additional context

Co-Authored-By: Anton Burmistrov <Night_Pryanik@mail.ru>
@ZhilkinSerg ZhilkinSerg added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Items / Item Actions / Item Qualities Items and how they work and interact Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics labels Oct 5, 2019
@Night-Pryanik
Copy link
Contributor

If this get merged, we necessarily must apply gun fouling mechanics to robots' and turrets' guns.

@misterprimus
Copy link
Contributor Author

If this get merged, we necessarily must apply gun fouling mechanics to robots' and turrets' guns.

Gun fouling was already merged. This just changes and makes a bit more realistic the items required to clean a gun.

But I get your point. Bot guns would be IRL subject to similar faults as a player's gun, albeit a bot probably is not as likely to suffer a malfunction due to the fixed and optimized (for reliability, not ergonomics) nature of the gun. Given 1,600 rounds (the highest I've seen in an automatic enemy) the bot would eventually gain a 3% chance of suffering a jam per round fired given current rates. A bot would also be unable to clear a jam given the way I envision most bots if they were built in real life.

@misterprimus
Copy link
Contributor Author

If this get merged, we necessarily must apply gun fouling mechanics to robots' and turrets' guns.

Dunno if I could do it using the ranged.cpp values by pulling them from there directly, but I think it would be possible to rewrite mattach_actors.cpp to keep track of dirt accumulation separately. Not currently sure of how to do it with a bot wielding multiple weapons, though (like the beagle).

@misterprimus
Copy link
Contributor Author

Anyway, turret fouling might be better saved for a separate PR.

@tenmillimaster
Copy link
Member

This seems wrong.

Many firearms will function ok without lubricants- they'll do better with it, but they'll function without. Solvents such as Hoppes are nice, yes, but the bare minimum one needs are water, scrubbing, and a drying.

The amount of lubricant that is actually necessary is going to be about <1mL, the parts only need a very thin film of oil/grease/dry lube to function optimally.

As such, I recommend drastically reworking the requirements for clearing faults and the resources necessary.

@misterprimus
Copy link
Contributor Author

This seems wrong.

Many firearms will function ok without lubricants- they'll do better with it, but they'll function without. Solvents such as Hoppes are nice, yes, but the bare minimum one needs are water, scrubbing, and a drying.

The amount of lubricant that is actually necessary is going to be about <1mL, the parts only need a very thin film of oil/grease/dry lube to function optimally.

As such, I recommend drastically reworking the requirements for clearing faults and the resources necessary.

This seems wrong.

Many firearms will function ok without lubricants- they'll do better with it, but they'll function without. Solvents such as Hoppes are nice, yes, but the bare minimum one needs are water, scrubbing, and a drying.

The amount of lubricant that is actually necessary is going to be about <1mL, the parts only need a very thin film of oil/grease/dry lube to function optimally.

As such, I recommend drastically reworking the requirements for clearing faults and the resources necessary.

True, but keep in mind that while a tiny film of the stuff is what's technically used, IRL you're going to apply a lot more to get it everywhere, with the excess dripping off or getting where it's not needed.

@misterprimus misterprimus reopened this Oct 9, 2019
@misterprimus
Copy link
Contributor Author

Oops wrong button!

@tenmillimaster
Copy link
Member

Still, your current implementation does not reflect how little one needs in terms of resources to remediate fouling, as cleaning can literally be done with hot water and a stiff brush.

20mL of lubricant seems far too much still. Perhaps 1-2 mL.

@misterprimus
Copy link
Contributor Author

Still, your current implementation does not reflect how little one needs in terms of resources to remediate fouling, as cleaning can literally be done with hot water and a stiff brush.

20mL of lubricant seems far too much still. Perhaps 1-2 mL.

I reduced it more, but I don't think you'd be able to get away with 1-2 mL. When I've cleaned guns, I generally go through at least 10 mL of solvent, and that's on a small handgun using an atomizer for efficiency. Between the spray angle being too wide and the stuff evaporating quickly, it's rather hard to be 1 mL efficient.

@misterprimus
Copy link
Contributor Author

There are approximately 20 'drop's per mL of solution, glossing over other factors such as surface tension and density.

For an AR15: you want 1 'drop' per bearing surface on the carrier, so 4 drops. You'll want ~ 1drop for the hammer and trigger pins in the lower.

For a 1911: ~2 drops on the bushing, 1 drop in disconnector recess, 4 drops for slide interior, 1 drop on disconnector, 2 on hammer pivot pin, 8 for the slide rails.l

For a Glock: 8 drops on slide rails, 1 drop on barrel wear points, 1 drop on trigger bar.

For an AK: ~10 on the bolt, 4 on bolt carrier.

It's definitely possible to use a lot less than 10 mL if you know EXACTLY where the lube needs to go, are working with a fairly small weapon with parts that are easy to reach, and have precision application tools to apply the oil precisely, so I reduced it again. I still don't think the typical survivor would be able to be so frugal with the oil, but since it's theoretically possible, I reduced it.

data/json/items/gun/ups.json Outdated Show resolved Hide resolved
data/json/items/gun/faults_gun.json Outdated Show resolved Hide resolved
src/item_group.cpp Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
misterprimus and others added 5 commits November 7, 2019 23:31
Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
src/activity_handlers.cpp Outdated Show resolved Hide resolved
misterprimus and others added 2 commits November 10, 2019 13:30
Co-Authored-By: BevapDin <tho_ki@gmx.de>
src/item_group.cpp Outdated Show resolved Hide resolved
src/item_group.cpp Outdated Show resolved Hide resolved
src/item_group.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
misterprimus and others added 4 commits November 10, 2019 23:55
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Copy link
Contributor

@anothersimulacrum anothersimulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Just a few things:
Please move your comments onto separate lines, putting them after the { is

  1. Ugly
  2. Increases line length significantly, impacting readability

src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
@misterprimus
Copy link
Contributor Author

Any word on this? Been a long time.

@kevingranade kevingranade merged commit 0d9d764 into CleverRaven:master Dec 9, 2019
fengjixuchui added a commit to fengjixuchui/Cataclysm-DDA that referenced this pull request Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet