-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Make farm plots re-tillable in farming extension version 2 #74344
Conversation
Preparation to infer plots for plowing from expansion data so that CleverRaven#73761 can be fixed.
Using dir instead of absolute overmap coordinates allows to access available upgrades from basecamp expansions. This is also more in line with other basecamp missions.
Necessary to get dirtmound terrain from basecamp upgrades into the reference map that farm_action compares to. Fixes CleverRaven#73761.
Whitespace formatting corrected. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I did another test with one of the basecamps where farming is provided on the central tile (modular outpost normal), and with this fix re-tilling works as expected for this. The farming expansion version 1 still might have issues beyond the first upgrade, I'll need to look more into this. |
This will ensure that blueprints having multiple z-levels can be applied correctly to the reference farm map.
Ensure that mission description is consistent with what happens in the mission.
Had to replace Farm expansion version 1 is now also tested, and re-tilling works there as well throughout the upgrade path. I realized the upgrade path seems a bit strange though: first upgrade adds three double-rows of plots, second upgrade starts the shed and does nothing else. However, after the second upgrade there's the option to "re"-plow a fourth double-row of farm plots, which were not created by the upgrade itself. Is this as intended? I think it has to do with these lines in primitive_farm.json:
which appear in both |
Not sure why the test is failing, but I don't think it has to do with this patch. Seems to be related to item descriptions:
...
|
Very cool! Thank you for your work! |
Summary
Bugfixes "Make farm plots re-tillable in farming extension version 2"
Purpose of change
Farming plots in the basecamp farming extension version 2 that have changed terrain (due to plants being harvested / smashed, dirt mounds being tamped, ...) could not be re-tilled through the basecamp mission menu even though there's a mission "Plow fields" intended to do this (issue #73761).
Describe the solution
This PR fixes this issue by making sure the field plots (dirt mounds) which have been built into the expansion are inserted correctly into the reference map which is used by the farming mission to check where tilling needs to be done (closes #73761).
The new code applies mapgen updates according to the upgrades which have been built into the expansion to the farming reference map.
This farming reference map is used by existing code to decide how many / where dirt mounds need to be put.
Since the new code requires access to the expansion's upgrade list, the calling interface needed to be changed slightly (make
farm_action
a member ofbasecamp
class, use relative coordinates instead of absolute ones).Describe alternatives you've considered
Missions to build farm plots, and the mission to (re-)plow fields is in a way two times the same thing. More extensive changes could try to unify that. That would go beyond what should be a direct bugfix though.
Testing
Made a field basecamp, created a farming extension version 1 in one tile, and three farming extensions version 2 (to test rotations and mirroring) in three other tiles. Built fields, planted a through seeds through the basecamp mission, went around and smashed plants / tamped dirt:
Coming back to the bulletin board shows the correct number of spaces to plow:
Performing the "Plow fields" mission in all expansions restores the reference state with dirt mounds, leaving existing plants intact:
Additional context