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

adjust material size for melting for armor parts, weapons, trap components and tools... #4958

Merged
merged 18 commits into from
Sep 28, 2024

Conversation

Birkow
Copy link
Contributor

@Birkow Birkow commented Sep 23, 2024

Change how material size for melting is calculated. On average weapons, trap components, armor parts, shields and tools will return 95% of their forging cost. Each wear level will decrease melt return by additional 10%

@Birkow Birkow marked this pull request as ready for review September 24, 2024 20:36
…nents and tools to minimize differences between cost of forging and melting return, heavily inspired by adamantine-cloth-wear.h
…s, trap components, armor parts, shields and tools will return 95% of their forging cost. Each wear level will decrease melt return by additional 10%
@Birkow Birkow force-pushed the tweak/material_size_for_melting branch from f78fa18 to 1c6cb58 Compare September 26, 2024 16:54
@Birkow
Copy link
Contributor Author

Birkow commented Sep 27, 2024

This could use inclusion in control panel. Just not sure in what category it should be included: bugfix or gameplay tools. It's fixing Bug 6027 by preventing creation of metal when melting items, but at the same time base melting return set to 95% and decrease by 10% per wear level are arbitrary and might better fit gameplay tools category.

@myk002
Copy link
Member

myk002 commented Sep 28, 2024

Fully agree that it should be added to the control panel. I'd call it a gameplay mod and not enable it by default. Lots of people have come to depend on melt-based metal duplication schemes.

docs/plugins/tweak.rst Outdated Show resolved Hide resolved
docs/plugins/tweak.rst Outdated Show resolved Hide resolved
plugins/tweak/tweak.cpp Outdated Show resolved Hide resolved
plugins/tweak/tweaks/material-size-for-melting.h Outdated Show resolved Hide resolved
plugins/tweak/tweaks/material-size-for-melting.h Outdated Show resolved Hide resolved
plugins/tweak/tweaks/material-size-for-melting.h Outdated Show resolved Hide resolved
Comment on lines +58 to +65
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(armor, 1.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(gloves, 2.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(shoes, 2.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(helm, 1.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(pants, 1.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(weapon, 1.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(trapcomp, 1.0f)
DEFINE_MATERIAL_SIZE_FOR_MELTING_TWEAK(tool, 1.0f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these vary if the game is modded?

Copy link
Contributor Author

@Birkow Birkow Sep 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, will have to look into it and probably factor in if reaction-gloves tweak is enabled. It looks like it could alter how many gloves are produced in custom reactions.

Copy link
Contributor Author

@Birkow Birkow Sep 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting forging cost for modded in items created in custom reactions should be possible. If vanilla items are created in modded reactions this can be challenging. Not sure if it is possible to determine what reaction was used to create item if multiple ones exist with different forging cost per item. Probably should use one with lowest forging unit cost as base.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added information in description that melting returns are calculated for base game production cost., Might not be correct for modded items or custom reactions.

@Birkow
Copy link
Contributor Author

Birkow commented Sep 28, 2024

added pull request in scripts repo adding tweak to control-panel DFHack/scripts#1311

Copy link
Member

@myk002 myk002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks great! Thanks! What should we do about modded items? If they aren't handled, or are just assumed to have vanilla production costs, that is ok, but it should be documented as a limitation.

@Birkow
Copy link
Contributor Author

Birkow commented Sep 28, 2024

Code looks great! Thanks! What should we do about modded items? If they aren't handled, or are just assumed to have vanilla production costs, that is ok, but it should be documented as a limitation.

Perfect is enemy of done ;), I think that initial release can be limited to consider vanilla forging costs only.

I will have to investigate how custom reactions work and play with them a bit before I can start calculating forging cost for them. Especially if there are reactions creating multiple different items at the same time like whole armor set or different amount of items based on target race e.g. reaction-gloves tweak and antmen.

@myk002
Copy link
Member

myk002 commented Sep 28, 2024

That sounds good -- maybe just add a note at the end of the description that it is tuned for vanilla production costs and may not calculate correct returns for modded items with non-vanilla production costs

docs/plugins/tweak.rst Outdated Show resolved Hide resolved
@myk002 myk002 merged commit 77817be into DFHack:develop Sep 28, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants