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

Debug tool: spawn requirements and craft #60094

Open
I-am-Erk opened this issue Aug 12, 2022 · 3 comments
Open

Debug tool: spawn requirements and craft #60094

I-am-Erk opened this issue Aug 12, 2022 · 3 comments
Labels
Code: Debug Debugging and troubleshooting the game, also includes the debug menu Code: Tests Measurement, self-control, statistics, balancing. Code: Tooling Tooling that is not part of the main game but is part of the repo. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing (P2 - High) High priority (for ex. important bugfixes) Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA <Suggestion / Discussion> Talk it out before implementing

Comments

@I-am-Erk
Copy link
Member

Is your feature request related to a problem? Please describe.

Attempting to debug and playtest crafting is, to put it mildly, a pain in the ass. Debug Hammerspace grants you all components and tools, but prevents crafting failures, cannot test component inheritance (eg calorie and vitamins), disassembly, proper use of charge, destruction of components... ie. almost anything you might want to playtest with crafting. If you want to actually test a few recipes, you have to debug in components to all those recipes, plus the tools to use them, plus the charges for the tools. It is a huge amount of work and leads to insufficient playtesting of crafting PRs because we are not made of infinite time here!!

Solution you would like.

We need a debug tool, or tools, that allow us to spawn the requirements to a recipe in order to craft it. There are several ways this could be done, here are two I like:

  • the Hammerspace mutation as it exists could be removed, and a new one of the same name made that does this. So, when you go to craft a recipe and you have Hammerspace, any tool or component you don't have is automatically spawned for you.
  • We could add a debug command that opens the crafting menu as usual, and when you go to craft a thing you don't have all the stuff for, the missing stuff is added.

I don't care which we pick as long as we pick one. What should happen when you attempt to craft something under this framework is:

  • For every ingredient you do not have, a random ingredient from the crafting list is selected and spawned.
  • For every tool quality you do not have, a random tool with that quality is selected and spawned, along with exactly enough charges (if you have a valid tool without enough charges we can just ignore it and make a new one).

If there is a tool requirement for the recipe that could not be spawned as an item, we get a debugmsg like:

Recipe requires a tool with LIFT 1 but no spawnable item has this quality!

crafting aborts and you have to make a lift furniture before going onward.

Describe alternatives you have considered.

Another option would be a debug command to select a recipe by ID and spawn one of every ingredient that you could use in that recipe. However I prefer the random version because random component selection is a very good way to playtest.

We could keep the hammerspace tool as is and make this a new one. However I believe the current hammerspace mutation is actually just a trap, it is marketed as a debug tool but makes a lot of relevant debugging impossible. I think this is in every way a superior option.

Additional context

As far as tools go, once implemented this may also be very handy for testing and CI.

I am marking this as P2 because there are some major crafting changes ready to implement, and they are almost impossible to adequately test without either this or a horde of volunteers

@I-am-Erk I-am-Erk added <Enhancement / Feature> New features, or enhancements on existing <Suggestion / Discussion> Talk it out before implementing (P2 - High) High priority (for ex. important bugfixes) Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Code: Tests Measurement, self-control, statistics, balancing. Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA Code: Tooling Tooling that is not part of the main game but is part of the repo. Code: Debug Debugging and troubleshooting the game, also includes the debug menu labels Aug 12, 2022
@ZeroInternalReflection
Copy link
Contributor

What are your thoughts on a system like this?

Hammerspace_light--Nodachi.mp4
  1. Have a debug mutation (currently "Hammerspace Light") that enables a debug action in the crafting menu
  2. Upon using the debug action, have an opportunity to enter a random seed for the items (For instance, if you encountered a combination that didn't work and you need to retest, it's a lot easier to note that number than to recreate every item by hand)
  3. For each quality requirement, tool, and component of the selected recipe, generate a list of possible options and randomly select one (this currently ignores your current crafting inventory)
  4. Spawn the items and note what was spawned in the log. If no spawnable item meets the requirement, note that too.

@I-am-Erk
Copy link
Member Author

That looks like exactly what I want. As a debug option I don't think there's any need to compare to current crafting inventory, it's ok if it generates something you already had.

@Brambor
Copy link
Contributor

Brambor commented Aug 12, 2024

If you want to actually test a few recipes, you have to debug in components to all those recipes, plus the tools to use them, plus the charges for the tools.

The problem with just spawning 1000 of every item is then that you cannot check whether the charges / items were used up, right? That is the only reason why you want to spawn exactly what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Debug Debugging and troubleshooting the game, also includes the debug menu Code: Tests Measurement, self-control, statistics, balancing. Code: Tooling Tooling that is not part of the main game but is part of the repo. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing (P2 - High) High priority (for ex. important bugfixes) Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants