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

Introduce camp z level construction #73176

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Apr 21, 2024

Summary

None

Purpose of change

Provide Z level aware camp construction (with a long term goal to separate the unseemly connection between a room and its roof).

Describe the solution

  • Added support for Z level coordinates in JSON construction (only tested in a single place).
  • Modified a whole lot of code to make the whole chain Z level aware.
  • Modified the JSON of the chicken coop of livestock expansion 2 to specify a roof. This will have to go before release as additional support would be needed to get it to work properly (see additional context).
  • Changed the "z" JSON token to "check_z" to free up "z" for the Z coordinate. No JSON was found using the token in the base game or the bundled set of mods.
  • Updated the documentation.

Describe alternatives you've considered

Tried and failed to come up with ways in which this can be partitioned into smaller pieces.
There are outstanding issues (see additional context).

Testing

  • Compiled and had the game not blow up when started (eventually).
  • Constructed a chicken coop in a handy save and verified the roof was as expected (uniform and of the material specified, rather than the normal case where the roof above doors and windows is different).
  • Spawned a monster in the air when constructing the roof (missed the coordinates for the roof).
  • Added some furniture on top of the roof to test that the point, line, and square commands work (although the planters were placed incorrectly by me). Removed that JSON after testing, though.
    Screenshot (338)
  • place_npcs blows up regardless of where I place them. It seems to want to iterate over EoCs where the pointer is illegal. Tried farmer, exodii_material, and some apartment survivor. JSON faction camp construction usage of place_npcs blows up #73190.
  • place_items successfully placed a pile of pot on top of the shed.
  • faction_owner testing failed. I can't get it to either mark a pre placed gift card or pot generated by the same mapgen as owned by "exodii" at the ground level. Don't know if I don't know how to use it or it doesn't work at all.
  • place_fields work with gas, but not fields requiring a floor. Resulting in Mapgen place_fields doesn't work properly when paired with placement of new floors #73191.
  • place_vehicles placed a bike on top of the shed. Really weird things happened when the save was loaded, though, as the modified JSON somehow resulted in error reports about some lone Will faction not existing and companions becoming hostile. All because of the introduction of a place_vehicles entry in the JSON. Won't report it as my saves are too large to be compressed down to an acceptable size.
  • remove_vehicles not tested (too much work to set up test conditions).
  • place_item spawned a rock successfully.
  • place_rubble failed on Z+1, but works on Z. Debugging shows it again bails out on a test for is_open_air, i.e. #93191.
  • place_liquids spawned a gasoline puddle successfully.
  • place_corpses successfully spawned a kitten corpse.
  • placed_computers successfully spawned a working computer, but complaints about it being placed in open air appeared (Mapgen place_fields doesn't work properly when paired with placement of new floors #73191).

Additional context

Outstanding issues:

  • It doesn't cost anything in terms of skill, materials, and time to build the modified chicken coop. Defining a construction entry for the roof tile, as well as switching to something that has construction does it. However, given that issue, this PR will NOT actually use the roof: it will have to be added once this issue has been solved.
  • Once the zero cost issue is solved we're probably going to be faced by double costs for the roof, as it's factored in to the cost of the walls, floors, etc. I think it ought to be acceptable during a transition period.
  • You can't actually construct roofs, because you can't get to them. There's a need to allow you to use a ladder to construct something at the Z level above a supporting tile.
  • The check_support logic is deficient for roof construction as it doesn't allow for, or even check, support from directly below (because the current logic demands a roof on top of everything that has a roof defined for it, so the way to test this is to debug place a wall and then try to do things with the tile above it, and do that before saving so the add_roofs doesn't implicitly kick in).
  • The chicken coop is about as small an example I can make (done properly with palettes, although more can probably be done to provide nice edges). As mentioned above, it won't actually be used.

The sexy concrete roof of the chicken coop as seen from the evac shelter's roof:
Screenshot (337)

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Scenarios New Scenarios, balancing, bugs with scenarios labels Apr 21, 2024
@PatrikLundell PatrikLundell marked this pull request as draft April 21, 2024 18:03
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Apr 21, 2024
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Apr 21, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Apr 21, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 22, 2024
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [Markdown] Markdown issues and PRs labels Apr 22, 2024
@PatrikLundell PatrikLundell marked this pull request as ready for review April 23, 2024 08:37
@github-actions github-actions bot removed the json-styled JSON lint passed, label assigned by github actions label Apr 23, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 23, 2024
…_2/modular_livestock_construction.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 23, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 25, 2024
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 [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Scenarios New Scenarios, balancing, bugs with scenarios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant