-
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
basecamps: add modular basecamps #31115
basecamps: add modular basecamps #31115
Conversation
I believe that's wrong issue number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the recipe code, and I only partially understand the Basecamp code, I will go back over it with more scrutiny later and see if there is anything I can meaningfully review.
} | ||
} | ||
if( near_fields < 4 ) { | ||
popup( _( "You need more at least 4 adjacent for camp expansions!" ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended to specify the terrain needed nearby?
af16fd6
to
563d17b
Compare
563d17b
to
5bcd5ea
Compare
5bcd5ea
to
d529612
Compare
add support for blueprints that don't have an oter_id attached to them, but are pure mapgen_update functions. also, add a recipe_dictionary entry for blueprints, similar to the existing autolearn entry.
add support for retrieving available basecamp upgrade path starts and expansion by oter_id from the "all_faction_base_types" and "all_faction_base_expansions" recipe groups. Also populate the expansion tabs in the basecamp control window image the same way. Let the player select from all available basecamp upgrade path starts if there is more than 1 available for the selected basecamp terrain. Select available upgrades from recipe_dict's collection of construction blueprints.
add the JSON definitions of the modular field camp. It can be configured to be very similar to the existing primitive field camp or built as a single large building made from wattle-and-daub, wood panel, or metal. The player can upgrade it piecemeal in the order they please. It's also going to be easier to add new features to it in the future.
d529612
to
02a566f
Compare
Can anyone else confirm/deny this change is the one causing the overmap memory erasing bug on game load? |
It is, Mark has identified the problem and is working on a fix. |
Summary
SUMMARY Features "basecamps: add modular basecamps"
Purpose of change
Addresses #26341
Describe the solution
reorganize the basecamp recipe files by moving them into their own file and giving the primitive field camp file a more meaningful name.
add support for basecamps being able to autocalculate their upgrade build time and requirements. For that to happen, all common terrain constructions need to have a construction definition, but some constructions, like deep and shallow pits, are not meant to be selectable by the user. add the concept of a hidden construction, and add definitions for the shallow pit and deep pit construction.
add a new "blueprint_autocalculate" field to blueprint recipes. When it is present, recipe::finalize calls a function that:
add support for blueprints that don't have an oter_id attached to them, but are pure mapgen_update functions.
also, add a recipe_dictionary entry for blueprints, similar to the existing autolearn entry.
add a new blueprint keyword "blueprint_excludes" which can be used to create mutually exclusive branches in an camp upgrade path.
the list of completed blueprint_provides is compared to an upgrade's blueprint_excludes. If there is a match, the recipe isn't available.
There is a second list of in_progress provides, which is used to prevent people from building two mutually exclusive upgrades at the same time, while also preventing them from building upgrade B that requires upgrade A before upgrade A is completed.
reorganize the basecamp code slightly by adding a base_camps:: namespace and moving various bits of code into it.
NPCs will work on a single task for up to 11 hours, but on longer tasks, they'll only work 10 hours out of every 24. Add functions to calculate the workload from the raw task times, and update most of the existing blueprints.
add support for retrieving available basecamp upgrade path starts and expansion by oter_id from the "all_faction_base_types" and "all_faction_base_expansions" recipe groups. Also populate the expansion tabs in the basecamp control window image the same way.
Let the player select from all available basecamp upgrade path starts if there is more than 1 available for the selected basecamp terrain.
Select available upgrades from recipe_dict's collection of construction blueprints.
add the JSON definitions of the modular field camp. It can be configured to be very similar to the existing primitive field camp or built as a single large building made from wattle-and-daub, wood panel, or metal. The player can upgrade it piecemeal in the order they please. It's also going to be easier to add new features to it in the future.
Describe alternatives you've considered
This PR is huge but it includes 3600 lines of JSON changes and additions. I'd like to break it down into more manageable chunks but it doesn't decompose nicely: there's a bunch of necessary changes up front that doesn't do anything on their own and then suddenly it all comes together.
An early draft of this was submitted in #31055 but I prefer this version.
Additional context
Some pretty pictures:
Modular field camp built quickly from tents and wattle-and-daub
Full modular field camp hardshell built from wattle-and-daub
Modular field camp buildings built from a mixture of tents, wattle-and-daub, wood panel, and metal.