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

Cutting up items produces weird results #7508

Closed
Wuzzy2 opened this issue May 2, 2014 · 17 comments

Comments

Projects
None yet
10 participants
@Wuzzy2
Copy link
Contributor

commented May 2, 2014

This is more like a meta-bug report.

When you cut up some uncommon items for cutting up, you often get very weird results.

I guess currently cutting up simply works by taking the materials of an item into account. If the item has ANY of the materials plastic, fabric, kevlar or wood (possibly others?), it is possible to cut it up.

This produces some very unexpected and weird results:
Shotguns can be cut up into skewers.
If you cut up guns with mods, you lose all the mods.
If you cut up a gun with ammo, you lose the ammo as well.
I’d say just because a gun has SOME plastic does not mean it should be possible to cut it up at all.

Items which are made of two materials which would both be applicable for cutting up, you end up with only one kind of item, the other material is simply discarded. If, for example, an item is made of plastic and fabric, you’ll receive either rags or plastic chunks, but not both.

MBR vests are very messed up.
I once managed to cut up a MBR vest (kevlar plates) into 20 kevlar plates! But only 8 kevlar plates fit into an empty MBR vest.

And here, the most hilarious message:
“You cut the mininuke (active) into 3 plastic chunks.”

These are all just examples. I bet there are many other crazy cutting up results.

There are related issues, they are all part of the same problem:

All these examples show me that something is deeply flawed with the current design of cutting up and it needs to be rethought.
Any ideas?

@vache

This comment has been minimized.

Copy link
Contributor

commented May 2, 2014

Making the "cut" action perform more like destructive disassembly seems like the way to go with it.

@kevingranade

This comment has been minimized.

Copy link
Member

commented May 2, 2014

For a quick fix to some of the cases, it could check if the item has a
disassembly recipe and apply that, but of course not everything has one.
Probably 'cut up' should only apply to items composed of one eligible
material, or possibly to items with a primary eligible material, need to
look at a list of those categories to see which one makes more sense.
Should be pretty simple to generate a list of items in each of these
buckets.

@vache

This comment has been minimized.

Copy link
Contributor

commented May 2, 2014

Maybe we could implement a "size" value to cuttable items that determines how much of their materials get returned, and could further be used for fitting/making clothing mutant compatible. There would have to be some way to reconcile (automatically?) the required materials with the cutting materials for craftable items as well.

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented May 2, 2014

Maybe we could implement a "size" value to cuttable items that determines how much of their materials get returned

The current system uses the item's volume for this.

@EkarusRyndren

This comment has been minimized.

Copy link
Contributor

commented May 10, 2014

the Kevlar MBR is made of Kevlar and has Kevlar "plates" in it. if I remember correctly the current system uses it's "size" volume to determine how much "stuff" you get.

@jeremyosborne

This comment has been minimized.

Copy link
Contributor

commented May 30, 2014

I'm looking at this right now. There's code in a few different places right now that all do relatively the same thing, and also do some things differently. Probably won't be a quick or glamorous fix, but good for giving me some practice and I'm willing to give it a shot.

tl;dr
First question: what are people's thoughts on streamlining the keystrokes of the current disassembly routines? It seems like it's starting to happen with the overloading of the butcher command that I've been noticing.

tl;

The hardest part of Cataclysm for me to figure out was the keystrokes needed to do what I saw people talk about on the forums and wiki in simple word phrases (cauterize, cut up, etc.). There are put-things-together mechanics in the game that I've grown to understand are separate: crafting items (item construction), car construction+destruction, and outpost construction+destruction. Those menus are fine.

What would people think about the disassembly code/action encompassing more?

A test I just did to make sure I wasn't remembering things wrong:

  • Pick up 2-by-four.
  • Try to disassemble 2-by-4.
  • Can't "disassembly."
  • Try cutting 2-by-4.
  • 12 skewers produced.

Here's my question: as far as I know most items can only be disassembled into one thing or one set of things. Is there any reason the veterans know that the above, which doesn't work through disassembly, couldn't/shouldn't be piped through the disassembly code vs. sending through iuse::cute, iuse::knife, etc?

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 30, 2014

I think disassembly generally requires that you have a recipe to list the required outputs; BevapDin's done some work on that IIRC but we still need recipes for bots, etc.

@jeremyosborne

This comment has been minimized.

Copy link
Contributor

commented May 30, 2014

@KA101 what I'm thinking of is moving the stuff that would cause a failure in the disassembly code in game.cpp that exists elsewhere (iuse:cut... this time I spelled it right, and iuse::knife for starters) to the disassembly fail positions. I'm thinking of

  • taking the code and building some more disassembly utility functions (that would be the guts of iuse::cut and iuse::knife)
  • if the object can't be "disassembled" by current code, checking to see if the object could be disassembled by other means/tools the character is carrying.
  • If the character has the tools, do the more raw and destructive break down.

I'm trying to confine this to what is a disassemble vs. when tools are used to transform. The knife would/could still carve things, and would still offer the option to cut (at least for now), as well as cauterize (not sure where that could go other than where it's at).

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 30, 2014

OK, I misread. Apologies. Not really sure about that aspect of things.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented May 30, 2014

Disassembling uses the crafting recipes, cutting things into pieces uses iuse functions.

Regarding the cut logs into skewers: that is an iuse function and works like the cutting up plastic/cloth with a knife - if the item material is leather, you get leather patches, if it's wood, you get skewers. (There was the bug where you could cut up a rope into skewers as the rope had the material wood.) This is not disassembling. It uses a different system. It always results in items of one type (some leather patches or some skewers or some rags or ...), only different amount.

Disassembling uses a crafting recipe (one that has the reversible property and the result item type must match the item to be disassembled). One can get different items out of this and it can require different tools. See the go bag, it disassembles into a bunch of items, but you could also cut it up to get rags.

I think those two actions should be clearly separated. I don't want to accidentally cut my go bag into rags instead of disassembling it into all the useful items.

@jeremyosborne

This comment has been minimized.

Copy link
Contributor

commented May 30, 2014

Thanks @BevapDin. I was trying to find an example that met the criteria for needing the two different functions, but didn't have one before the go-bag (and I'm sure there are others).

Let me see if we can prevent some of the weirdest behavior first with the iuse functions. Cutting a mininuke into plastic chunks (and eyebots and robocops into single plastic chunks) is what this issue was getting at.

@kevingranade

This comment has been minimized.

Copy link
Member

commented May 31, 2014

I could definitely see merging the trigger for the two, but only falling
back to cutting if there's no dissasembly recipe.
In fact, I think ditching the knife iuse and turning it into a generic
disassembly recipe would be an improvement. I'd be sympathetic to
arguments that applying a cutting tool should still be possible though.

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented May 31, 2014

I say yes to merging the keypress/trigger.

@jeremyosborne

This comment has been minimized.

Copy link
Contributor

commented May 31, 2014

Would anyone object to me making the scissors act like a knife for all intents and purposes while I'm fixing this? (Slightly off topic, but since I'm cleaning up code, and the iuse::scissors is staring me in the face, and they share code, thought I'd ask.)

By the way, I'm still partial to logically merging the keypress/trigger, too, but this is going to be a [WIP] fix for few days at least.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Jun 1, 2014

The only thing that jumps out at me offhand is that iuse::knife probably
allows inscription and iuse::scissors doesn't. Other than that the
probably are the same.

@bug-sniper

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2014

In the meanwhile, in case someone reading this hasn't realized it, accidental butchering or slicing is a perfect excuse to throw away the resulting chunks and wish for a replacement. Otherwise, it won't be fun to never see another hammer in your game.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Oct 27, 2014

Woo #7805!

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