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

Big bore air rifles #33106

Closed

Conversation

@misterprimus
Copy link
Contributor

commented Aug 10, 2019

Summary

SUMMARY: Content "Adds big bore air rifles"

Purpose of change

Describe the solution

Creates "air" and associated containers and generators to facilitate it. Basically works like a UPS for the rail rifle.

Describe alternatives you've considered

Special checks in ranged.cpp that would jam a gun when it's out of air.

Additional context

N/A
misterprimus and others added 30 commits Jul 22, 2019
Update data/json/items/generic.json
Co-Authored-By: Nick Greazaro <NickGrease@users.noreply.github.com>
Update data/json/items/generic.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/items/generic.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/mondeath.cpp
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/monstergenerator.cpp
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/mondeath.cpp
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/items/generic.json
Co-Authored-By: Nick Greazaro <NickGrease@users.noreply.github.com>
Update data/json/items/generic.json
Co-Authored-By: Nick Greazaro <NickGrease@users.noreply.github.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/mtype.h
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/mondeath.cpp
Co-Authored-By: Nick Greazaro <NickGrease@users.noreply.github.com>
Update data/json/items/generic.json
Co-Authored-By: Nick Greazaro <NickGrease@users.noreply.github.com>
Update data/json/items/generic.json
Co-Authored-By: Nick Greazaro <NickGrease@users.noreply.github.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update data/json/recipes/recipe_deconstruction.json
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/mondeath.cpp
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
Update src/mondeath.cpp
Co-Authored-By: anothersimulacrum <anothersimulacrum@gmail.com>
@EirenexTheDragon

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2019

wouldnt air fit well to the pneumatic weapons too? so the reload rate for putting in pellet and pumping for air could be done differently

You mean the one with the single round (the unmodified one)? That one has an integral pump. It doesn't come with an external inlet for an air fitting. The vast majority of the air rifles I've seen (perhaps all) have either one or the other, not both. I view it as one of those single shot, break barrel air rifles where you break the barrel to expose the chamber for the round, load the round, and close it and it's ready to fire, so no separate air system is needed for something like that.

yes , the bolt driver and the pneumatic assault rifle! i know it has an integrated pump, but i dont know the mechanic with how its fired exactly. i thought it has a air tank thats pressurized with the pump and you just reload casually but have to repump a few times. like with Metro i played once. their description of it sounded like it fits to the pneumatic assault rifle and the bolt driver:

"The Tihar is extremely quiet and is capable of silently bringing down enemies from surprisingly long ranges. It carries fifteen 15 mm ball bearings in a tubular spring-fed magazine. The ammunition is propelled by a cylinder of compressed air placed inside the stock of the gun, which attains its pressure by a handpump at the end of the handguard. A pressure gauge mounted on the right side of the weapon shows how much relative stopping power and distance the next shot will have, with each shot draining a small amount of air from the reservoir.

It is possible to overpressure the cylinder for extra stopping power and range, but the extra air will leak out eventually and the gun will go back to normal power levels"

so basically allow players to load in the ammunition easily like back then , but requiring the air pumping aswell which takes more time ofcourse

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2019

The flamethrowers should also use a pressurised air tank as a propellant.

Currently the game flamethrowers use a pressurised fuel tank filled with flammable liquid (napalm) which is not very realistic.

Haven't used flamethrowers in a while (they seemed kind of weak), but yeah, that's definitely wrong. You can't just pour gasoline or napalm into a tank and expect it to "fire" unless you're using some rather weak Windex lever to pressurize the the contents at the time of each firing, but the range on that would be horrible. OK for the spraycan flamethrower I guess, but anything with longer range should require a compressed air power source.

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2019

The existing pneumatic weapons may or may not need a rework (bolt driver, assault rifle). I think I have an idea of how to handle this, but the code is pretty much in the exact same section as my blackpowder PR. I don't want to create any conflicts later on, so I will wait until the blackpowder PR and this item are merged/rejected before doing any work on PCP or balancing out the existing air rifles. Likewise, flamethrower changes are likely best left to a future balancing PR, which would likely benefit from changes made here and in a PCP rifle addition.

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 10, 2019

I'm still not sure why the monster-related "changes" are appearing on the files changed list. These are the turret ammo drop changes and they were already merged. They have nothing to do with this PR.

src/iuse.cpp Outdated Show resolved Hide resolved
src/ranged.cpp Outdated Show resolved Hide resolved
src/visitable.cpp Outdated Show resolved Hide resolved
src/visitable.cpp Outdated Show resolved Hide resolved
@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

Some kind of gunmod that would convert an extant pneumatic weapon to require the separate air canister in exchange for drastically reduced reload time would be capital.

Update src/visitable.cpp
Co-Authored-By: BevapDin <tho_ki@gmx.de>
@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2019

Some kind of gunmod that would convert an extant pneumatic weapon to require the separate air canister in exchange for drastically reduced reload time would be capital.

The existing air guns need to be totally redone IMO. I am using the pneumatic assault rifle and with bearings it's actually doing more damage than a 9mm gunpowder handgun! IRL it's 9mm > .22 > .177 air rifle. I think it's a bit outside the scope of this PR, though. If it were up to me I'd simply nerf that pneumatic assault rifle to little more than a kid's toy. Any air rifle that rises to the level of a weapon is either single shot or precharged. Anything else and you just don't get any stopping power, which is questionable with anything but a top shelf single shot break barrel. You want me to just nerf them? The player would be considered passively pumping the pneumatic as he fires since it would be weaker.

Oh and the nail rifle really has to go away. I've read a nail gun would be an absolutely terrible weapon except if you literally put the business end up against someone's head and push. Even the nail guns that use gunpowder would likely suck: unlikely to cause injury unless you hit a person in the eye or tooth. A zed wouldn't give a crap.

IMO the most realistic solution is if these get accepted, get rid of everything else pneumatic, incl. flamethrowers and the bolt driver. I could also add a .177 which would be same as the single shot big bore, except much faster reload and different (significantly weaker) ammo. Practically it would be useful for hunting squirrels and increasing rifle skill.

From what I've read, pneumatics fall into 4 categories:

  1. Big bore single shot - these are the really big killers than can take down a deer, perhaps a bear. Require like a min of pumping for a single shot. These are all PCPs. Cals .357 to .50.
  2. Big bore multishot - still PCP, but a bit weaker.
  3. Small bore single shot - the most common. These are integral pump "break barrel" types. Good for small game. Cals .177 to .25. Weaker than a .22.
  4. Integral multipump "assault rifle" multishot types. Unreliable junk.
@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

The player would be considered passively pumping the pneumatic as he fires since it would be weaker.

That's why they have such long per-shot reload times - to account for the time spent pumping the gun's tank up a bit more each time.

Oh and the nail rifle really has to go away.

I'm not a fan of nuking any of our fun scrap-built weapons. Making the nail rifle require an air tank would make sense, though.

get rid of everything else pneumatic, incl. flamethrowers and the bolt driver.

Oh heck no.

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2019

The player would be considered passively pumping the pneumatic as he fires since it would be weaker.

That's why they have such long per-shot reload times - to account for the time spent pumping the gun's tank up a bit more each time.

Oh and the nail rifle really has to go away.

I'm not a fan of nuking any of our fun scrap-built weapons. Making the nail rifle require an air tank would make sense, though.

get rid of everything else pneumatic, incl. flamethrowers and the bolt driver.

Oh heck no.

I don't mean permanently, I just mean until a realistic option can be made, like for the flamethrower. Nail guns need to go away because nails themselves make bad projectiles. There's no way you can just pick up a bunch of "nails," load them into a nail rifle, and shoot 10 in an instant/burst, effectively killing whatever is in front of you. At best you'll get ineffective semi-auto operation unless the gun is truly gas powered, but that would only work with gunpowder-powered nail guns. And even those don't do much damage at any range.

@ymber

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

This is the same kind of hack that UPS pseudo ammo currently works by. Properly handling pneumatic items is addressed in the multimag project. Look there for how it needs to be implemented. As it is this doesn't bring us closer to the established goals for ammunition handling and will make future work harder.

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2019

This is the same kind of hack that UPS pseudo ammo currently works by. Properly handling pneumatic items is addressed in the multimag project. Look there for how it needs to be implemented. As it is this doesn't bring us closer to the established goals for ammunition handling and will make future work harder.

Correct it's based on how the UPS works for the ferromagnetic rifle. Not sure if it will make things harder - it exists side-by-side with the UPS system so if you track that down, you'll track this down.

@@ -2929,6 +2929,67 @@
"weight": 11339,
"volume": 12
},
{

This comment has been minimized.

Copy link
@John-Candlebury

John-Candlebury Aug 12, 2019

Contributor

I only gave your code a quick glance, but the changes in this file seem completely unrelated to adding the big bore rifles?

If they are unrelated, you should probably revert them and split them into a new pr.

This comment has been minimized.

Copy link
@misterprimus

misterprimus Aug 12, 2019

Author Contributor

They're changes from my turret ammo drops PR. I don't know how they got into this PR or even why they appear as changes since that PR was already merged. Do I just delete those files from this PR?

This comment has been minimized.

Copy link
@ymber

ymber Aug 12, 2019

Member

For future reference the way to deal with this is update your master and rebase your feature branch onto it.

@ymber

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

The way the UPS works now is a pervasive problem all over the code and copying how it works is not an acceptable way to implement any new features. This is a large change set that we're going to have to rip out again when we get to the relevant part of multimag because the way this is designed is fundamentally incompatible with the direction we're going in for ammunition handling. I'm closing this because it's too flawed to be desirable in a recognizable form.

See #32227.

@ymber ymber closed this Aug 12, 2019

@kevingranade

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

I apologize for not reviewing this before, but on reading @ymber 's rationale, I agree with @ymber that we really do not want to follow this approach, we need to treat compressed air as a separate ammo type within the gun itself, not in an external tank.

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2019

I apologize for not reviewing this before, but on reading @ymber 's rationale, I agree with @ymber that we really do not want to follow this approach, we need to treat compressed air as a separate ammo type within the gun itself, not in an external tank.

I suppose I thought it was a decent solution since it works quite well. As it is air guns range from badly unbalanced (pneumatic bolt driver, pneumatic assault rifle) to downright impossible (nail rifle on burst) and I thought this would be a good way to allow those to either be made more realistic or removed entirely to be replaced with the two guns I included in this PR, particularly since it would require little extra work to rip this stuff out (it was intentionally placed next to the UPS energy use code, which will have to be ripped out anyway I assume).

Hopefully the multimag PR is finished soon.

@misterprimus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2019

I apologize for not reviewing this before, but on reading @ymber 's rationale, I agree with @ymber that we really do not want to follow this approach, we need to treat compressed air as a separate ammo type within the gun itself, not in an external tank.

Also, just wanted to follow up, I was planning on making another rifle that is a PCP multishot that does have a separate parameter for internal air, capable of being recharged by activating the air fitting item (and using up the charges in the container). The present modified rifle in this PR is basically this:
https://www.youtube.com/watch?v=BeeJ6OQzTAc
without an integral air storage container.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Sep 10, 2019

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/pressure-for-pneumatic-weapons/21289/13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.