-
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
disappear upturned dirt, unable to plant or plow #73761
Comments
The is_dirtmound lambda inside |
@PatrikLundell Can I bother you to look into this? My suspicion is that casting the fake_map(tinymap) to a full map causes our 'relative coordinates' to be wrong (since a Cataclysm-DDA/src/faction_camp.cpp Line 3581 in 140db31
|
I'll try to get to it when done with my current activities. Casting a tinymap to a map should be perfectly fine as long as all references used refer to that same map and you don't try to use coordinates converting to the bub coordinate system from the abs one. Edit: It's sort of possible with farm expansion 1 if you can determine whether to load faction_base_farm_0, 1, 2, 3, or 4 from somewhere (and maybe the OMT type changes to match that for farm 1, in which case that one could actually work). The only thing that's in faction_base_farm_2_0 is t_region_groundcover, which may match what was in the fakemap (more or less random values in the range 420 to 424 for the two rows of the first submap I looked at. Obviously I have no actual idea what these numbers are mapped to). I tried hacking that definition by replacing the first 4 groundcover definitions with dirt mounds, started up the save, and saw that now 4 tiles were available for tilling. I can see two solutions to the problem:
And regarding the coordinates: both the fakemap and the "real" tinymaps are tinymaps and so their coordinate systems match perfectly. In addition to that, the mapgen stuff all works on the top left corner of the map, and so would use the same coordinate values regardless of the underlying type of the map used. |
I've been looking into this issue, and think it can be resolved most easily by applying the mapgen updates of all the upgrades that have been built in the expansion to the fake_map, before doing the comparison to the actual state of the terrain. Also rotations / mirroring needs to be taken into account. I don't think anything additional has to be stored in the expansion data, because the locations of dirt mounds can just be extracted from the mapgen data for the existing upgrades each time it is needed. I'll try to work on a solution along these lines and make a PR. Might need to make the |
You'd also have to deal with palette parameters. No current implementation depends on which value you select, but you still have to select a legal value. |
Preparation to infer plots for plowing from expansion data so that CleverRaven#73761 can be fixed.
Necessary to get dirtmound terrain from basecamp upgrades into the reference map that farm_action compares to. Fixes CleverRaven#73761.
@PatrikLundell can you clarify the issue with the palette parameters? I'm not sure where this would affect the code I'm changing or the mapgen updates. I think if at all it is done somewhere in the functions that are being called, as I haven't seen it in the |
It may be a non issue, but I'll explain my concern: If the actual recipes used are recorded (as opposed to discarded when the building construction is finished) my concerns should not be valid. |
Ok, I think this is the main point indeed. What seems to be recorded in the expansion data is the In the modular farming extension, the recipe id's are the same as the Is there maybe a better way to get a recipe id, or would it make sense to store the recipe id itself in the expansion data? Or actually it may be an advantage that we can define a re-tilling map as a recipe, which can be accessed by a |
Unfortunately, your assumption about the recipe being the same as the blueprint_provides entry holds true only for version 2. Version 1 uses the implicitly defined name of the "result" string, which differs from the contents of the "construction_blueprint" name. If you're going the route of recording blueprints you probably should extract them on the finishing of their implementation (upgrade_return), before the data goes out of scope. That info should contain all the info you need to reapply the recipe, including any parameter selections. The code called (however far down the chain) extracts the full blueprint name in order to find the blueprint JSON and apply any parameters to it., and that's the data you'd want. I'm not a fan of re-tilling recipes, because you'd need one recipe for each possible set of previously applied plots (not an issue currently, I think, because the order in which you can add plots is set to be static, but there's nothing inherently stopping an expansion to let each segment be created individually, without any imposed order: that's a choice made by the expansion implementor, and my reason for making the order fixed is that you'd gain the flexibility of defining which order you'd add essentially sets of the same functionality where the order doesn't really matter for more clutter in the UI. And I should mention that palette parameters probably aren't something that's going to be encountered, as neither of the general farm expansions make use of those (version 2 doesn't have any buildings, and version 1 does have a building, but it's neither supporting different materials, nor does it provide mounds in the same recipe as the building). |
I can have another look at farming extension 1, though I did test this one also with the first set of plots that can be built. I'll also check the other basecamp types for farming upgrades and make sure that these work. Recording individual mounds during basecamp upgrades is not really a thing I'd want to do, it would be rather cumbersome I think. Also, I'd prefer to find a fix for this that does not require additional saved states in the expansion data, to avoid savegame compatibility issues etc. I don't think the re-tilling recipes (or maybe just mapgen update functions) would be a problem. Most upgrades relevant for this can just add their recipe id / mapgen id to their |
Just for the record, these are the basecamp designs and expansions that use the
|
Explicitly adding the recipe names to the blueprint_provides would work when no parameters are involved. It should also be possible to add these retroactively by introducing a set of conversion recipes that take no time and which would add the recipe in question to the set if it's not present. Those recipes would show up only if a blueprint has been used but not included. |
Looking further into it I realized that we can actually rely on the recipe id being put into the blueprint_provides list within the expansion data. This is even stated in the docs (https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/BASECAMP.md#recipe-jsons) and seems to be done by code in
(it seems the comment has a typo with -> without) |
Describe the bug
unable to build new farm plot, plant or plowing the already existing build, which is disappeared
Attach save file
fucking new world-trimmed.tar.gz
Steps to reproduce
no idea how the upturned dirt got un-upturned then be unable to replant but build a farm survey 2 then build the max tilted soil then plant them
Expected behavior
to be able to have a re-plow-able experience
Screenshots
Versions and configuration
Dark Days Ahead [dda],
TropiCataclysm [tropicata],
Bionic Professions [package_bionic_professions],
Aftershock [aftershock],
DinoMod [DinoMod],
Megafauna [megafauna],
Extra Mutated Scenarios [extra_mut_scens],
Translate Complex Dialogue [translate_dialogue],
Tamable Wildlife [Tamable_Wildlife],
Stats Through Kills [stats_through_kills]
]
Additional context
No response
The text was updated successfully, but these errors were encountered: