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

parameterized field base camp version 2 #64183

Merged
merged 3 commits into from
Mar 17, 2023

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Mar 12, 2023

Summary

None

Purpose of change

Main purpose:

  • Make use of the ability to use palette parameters in mapgen/recipes to reduce the size of the JSON for field base camp version 2.

Side purposes:

  • Remove bed/cooking construction of the first building as prerequisite for further construction.
  • Add the option of making makeshift beds (made easy by the palette parameters).

Describe the solution

Massaging the construction recipes into palette parameter based ones.

Describe alternatives you've considered

Leave the new functionality implemented for this purpose unused.

Testing

The main testing was performed while testing the functionality (#58180), but a quick sanity check constructing the whole base camp with "random" materials for different parts was done before producing this PR.

  • Verify that all construction materials actually can be used (but possibly not for every individual segment, although that probably was done before the PR went into the deep freezer last year).
  • Verify that all 3 first building cooking facilities can be constructed.
  • Verify that all 3 bed options can be constructed. Every option for every position has not been tested, though, but rather all permutations for the first room and "random" ones for the rest of them.

Additional context

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Mar 12, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JSON & C++ formatters

data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_common.json|189|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_common.json|211|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_common.json|233|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_common.json|255|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|14|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|19|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|41|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|46|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|68|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|73|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|95|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|100|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|122|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|127|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|149|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|154|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|176|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|181|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|203|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|208|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|230|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|235|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|257|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|262|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|284|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|289|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|311|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|316|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|338|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|343|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|365|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|370|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|392|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|397|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|419|
data/json/recipes/basecamps/base/recipe_modular_hub/version_2/recipe_modular_field_construction.json|424|

@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 12, 2023
@PatrikLundell
Copy link
Contributor Author

An unrelated comment: After finding that the binding of the JSON uglifier (json_formatter.exe) was missing from Visual Studio as the result of an upgrade that resulted in reinstall a while ago, I manually applied the uglifier to all of the files modified and pushed the result (which is what's in this PR). I then located https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/JSON_STYLE.md and followed its instruction for restoring the "Lint All JSON" tool and then applied the uglifier. The result was that a bunch of starting with .github/vcpkg_ports/sdl2/vcpkg.json was modified. Is this intended? What happens when I inevitably push those changes after having made JSON changes in a future PR?

@jbytheway
Copy link
Contributor

I think having those files linted is an unlucky coincidence of the current situation. The powershell script lints any file that's different in your branch and either master, origin/master, or upstream/master. Recently there was a PR to change some of the vcpkg stuff, so those files were different in one of those branches when they wouldn't normally be. If you update master on your fork and rebase your branch then it shouldn't happen any more.

Still, I agree that behaviour isn't ideal. If you know how to wrangle powershell then I'm sure a PR to improve the situation would be welcome :).

@PatrikLundell
Copy link
Contributor Author

Thanks for the answers.

I'll definitely update my master before making any new branches (that is, or should be, standard practice). In fact, I believe my branch was produced immediately after updating master (and I remember I did update it), so any external changes would have happened during a fairly short time measured in hours.

However, even if these normally stable files are changed, why aren't they're subjected to the formatting rules applied to everything else? If they were, no requirements to change the files would occur, and the only side effect might be additional time for the processing of these files (which is rather substantial anyway, so it's fired off and then it's time to do something else in the mean time).

I am, unfortunately, not good at using any kind of shell scripting. Looking at the script I can get a gist of approximately what it's doing, but that's about it.

@PatrikLundell
Copy link
Contributor Author

I very much doubt the field tests failed due to my addition of a word in a string (the tests succeeded before that commit)...

@kevingranade kevingranade merged commit 30f7ad4 into CleverRaven:master Mar 17, 2023
@PatrikLundell PatrikLundell deleted the field_ver_2_par branch March 17, 2023 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants