-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Birdshot demolishes brick walls #55541
Comments
Does the game model each single pellet or is it conglomerated into one damage instance? If it is counted as one, that could be why. There's just a min damage and a max damage where you have a chance to break the wall. Another point is the penetration and hardness which is also not simulated for wall breaking. |
If I'm reading the Json right, birdshot is made of 100 projectiles that do .2 damage each. https://nornagon.github.io/cdda-guide/#/item/shot_bird 00 shot has 9 projectiles that do 15 damage each. I'm not sure why their respective listed damages are 50 and 60, or how that number is applied. |
Are you sure the issue is birdshot = OP & not adobe brick = papier mâché?? |
Adobe brick is made from just soil, which makes it not that as strong as normal bricks. Now, while it's not as strong as normal bricks, it still does seem weird how birdshot was able to destroy it so easily. |
It depends on the range. At point blank it's one instance (this is an intentional design choice), otherwise it's multiple instances. |
Iirc the big damage number is for point blank, or close enough that spread won't be an issue. Shot damage is for spread calculations |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
/Confirm
|
Alright, I've looked into fixing this, and through use of the Visual Studio debugger, I've come to some interesting conclusions. As, to my understanding, the full damage is not supposed to be applied to individual instances of shot (unless bashing is different), that means that this is not merely game logic working correctly in a weird way, but an error in the game logic. I don't know if this only applies to bashing logic; it's possible shotguns work fine on monsters. However, in Character::fire_gun(), in the for loop going through each projectile, it doesn't seem to be properly breaking out of the loop (and setting multishot to false). However, a damage of 51 for birdshot and 61 for 00 shot is being applied on each shot to the bash code. So while I'm pretty sure a tile away is supposed to be enough for point blank range (it doesn't seem to recognize it as such), even if it weren't it still should only apply the individual projectile damage with each projectile). If each individual shot were counted, it should be unable to even scratch adobe. But if one, point blank shot were counted, it should take many, many shots with a shotgun for the map damage to accumulate enough to destroy it. Neither of those are the case. My guess is that 1) no point blank damage adjustment is being done, and 2) the calculation for point-blank distance is wrong. I wasn't able to figure out more tonight, but I can see if I can find time in the next few days to look at it more. The code for point-blank distance (which doesn't seem to affect damage, only a message and preventing shooting more than one projectile) is this:
My guess is that damage is decreased based on similar code elsewhere, maybe in the code that only damages creatures. I'll look back at it later. |
Okay, I think I've narrowed down (one of) the problem(s).
Here, shot.end_point is being used for the calculation. shot.end_point, however, is not necessarily where the damage was applied, but rather where drops are supposed to land.
This changes shot.end_point to the tile before the wall if the hit tile is impassable, which allows projectiles to drop one tile before the wall they hit. However, this means that rl_dist is falsely calculating whether the tile is adjacent based on where the drop lands, not where the gunfire is hitting. The issue is, I don't know if there are situations where you'd hit a tile that isn't impassable, meaning you can't just modify the calculation to determine point-blank if the rl_dist turns up 0. We also can't use the targeted tile (I don't think), as the calculations should determine point blank based on where the shot hit, not where you aimed it. My first thought is to add another field to struct dealt_projectile_attack, returning an additional tile of where the shot hit, but this would potentially require many changes to other code that uses dealt_projectile_attack. We should probably also rename end_point, to something like "drop_location" to avoid this type of confusion in the future. If we don't want to do that, I can try to come up with some other way of fixing the issue. Advice from someone with more knowledge of the codebase would be appreciated before I do something like this. |
I think you're on to something, but I don't think it's with multishot, that's only used for adjusting the hit mesage, not where terrain gets bashed. |
It looks like a part of the problem is that the transition from "act like one projectile" to "act like a bunch of shot" happens here Cataclysm-DDA/src/ballistics.cpp Line 433 in 6153560
|
Yes, I believe there are actually two problems. Firstly, there's the fact that it doesn't properly recognize (in ranged.cpp) when it's hitting point blank. The problem isn't the multishot changing the message, it's the break statement after it, which is supposed to exit out of the for loop after one shot, rather than looping through each one. The suggestion for modifying the dealt_projectile_attack struct is because, at least at first inspection, it appears that the calculated data needed for determining if it's point blank is provided by ballistics.cpp and not being returned to ranged.cpp for use there. The second one is (I think) what you just mentioned, which is that at long range (or at what's supposed to be point blank, as we're currently not telling the difference) each individual shot is dealing the full damage, rather than shot damage. A shot at an adjacent wall is currently both shooting every pellet, which it shouldn't, and calculating each as having the full damage, which it shouldn't even if it were supposed to shoot them all. The full damage issue is also present at long range. |
What is persistent map damage? I think it's simply just rolling for breaking the wall 20 (why is birdshot only 20 and not 100?) times at 50 (51?) strength. For example, it doesn't seem to be able to punch through brick wall (60 str_min) or concrete (80 str_min) no matter how many times you shoot. |
The birdshot-only-having-20-shots problem is also something I've noticed, but I don't think it's directly relevant. You're right, though, we should address it somewhere. As for persistent map damage, I don't fully understand it, but it seems there's a feature where it keeps track of damage on a per-tile basis. I'll check again, but I think I remember getting dry stone walls to demolish after a few hits. I had thought it was just rolling with the same odds each time, but looking at the code showed it was factoring in damage that increases after each pellet that hit. You can see the damage increasing in the debugger after each hit. |
20 distinct pellets of birdshot is intentional, because otherwise they each have fractional damage. |
Coming soon...
|
Nice, using shot.proj.count was a very neat way of doing it that I wouldn't have thought of. |
Is your feature request related to a problem? Please describe.
A single round of birdshot from point blank range destroying 3 tiles of adobe brick walls is absurd.
Solution you would like.
A single round of birdshot should not demolish 3 tiles worth of adobe brick walls from one tile away.
Birdshot would have trouble penetrating wood, much less brick.
https://images.guns.com/wordpress/2017/06/BirdshotBuckshotarticle3.jpg
The spread of birdshot at 10 yards (tiles) is less than a 1 foot.
Describe alternatives you have considered.
Birdshot can remain the most economical remodeling tool in the game.
Additional context
No response
The text was updated successfully, but these errors were encountered: