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

Space Age - Spoilage #313

Open
7 of 8 tasks
SWeini opened this issue Oct 14, 2024 · 5 comments
Open
7 of 8 tasks

Space Age - Spoilage #313

SWeini opened this issue Oct 14, 2024 · 5 comments
Labels
2.0 Issue related to 2.0

Comments

@SWeini
Copy link
Collaborator

SWeini commented Oct 14, 2024

Support spoilage mechanic

  • Mark spoilable items in GUI (ItemPrototype::spoil_result/spoil_to_trigger_result)
  • Mark spoil result items in GUI
    Is this really needed? There is ItemPrototypeFlags "spoil-result", but I don't know what it does.
  • Create a recipe for ItemPrototype::spoil_result, allows automation of spoilable items
  • Add spoilage recipes to NEIE (and to "add consumption/production recipe" dropdowns)
  • Support ItemPrototype::spoil_to_trigger_result, but triggers are quite difficult to support because they are so rich
    Used for eggs spoiling into enemies (doesn't make sense in planning)
    Used for captivated spawners into normal spawners (doesn't make sense in planning)
  • Support RecipePrototype::result_is_always_fresh and ItemProductPrototype::percent_spoiled
    Unless we want to model the spoilage of all items and allow adding configurable timespans for transportation, this would only be for information
  • Support spoilable science packs
    I didn't see anything in the API for this, and I haven't been to Gleba yet, but I believe this is a thing
  • RecipePrototype::preserve_products_in_machine_output
    Some products don't start spoiling until taken out of the machine.
  • Support for configurable spoiling rate (10%-1000%)
    This is a new map setting, probably not part in the prototypes but instead done globally.
@Dorus Dorus added the 2.0 Issue related to 2.0 label Oct 14, 2024
@SWeini SWeini linked a pull request Oct 20, 2024 that will close this issue
@SWeini SWeini reopened this Oct 20, 2024
@shpaass
Copy link
Owner

shpaass commented Oct 20, 2024

On a side note, I don't know why Github considered these issues resolved. Their numbers were not mentioned in the PR, from what I remember.

@shpaass
Copy link
Owner

shpaass commented Oct 20, 2024

Ah, I see. The Linked Issues part on the side.

@sunrosa
Copy link

sunrosa commented Nov 4, 2024

If an item spoils into a module it creates a critical error

Unable to cast object of type 'Yafc.Model.Item' to type 'Yafc.Model.Module'.
at Yafc.Parser.FactorioDataDeserializer.GetObject[TNominal,TActual](String name) in .\Yafc.Parser\Data\FactorioDataDeserializer_Context.cs:line 94
at Yafc.Parser.FactorioDataDeserializer.DeserializeItem(LuaTable table, ErrorCollector _) in .\Yafc.Parser\Data\FactorioDataDeserializer.cs:line 373
at Yafc.Parser.FactorioDataDeserializer.DeserializePrototypes(LuaTable data, String type, Action`2 deserializer, IProgress`1 progress, ErrorCollector errorCollector) in .\Yafc.Parser\Data\FactorioDataDeserializer.cs:line 311
at Yafc.Parser.FactorioDataDeserializer.LoadData(String projectPath, LuaTable data, LuaTable prototypes, Boolean netProduction, IProgress`1 progress, ErrorCollector errorCollector, Boolean renderIcons) in .\Yafc.Parser\Data\FactorioDataDeserializer.cs:line 121
at Yafc.Parser.FactorioDataSource.Parse(String factorioPath, String modPath, String projectPath, Boolean netProduction, IProgress`1 progress, ErrorCollector errorCollector, String locale, Boolean renderIcons) in .\Yafc.Parser\FactorioDataSource.cs:line 354
at Yafc.WelcomeScreen.LoadProject() in .\Yafc\Windows\WelcomeScreen.cs:line 388

This is reproducible using pyanodons hard mode 1.3.1. This error does not get thrown on pyhard 1.2.5

shpaass added a commit that referenced this issue Nov 5, 2024
Pyhard added spoiling recipes where the spoil result is a module. This
was not expected and caused loading errors
(#313 (comment)).
I fixed it by forcibly loading modules before anything else.
@DaleStan DaleStan removed a link to a pull request Nov 5, 2024
@CricketBr
Copy link

Suggestion: Add text to mouseover to say what the item spoils into, and how long it takes. Just having that information would save a lot of flipping between YAFC and other screens, even if YAFC doesn't use it in any calculations. The captive biter spawner should also show how long before it starves, assuming it starts at full health and receives no damage.

(I can't think of a way to show spoilage over time in math, but remain hopeful.)

@DaleStan DaleStan self-assigned this Nov 8, 2024
shpaass added a commit that referenced this issue Nov 9, 2024
This loads and displays all the spoiling information from #313, except
"Mark spoil result items in GUI", which I don't think is necessary; and
"Support spoilable science packs", which can be accomplished for now by
setting the table to have (excess) desired output.

Perishable items and entities get a clock overlay on their icon, and a
new "Perishable" section in their tooltip. If they are recipe outputs
they may also get a "This recipe output ..." string.

![image](https://github.com/user-attachments/assets/12d49fcc-aba5-47c3-a171-fbf9162aa4b9)

Recipes that have non-default spoil behavior describe that behavior in
their tooltip.

![image](https://github.com/user-attachments/assets/bf2ae9cd-cd40-4108-854d-9586678a1060)
@DaleStan DaleStan removed their assignment Nov 10, 2024
@apia46
Copy link

apia46 commented Nov 23, 2024

You definintely know about this already but I figured it would make sense to say here that the solver can't see spoilage recipes for some reason
{4F511503-8F94-4184-B5C1-43DAA81F5979}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 Issue related to 2.0
Projects
None yet
Development

No branches or pull requests

7 participants