Drop weapon glitch for ammo

These bugs do plan to be resolved, when they can be.

Moderator: GZDoom Developers

Deathlike2
Posts: 317
Joined: Wed Nov 03, 2004 10:17 am

Re: Drop weapon glitch for ammo

Post by Deathlike2 »

Spleen wrote:
Graf Zahl wrote:
Spleen wrote:
It seems simpler to flag a player, whether they picked up a certain kind of weapon at some point, or even started with it. For example, Bob can only get ammo from shotguns once, even if he drops a shotgun and tries to pick up another one.


And that would whack the balance of how many existing multiplayer WADs?
Not many I would think, since the amount of ammo players get would be exactly the same as playing with weapon stay right now, without abusing the drop glitch. With weapon stay off, Bob would still be able to get ammo from every shotgun. This is just for weapon stay on.
I think you are missing the point.

You are changing the exploit in a different manner. If you have a friend (or willing participant) that wants to pick up your dropped weapon, that person can then proceed to drop that weapon back to you. With your proposed suggestion, the drop weapon-ammo deal is abused differently, and it is simply not a solution.
User avatar
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: Drop weapon glitch for ammo

Post by Spleen »

Deathlike2 wrote:You are changing the exploit in a different manner. If you have a friend (or willing participant) that wants to pick up your dropped weapon, that person can then proceed to drop that weapon back to you. With your proposed suggestion, the drop weapon-ammo deal is abused differently, and it is simply not a solution.
Yeah, I am missing the point. Neither I nor my friend will receive more ammo since dropped weapons already don't give ammo. The exploit involves picking up a weapon that stays, not a dropped weapon. I understand Graf's concern, but I don't see how it would be exploitable.
Deathlike2
Posts: 317
Joined: Wed Nov 03, 2004 10:17 am

Re: Drop weapon glitch for ammo

Post by Deathlike2 »

I think I understand what Graf is saying (and rereading the thread helped).

When you make the checks, you want it to rely on the item, and not the player. If the checks are made on the player, a player in a hacked state can abuse said proposed behavior (the hacked player would have the never-picked up weapon state for all weapons, allowing for the preplaced weapons to be picked up infinitely, you could probably hack in something that a player has the weapon/ammo/equipped). If the checks are made on the item, the item pays attention to all players, as to whether it has been picked up while that player is alive and adjust its properties accordingly.
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Drop weapon glitch for ammo

Post by NeuralStunner »

I wouldn't keep a player from ever getting ammo from the same weapon - it's an important way to get ammo from certain enemies.

Is it not possible at one point to set the ammo value for dropped weapons to zero? Similar to how a map-placed shotgun is worth 8 shells, while a sergeant's dropped shotgun is worth 4.

(And BTW, since weapons and inventory can be dropped, I tried dropping some ammo. "Drop Shell" will drop one shotgun shell, but "Drop Shell 50" will still only drop one. Maybe Drop could be extended to allow amounts for items?)
User avatar
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: Drop weapon glitch for ammo

Post by Spleen »

NeuralStunner wrote:I wouldn't keep a player from ever getting ammo from the same weapon - it's an important way to get ammo from certain enemies.
I could put in a check so it still gives ammo from weapons dropped by monsters. Basically, only weapons that stay after being picked up will be affected by the new limit. But it appears that the check should be done weapon-side and not player-side.. hmm. I guess I'll have to do it that way.
NeuralStunner wrote:Is it not possible at one point to set the ammo value for dropped weapons to zero? Similar to how a map-placed shotgun is worth 8 shells, while a sergeant's dropped shotgun is worth 4.
Weapons manually dropped by players already have an ammo value of zero.
NeuralStunner wrote:(And BTW, since weapons and inventory can be dropped, I tried dropping some ammo. "Drop Shell" will drop one shotgun shell, but "Drop Shell 50" will still only drop one. Maybe Drop could be extended to allow amounts for items?)
Yeah, that would be pretty useful.
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Drop weapon glitch for ammo

Post by NeuralStunner »

:? I don't see what more really needs to be done, then... Seems to work almost perfectly now to me. The only problem I've seen is with items being dropped "inside" walls, because their default Radius (20) is larger than the player's (16). They, as well as Inventory items, should probably check for sufficient space before dropping. As it is, dropping a weapon while too close to a wall makes it get stuck, and it can't be picked back up.
Spleen wrote:
NeuralStunner wrote:I wouldn't keep a player from ever getting ammo from the same weapon - it's an important way to get ammo from certain enemies.
I could put in a check so it still gives ammo from weapons dropped by monsters.
I forgot to add, it's a nice thing for map-placed ones too. The only place this is not done is a co-op game, which has the (understandably needed) equivalent of a permanent Weapons Stay flag. (But, flagging each instance of a weapon for each player, so it could be picked up only once but another instance could be picked up after, sounds like a pain in the arse.)
User avatar
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: Drop weapon glitch for ammo

Post by Spleen »

NeuralStunner wrote::? I don't see what more really needs to be done, then...
The original problem is an exploitable glitch which let players get infinite ammo by repeatedly dropping a weapon and picking up the original one - since it has weapon stay, you can pick it up as much as you want and keep getting ammo.
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Drop weapon glitch for ammo

Post by NeuralStunner »

Spleen wrote:The original problem is an exploitable glitch which let players get infinite ammo by repeatedly dropping a weapon and picking up the original one - since it has weapon stay, you can pick it up as much as you want and keep getting ammo.
Duh. I forgot that part. :oops:

Yeah, and you also end up with "actor spam": A lot of duplicate copies of the weapon, that have 0 ammo value and thus can't be collected.

Probably wouldn't want to turn off weapon dropping altogether. (Might want to toss a weapon to a teammate who just respawned, etc.) But that's the only option I see for the players, to negate the possible exploit.

Off the top of my head, and maybe impossible: A new internal field, similar to [wiki=Classes:WeaponHolder]WeaponHolder[/wiki], which tracks what weapons you've picked up? When attempting to pick up a weapon, first it checks for the +DROPPED flag. If that's on the dropped weapon, it can proceed like normal. Otherwise, if Weapons Stay is active, it checks whether the weapon is already in that field. If not, give the weapon and its ammo then add it to the field. The field should also be discarded whenever entering a new hub/cluster (+INVENTORY.INTERHUBSTRIB). Since Inventory is reset per map in DM, it would work fine there too.
kevans91
Posts: 72
Joined: Tue Sep 16, 2014 11:25 am

Re: Drop weapon glitch for ammo

Post by kevans91 »

I think I've got this one figured out: https://github.com/rheit/zdoom/pull/179

I added a pickedUp flag to AInventory that is set in AInventory::TryPickup after clone->AttachToOwner(). AWeapon::AttachToOwner was changed to check the pickedUp bool of the weapon, and either add the ammo to the existing stock or just find the proper ammo types in inventory, dependent on whether it's been picked up previously or not. This shouldn't have any negative side effects, but I might be missing something.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Drop weapon glitch for ammo

Post by Graf Zahl »

Well, you at least forgot one thing: This stuff is not stored in a savegame so a save/reload will reset it all.
kevans91
Posts: 72
Joined: Tue Sep 16, 2014 11:25 am

Re: Drop weapon glitch for ammo

Post by kevans91 »

Graf Zahl wrote:Well, you at least forgot one thing: This stuff is not stored in a savegame so a save/reload will reset it all.
I've amended it to bump up SAVEVER and save pickedUp. I'll continue to test it out a little bit-- this one has me a little more skeptical than others, because it took me a little bit to follow what exactly was going on with the different scenarios for picking up weapons.
kevans91
Posts: 72
Joined: Tue Sep 16, 2014 11:25 am

Re: Drop weapon glitch for ammo

Post by kevans91 »

Apologies for the double post, but I renamed pickedUp to "allowDispense," because that seems to better reflect what it's doing and what it's intention is. Furthermore, its value is only changed when an item ShouldStay().
Post Reply

Return to “On Hold Bugs”