Arch666Angel / mods

Angelsmods Repository
https://forums.factorio.com/viewforum.php?f=185
86 stars 63 forks source link

Special Vanilla Contemplations, Part 1 #691

Open adoa opened 3 years ago

adoa commented 3 years ago

these observations are on the current dev branch, commit 38675ef0c

Unused items & fluids

Crafting machines with no compatible recipes

Library issues

Technology issues at Automation Science tier

Logistic Science tier

LovelySanta commented 3 years ago

Library issues

  • [ ] Angel's mods appear to add dependency on science pack techs to pure upgrade technologies. In vanilla, all the pure upgrade techs that don't unlock any recipe nor new bonuses also do not have explicit dependencies on science packs. It feels not intended that this should change by activating angel's mods. Affected techs:

    • weapon-shooting-speed-2 through -6
    • physical-projectile-damage-2 through -6
    • research-speed-2 through -6
    • stronger-explosives-2 through -6
    • mining-productivity-2 & -3
    • inserter-capacity-bonus-3 & -4

This is due to the requirement of unit-test-006: https://github.com/Arch666Angel/mods/blob/38675ef0c0f2faf2d962de382ae828b543c65c32/angelsrefining/prototypes/override/refining-override-base.lua#L3-L43

Either we ignore these in the unit test, or we keep explicit dependencies... I let someone else decide, I can do the corresponding changes if need be.

adoa commented 3 years ago

Can you change the unit test so that it checks if the tech adds new recipes or new bonuses? These techs do neither, they just give a boost to a previously unlocked bonus.

LovelySanta commented 3 years ago

I would not do it conditionally, I rather just code an exception for certain techs... And then we can create the exceptions still dynamically if we want afterwards...

adoa commented 3 years ago

Do I understand correctly that this only affects techs from vanilla and angel's? Bob's mods introduce many such upgrade techs, which should stay untouched as well.

LovelySanta commented 3 years ago

It could dynamically add the upgrade techs from bobs mods as well, I think I did not fix the upgrades from bobs mods yet.

Moreover, we could create another part of the unit test that verifies it does not have additional prerequisites other than a previous tier...

LovelySanta commented 3 years ago

I implemented this in https://github.com/Arch666Angel/mods/commit/26c443cbe1748ee47abe8ba33b987f44c483bd21:

The clue of the change from https://github.com/Arch666Angel/mods/blob/d81799b46564fa0f5e1340c43f8ab15a68adb46c/angelsdev-unit-test/unit-tests/unit-test-006.lua#L197 to https://github.com/Arch666Angel/mods/blob/26c443cbe1748ee47abe8ba33b987f44c483bd21/angelsdev-unit-test/unit-tests/unit-test-006.lua#L286

In general, when the technology is a pure bonus tech (only unlocks bonusses, no recipes) then it will not check if it has sufficient prerequisites.

There is one exception to this general rule: the first pure bonus technology (=the one that does not has another pure bonus technology as prerequisite, e.g. "physical-projectile-damage-1" or "artillery-shooting-speed-1") must still depend on a correct prerequisite.

https://github.com/Arch666Angel/mods/commit/26c443cbe1748ee47abe8ba33b987f44c483bd21 also removes the prerequisites of the bonus technologies mentioned in https://github.com/Arch666Angel/mods/issues/691#issuecomment-928078254. Due to the change of the unit test 006 behavior, no additional errors occur in the test log.

@adoa, if you agree with this change, please check this one off the list.

adoa commented 3 years ago

This sounds exactly as it should be.

KiwiHawk commented 3 years ago

Unused items & fluids

  • [ ] paper
  • [ ] ferric chloride solution, cupric chloride solution
  • [ ] resin & liquid resin
  • [ ] liquid rubber
  • [ ] solid-lithium
  • [ ] crystal-full-red, -blue, -harmonic

These unused items / fluids and more are detected by unit test 007 (#709)

LovelySanta commented 3 years ago

As from the unit tests added in #709, https://github.com/Arch666Angel/mods/commit/a0ea5cbaedc28fa5287fefa0124ea8d0f6fbe3c2 fixes the milling drum and electro whinning cell not being used in some cases.

LovelySanta commented 3 years ago

Some more things to check off the list:

Unused items & fluids

  • [ ] resin & liquid resin
  • [ ] liquid rubber

    Logistic Science tier

  • [ ] Tech: resins Requires: automation & logistic science packs Depends on: basic-chemistry-3 Building unlocks: none Recipe unlocks: none Action: Resin & liquid resin have no use. Tech is empty, needs to be removed. All subsequent techs need to be removed, too.
  • [ ] Tech: rubbers Requires: automation & logistic science packs Depends on: angels-oil-processing Building unlocks: none Recipe unlocks: none Action: rubber has no use and is already hidden. This tech is empty, useless, and should be removed.
  • [ ] Tech: resin-1 Requires: automation & logistic science packs Depends on: angels-nitrogen-processing-2, angels-advanced-chemistry-1, resins Building unlocks: none Recipe unlocks: none Action: empty tech with no use, same for subsequent tiers -2 and -3
  • [ ] Tech: rubber Requires: automation & logistic science packs Depends on: angels-advanced-chemistry-2, rubbers Building unlocks: none Recipe unlocks: none Action: empty tech with no use

https://github.com/Arch666Angel/mods/commit/2607345fe046f953d596cd75fd90029ca88471d8 introduces 3 new petrochem triggers: https://github.com/Arch666Angel/mods/blob/2607345fe046f953d596cd75fd90029ca88471d8/angelspetrochem/data.lua#L12-L15 When these triggers are set to false, the corresponding solid and liquid item are hidden together with their corresponding recipes (petrochem only). Also handles the corresponding technologies. Note: These triggers are not configured exactly correct; they are still too permissive in some overhaul cases, but they are restrictive enough to handle all special vanilla cases. Calling it good enough for this issue.

Technology issues at Automation Science tier

  • [ ] Tech: bio-wood-processing Requires: automation science packs Depends on: none Building unlocks: none Recipe unlocks: bio-resin-wood-processing Action: resin has no use
  • [ ] Tech: bio-arboretum-desert-1 Requires: automation & logistic science packs Depends on: bio-arboretum-1, bio-nutrient-paste, rubbers Building unlocks: none Recipe unlocks: 3 recipes Action: Liquid rubber has no use, this tech and all its recipes are entirely pointless. Same is true for subsequent tier -2
  • [ ] Tech: bio-arboretum-temperate-1 Requires: automation & logistic science packs Depends on: resins, bio-fermentation, bio-arboretum-1 Building unlocks: none Recipe unlocks: 4 recipes Action: Liquid resin has no use, this tech and all its recipes are entirely pointless. Same is true for subsequent tier -2

https://github.com/Arch666Angel/mods/commit/2607345fe046f953d596cd75fd90029ca88471d8 introduces 3 new bioprocessing triggers depending on the aforementioned petrochem triggers: https://github.com/Arch666Angel/mods/blob/2607345fe046f953d596cd75fd90029ca88471d8/angelsbioprocessing/data.lua#L52-L55 When these triggers are set to false, the corresponding liquid tree generation items are hidden together with their corresponding recipes (bioprocessing only). Also handles the corresponding technologies and early game recipes.

LovelySanta commented 3 years ago

Some more things to (partially) check off the list with https://github.com/Arch666Angel/mods/commit/2d263e2e61c5fd9fd4073256352db4380d0d9a60. See comment below why it's not checked off yet.

Crafting machines with no compatible recipes

  • [ ] Sintering oven

@KiwiHawk can you extend unit test 009 such that it verifies that each (visible) recipe can be crafted in a machine (or character)? image I believe I did hide too many sintering ovens is this Special vanilla (BA) case: image The test should say something like There is no suitable machine or character that can craft recipe "recipe_name" (crafting category "crafting_category_name"). In this example case I would expect something to be craftable in sintering oven 3 & 4: https://github.com/Arch666Angel/mods/blob/2d263e2e61c5fd9fd4073256352db4380d0d9a60/angelssmelting/prototypes/override/smelting-override-support.lua#L23-L33

LovelySanta commented 3 years ago

@KiwiHawk can you also extend unit test 008 to dynamically add items that can be looted from enemies to the items_to_ignore list: https://github.com/Arch666Angel/mods/blob/25b1c093ee1a64b3a6ea7c521c446a09962b313a/angelsdev-unit-test/unit-tests/unit-test-008.lua#L4 This will prevent these items from throwing the following errors in this Special vanilla (BA) case:

angelsdev-unit-test:     No recipe is creating item "small-alien-artifact" as a product.
angelsdev-unit-test:     No recipe is creating item "small-alien-artifact-red" as a product.
angelsdev-unit-test:     No recipe is creating item "small-alien-artifact-orange" as a product.
angelsdev-unit-test:     No recipe is creating item "small-alien-artifact-yellow" as a product.
angelsdev-unit-test:     No recipe is creating item "small-alien-artifact-green" as a product.
angelsdev-unit-test:     No recipe is creating item "small-alien-artifact-blue" as a product.
angelsdev-unit-test:     No recipe is creating item "small-alien-artifact-purple" as a product.

You can use LuaEntityPrototype.loot, but make sure count_max > 0 and probability > 0 (i think they can also be set to nil)

LovelySanta commented 3 years ago

@KiwiHawk can you also extend unit test 008 to dynamically add fluids that can be pumped from the sea to the fluids_to_ignore list: https://github.com/Arch666Angel/mods/blob/25b1c093ee1a64b3a6ea7c521c446a09962b313a/angelsdev-unit-test/unit-tests/unit-test-008.lua#L5 This will prevent this fluid from throwing the following error in this Special vanilla (BA) case:

No recipe is creating fluid "water-viscous-mud" as a product.

You can use LuaEntityPrototype.fluid, but make sure the pump is not hidden.

KiwiHawk commented 3 years ago

image

I fixed this issue with the puffer nests. I'm still not sure why the puffer nest entity has placeable_by set though.