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

Add the Cleanroom #618

Merged
merged 46 commits into from
Jul 16, 2022
Merged

Add the Cleanroom #618

merged 46 commits into from
Jul 16, 2022

Conversation

TechLord22
Copy link
Member

@TechLord22 TechLord22 commented Feb 5, 2022

This PR adds the Cleanroom. It requires many existing recipes to be run inside it, and serves as an HV progression step.

There are two configs concerning this PR: one to disable the cleanroom, and one to make multiblocks clean when not inside of it.

The structure has minimum dimensions of 5x5x5, and maximum of 15x15x15. The width and depth must be odd, while the height may be even. The size of the cleanroom is determined in the controller with GUI buttons. The structure requires plascrete in all of the borders, filter casings on the top panel (excluding the very center for the controller), allows up to 4 doors, and has a minimum number of Plascrete or Cleanroom Glass in the structure. This minimum is equal to 75% of the structure's wall's block amount. Any plascrete can be replaced with Cleanroom Glass.

The cleanroom's interior has a custom predicate which handles machines requiring cleanrooms. The default cleanroom bans any generator, muffler hatch, and any other cleanroom. When a machine meets these conditions, and it is able to "accept" a cleanroom, it is given the cleanroom it is located inside for use in running recipes.

It additionally allows the new Passthrough Item and Fluid hatches in the structure walls. These auto input items or fluids on one side into its inventory, and subsequently auto output out the opposite side. Power can be transmitted inside and out using Diodes or Hulls, which each adopt the proper casing textures in the structure as well. The cleanroom additionally has maintenance, which works as one expects except that the adjustable hatch adjustments make no change. Any hatch is allowed anywhere in the structure excluding the filter casings.

Machines running cleanroom required recipes outside the cleanroom do not run and do not consume inputs at all. Machines running recipes in the cleanroom will work as normal, except that the cleanroom becoming dirty during the recipe will cause progress to reverse. There is no voiding in the cleanroom when not clean.

The clean states work as follows: it is either clean or not clean, with no in between. Every 5 seconds, the multiblock will increase its progress towards being fully clean. The cleanliness increase is 5% at LV, 10% at MV, 15% at HV, and so on. During this time, if the cleanroom does not recieve enough power for its power draw, it will reverse its progress towards cleaning by subtracting 5% cleanliness. This means that the cleanroom must be continually powered whenever recipes are run inside it. It also constantly consumes power, regardless of whether machines are running inside it or not. The base power drain is 30 EU/t, but drops to 4 when fully cleaned. When there are maintenance problems, the cleanroom's cleanliness increase is reduced by 1% per problem, and its no power decrease is enlarged by 1% for each problem as well.

The cleanroom is designed to be easily extendable by other mods to add their own "cleanrooms." The CleanroomType system was designed in such a way that any amount of cleanrooms which provide their own unique type (or multiple) can be created and used in recipes.

Any RecipeBuilder accepts the cleanroom property, allowing Modpack Devs and Addons to use any machine they wish to inside the cleanroom. CT Support works by specifying a String name of the cleanroom type. An example of this for the default cleanroom: .property("cleanroom", "cleanroom") on a RecipeBuilder.

@Syrcan
Copy link
Contributor

Syrcan commented Feb 5, 2022

I haven't looked at the code yet (I want to save headaches for later), but here's what I can tell from the mechanics in-game:

  • The 30EU/t drain is permanent, where in GT5u it would go down to 4EU/t or something once fully clean.
  • I have serious concerns about gating, as this is currently as hard (if not harder) than GT5u. The plascrete recipe was agreed to be awful. MV would become extremely bland without both tiers of circuits. I would personally like for the cleanroom to be required for Workstation, but not the previous circuits.
  • I like the passthrough hatches. I hope automating the machines in the cleanroom won't be a pain for players.
  • Doors can be kept open without any downsides (edit: I noticed that's part of the description but that shouldn't be the case in my opinion).
  • The progression for cleanliness should remain at 100% instead of looping back to 0. This will make lack of energy or opening doors less awkward.
  • Other notes would be related to the logic having to be rewritten from scratch / copy pasted, which doesn't implement everything correctly from AbstractRecipeLogic, but I guess that's gonna be for another PR.

@ChromaPIE
Copy link
Contributor

ChromaPIE commented Feb 23, 2022

So uh, it requires 60% of its volume to be plascrete, so a 7x7x7 cleanroom is actaully not possible, and hell a 15x15x15 cleanroom is not possible either. Was it designed to be 60% of the whole volume of the structure, including the hollow part?

And also, maybe for some sort of compatibility reason it directly uses camelled CleanroomType, which is Cleanroom, to replace the format specifier in gregtech.recipe.cleanroom, making this line of text in JEI in fact not completely localizable.

Re-entering a world seems to be possibly causing formed cleanrooms to turn invalid, refreshing by making changes to the size configuration fixes this.

@serenibyss
Copy link
Member

I added a commit which adds channels in hulls. At the moment, it is partially broken, as I am not calling the read/write NBT methods at the right time for the ME network. @PrototypeTrousers guidance on this issue (and general reviews of the commit d7a8258) would be greatly appreciated

@ALongStringOfNumbers ALongStringOfNumbers added the status: high priority Issue or PR should be prioritized for reviews label Feb 25, 2022
@ChromaPIE
Copy link
Contributor

There be a log spam spamming

[22:44:35] [Server thread/WARN] [GregTech]: There is no property with key cleanroom
[22:44:35] [Server thread/WARN] [GregTech]: Stacktrace:
java.lang.IllegalArgumentException: null
	at gregtech.api.recipes.recipeproperties.RecipePropertyStorage.getRecipePropertyValue(RecipePropertyStorage.java:90) [RecipePropertyStorage.class:?]
	at gregtech.api.recipes.Recipe.getProperty(Recipe.java:588) [Recipe.class:?]
	at gregtech.api.capability.impl.AbstractRecipeLogic.checkRecipe(AbstractRecipeLogic.java:311) [AbstractRecipeLogic.class:?]
	at gregtech.api.capability.impl.MultiblockRecipeLogic.checkRecipe(MultiblockRecipeLogic.java:270) [MultiblockRecipeLogic.class:?]
	at gregtech.api.capability.impl.AbstractRecipeLogic.trySearchNewRecipe(AbstractRecipeLogic.java:289) [AbstractRecipeLogic.class:?]
	at gregtech.api.capability.impl.MultiblockRecipeLogic.trySearchNewRecipeCombined(MultiblockRecipeLogic.java:130) [MultiblockRecipeLogic.class:?]
	at gregtech.api.capability.impl.MultiblockRecipeLogic.trySearchNewRecipe(MultiblockRecipeLogic.java:122) [MultiblockRecipeLogic.class:?]
	at gregtech.api.capability.impl.AbstractRecipeLogic.update(AbstractRecipeLogic.java:146) [AbstractRecipeLogic.class:?]
	at gregtech.api.capability.impl.MultiblockRecipeLogic.updateWorkable(MultiblockRecipeLogic.java:38) [MultiblockRecipeLogic.class:?]
	at gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController.updateFormedValid(RecipeMapMultiblockController.java:141) [RecipeMapMultiblockController.class:?]
	at gregtech.api.metatileentity.multiblock.MultiblockControllerBase.update(MultiblockControllerBase.java:84) [MultiblockControllerBase.class:?]
	at gregtech.api.metatileentity.MetaTileEntityHolder.update(MetaTileEntityHolder.java:162) [MetaTileEntityHolder.class:?]
	at net.minecraft.world.World.redirect$zcc000$tileEntityUpdate(World.java:4137) [amu.class:?]
	at net.minecraft.world.World.updateEntities(World.java:1838) [amu.class:?]
	at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:613) [oo.class:?]
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:767) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:279) [chd.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_281]

@ChromaPIE
Copy link
Contributor

I added a commit which adds channels in hulls. At the moment, it is partially broken, as I am not calling the read/write NBT methods at the right time for the ME network. @PrototypeTrousers guidance on this issue (and general reviews of the commit d7a8258) would be greatly appreciated

JEI integration would be completely broken if AE2 is not present.

@Quarri6343
Copy link
Member

I found several issues while having fun with it:
・it does not ban Primitive Blast Furnace which releases so many smoke particles
・Cleanroom controller has voiding mode
・you can stuck in the wall when auto build the multiblock (seems like the Multiblock Helper App's bug)
・multiblock can be formed with wooden doors (sorry if it is a feature. however it is still very weird for a GT5u player)
・if you are in the very late game, you have to put a 12 length Assembly Line into the 13 width Cleanroom which is not beautiful in some cases
2022-03-13_23 19 44

@ChromaPIE
Copy link
Contributor

ChromaPIE commented Mar 13, 2022

Would be even better to introduce a specific kind of door which behaves like iron doors only for the Cleanroom, using a texture with no, you know, holes in it.

@TechLord22
Copy link
Member Author

With my latest commit, 85ac6eb, the following has been changed:

Primitive Multiblocks and Drills are now blacklisted from forming the cleanroom structure.
The voiding mode button is now no longer present in the controller.
All assemblyline recipes requiring the cleanroom have been removed. This was not intended.

@TechLord22 TechLord22 force-pushed the cleanroom-new branch 2 times, most recently from 66e3990 to 5f636ab Compare March 22, 2022 04:55
@Quarri6343
Copy link
Member

I messed with it again and found the following bugs:

  1. Blacklight recipe has wrong tier glass
    it is IV~ZPM tier so there should be Laminated Glass or Fusion Glass
  2. Cleanroom structure preview has 2 missing blocks
    キャプチャ1250
  3. Cleanroom structure preview always shows the 5x5x5 Cleanroom regardless of the size settings in the Cleanroom GUI
    Central Monitor changes its preview height when the height setting was edited so it is a bug
  4. Cleanroom can be rotated with a wrench
    I found this because the missing blocks in the structure preview rotated
  5. When you auto build the Cleanroom in the creative mode, tons of fluid passthrough hatch will appear
    キャプチャ1251
  6. Debug function of the Multiblock Helper app always throws the same error regardless of whether the Cleanroom is formed or not
    キャプチャ1252
  7. Cleanroom forms with misaligned doors
    キャプチャ1253
  8. You can place as many vanilla torches which emit smoke particle as you want
  9. Primitive Machinery still can be placed in the functioning cleanroom
  10. You can attach Automatic Filtration Maintenance Hatch to the Cleanroom (it is recursive!)
  11. Sterilizing Filter Casing requires Tritanium which is the UV material
    this can block the normal progression since the Wetware Circuit is intended to be made in ZPM age
  12. Multiblock which is no longer in the clean state displays "Machine needs more energy" although it has enough power
    it should display "Machine is contaminated!" or something which indicates the proper machine state
    キャプチャ1254
  13. Automatic Filtration Maintenance Hatch does not work in the Cleanroom (also outside?)
    when the Cleanroom stopped working, the multiblock stops even if it has the AFMH

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

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

Just an idea, how hard would it be to increase the time required for the cleanroom to become fully clean based on the internal size of the cleanroom?

Also, instead of decreasing the cleanliness by 1% per maintance issue, what do you think about decreasing cleanliness by 1% per maintenance issue, per cleanroom power draw cycle?

@Quarri6343
Copy link
Member

I found the following bugs in my second review:

  1. progress persentage in the controller ui is bugged
    キャプチャ1346
  2. Cleanroom Glass has 3,000 blest resistance value (it is the issue across all reinforced glasses)
  3. Machine Hull drains energy from the ME network (it shouldn't because it only works as a cable)
  4. Cleanroom Controller do animations even in the paused state
  5. Putting Central Monitor inside the cleanroom will crash the game (see discord for details)

Copy link
Member

@Quarri6343 Quarri6343 left a comment

Choose a reason for hiding this comment

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

we need more reviewers...

Copy link
Member

@Quarri6343 Quarri6343 left a comment

Choose a reason for hiding this comment

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

Someone said cleanroom can be unformed by reloading the world in discord dev channel and I confirmed it happens in the latest commit
However, I don't know which line causes it

Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

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

Found a funny issue with the JEI preview for the cleanroom. Since the door is in 2 block spaces, is is shown that 2 doors are required in the JEI components list.

@TechLord22 TechLord22 added the type: feature New feature or request label Jul 16, 2022
@TechLord22 TechLord22 merged commit c49dcf3 into master Jul 16, 2022
@TechLord22 TechLord22 deleted the cleanroom-new branch July 16, 2022 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: high priority Issue or PR should be prioritized for reviews type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants