Integrated Dynamics

Integrated Dynamics

88M Downloads

Offset parts behave in a weird way

Hiranus opened this issue ยท 10 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

Image I tried creating this smelter with the help of create (and its addons) and ID with it's amazing offset & WorldTime combo to have superfast smelting, and it kind of works, but offset behavior is weird, and it messes things up. Things that are odd:
  1. Items are not put into all depots - some are skipped entirely, some are filled when offset iterates over them for the second time

  2. Items get pulled out of them too early - likely because cards are not refreshed when offset changes, and they still have their "old" value. Which means that if one stack smelts faster items from the next depot might get pulled out too.

  3. Items get pulled from the wrong depot - it looks like importer checks if it can pull from the correct depot, but then it pulls item from the depot it pointed to a tick earlier.
    Depending on how fast offset is changing, one or more of these issues happen.

Steps to reproduce the problem:

Making reproduction steps simple is not really applicable here.

  1. Build similar setup to the one shown above with the Create mod. I use addons, but you can do similar setup with Encased Fans, Lava, non-flammable fence and depots. Just do a single row, 2 rows are not needed for this. From ID you will need Block Reader, World Reader, and a few item interfaces, importers, cables and some containers
  2. You will need a (WorldTime / Interval) % max_value -> integer (later called WorldTimeOffset) card, either as an operator or just done on the spot.
    Interval is how many ticks you want per block, max_value is your max value, which here translates to number of depots.
  3. You will need card that checks if ["HeldItem"]["FanProcessingTime"] nbt of depot is -1 which indicates that smelting is done. Later I will call it DepotSmeltCheck

We are done with the prerequisites. Now for hooking it up:

  1. Since it seems that depots need few ticks to figure out if they are actually smelting item you need 2 Total Time cards - one slightly off from the other, just enough so that inserting items into depots and extracting them won't happen to the same depot at the same time.

  2. Create the cards.
    Extracting items and reading depot NBT needs to point to the same depot, and need to happen before inserting items into the depots,, so use correct World Time to make WorldTimeOffset cards. for the interval, start with something like 4. put these cards into the proper offset slot. You should offset changing quickly. If it doesn't match depots then play a bit with offsets and add/subtract numbers.
    DepotSmeltCheck card goes goes into the importer that will extract the items from the depot. Make sure its on the separate channel from the item insertion into the depots.

  3. If everything went fine you should have super fast smelter from Create that is boosted with the power of ID. Now just put something smeltable like raw iron or cobblestone and check output chest.

  4. To "achieve" different issues mentioned above just change the interval to bigger/smaller numbers

Expected behaviour:

  1. When offset changes all cards get properly updated and have new values and any optimization (that skips ticks because part had nothing to do on the previous block) is restarted, so that even if I set interval to 2 all depots will get filled.
  2. Parts (like importer etc) should only interact with the block they are pointing to, so no funny "but I pointed to that other block last tick" behavior that is mentioned in the issue number 3.

Versions:

  • This mod:
  • CyclopsCore - 1.21.1-neoforge-1.26.2-808
  • Integrated Dynamics - 1.21.1-neoforge-1.27.9-1308
  • Create - 6.0.6
  • Minecraft: 1.21.1
  • Mod loader version: Neoforge 21.1.206
commented

Thanks for reporting!

commented

I know that this is big and hard to reproduce, if you will have any questions feel free to find me on your discord, Im Hiran there.

commented

This is going to be very tricky to reproduce indeed.
Is it possible to try reproducing it in plain vanilla?
That way, you could share the world with me, and I can load it up in my dev environment for direct debugging.

commented

It may also be related to some of the optimizations we have in place to delay tick processing when things are not needed.
Could you try tweaking these config options? (e.g. by setting them to 1)

commented

This is going to be very tricky to reproduce indeed. Is it possible to try reproducing it in plain vanilla? That way, you could share the world with me, and I can load it up in my dev environment for direct debugging.

You would need to have create too, as I dont think there is anything in vanilla that will reproduce this smelting behavior. If that is fine then I can prepare a world.

commented

Sure, we can try! :-)

commented

Thanks @Hiranus!

commented

New World.zip
It just needs Create and Integrated Dynamics and Tunnels.
Variable store that is closer to the depots has cards that you can change, they are used for all the math. Variable store further from the depots has actual operations etc.

commented

@Hiranus Are you sure you saved the world correctly?
None of the variable stores have variables AFAICS.

Also, could you try tweaking these config options? (e.g. by setting them to 1)

Note to self: cache-based tick delays should already take into account offsets, as they are based on ITunnelConnection caching as keys, which take into account the target position (e.g. TunnelConnectionPositionedNetwork)

commented

And of course, additionally check if it still happens in the newest version of all the relevant mods. But make sure you try it only after the above suggestion.