-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add Synergy Bonuses and New TotalCapacity Formulas to terrain.cfg #3710
Merged
Loobinex
merged 13 commits into
dkfans:master
from
AndersonHK:More-Efficiency-Options-for-Rooms
Nov 26, 2024
Merged
Add Synergy Bonuses and New TotalCapacity Formulas to terrain.cfg #3710
Loobinex
merged 13 commits into
dkfans:master
from
AndersonHK:More-Efficiency-Options-for-Rooms
Nov 26, 2024
+170
−19
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added the SlabSinergy field in terrain.cfg to allow rooms to gain efficiency bonuses based on nearby slab types. Introduced new TotalCapacity formulas to provide more flexibility, such as: slabs_all_wth_effcncy slabs_pow2_wth_effcncy gold_slabs_wth_effcncy, etc. Implemented the helper function contains_none to handle default cases for SlabSinergy. Moved contains_none to bflib_string.c for consistency with other string helper functions. Changes tested with various configurations and backward-compatible with existing setups.
Made it so the synergy slab is set to -3 if the parameter cannot be read, it should be more robust than leaving it unset since slab0 is actually used in game. Furthermore that value is different from the -2 it gets in case the slab was set to none, which bugs more traceable.
Might be a good idea to mention that to prevent log errors, the cfg file would require a minor modification. Namely adding the line below to each room. Personally, I'd add it under UsedCapacity and above StorageHeight. |
Added new algorithms for Total Capacity and the SlabSinergy defaults to avoid log messages.
walt253
reviewed
Nov 21, 2024
walt253
reviewed
Nov 21, 2024
walt253
reviewed
Nov 21, 2024
walt253
reviewed
Nov 21, 2024
walt253
reviewed
Nov 21, 2024
walt253
reviewed
Nov 21, 2024
I added comments to the new functions on terrain.cfg The contains_none function was unnecessary, I just used strcasecmp instead. The <= in the no minimum formulas were changed to <. Meaning that rooms with 1 capacity can remain at 1. But rooms with 0 capacity will have 0 capacity as intended.
Changed inconsistent indentation in room_data.c file.
Changed the check at set_room_configuration_check such that improper values for SlabSynergy are caught and the new value is properly set.
walt253
approved these changes
Nov 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces the concept of slab synergies and new functions for TotalCapacity in terrain.cfg. These changes aim to expand the flexibility and customization available to modders.
Key Features
Room Synergies:
TotalCapacity Formulas:
Default Synergy Handling:
Rationale
These additions enhance modding possibilities by enabling more dynamic interactions between room efficiency and nearby slabs. Modders can now define custom rules and synergies, allowing greater control over gameplay mechanics.
Examples
Testing
Testing Limitations:
The code was not tested for:
Let me know if you’d like further adjustments or additions!