FTB-Modpack-Issues icon indicating copy to clipboard operation
FTB-Modpack-Issues copied to clipboard

[Bug]: Equivalent Exchange update broke EMC links

Open Tukermine opened this issue 3 years ago • 10 comments
trafficstars

Modpack

FTB Stoneblock 3

Modpack version

1.4.1

Log Files

No response

Describe the bug

This bug also happened on version 1.4.0

When you try to take items out of an EMC link (any tier above energy), it will only allow you to take items out below ~1.1billion emc, (1 green matter is the highest I can take out.) Refined storage will only show 1 green matter max, and i can only extract 1 green matter at a time, anything with a higher emc value will not let me take any out, and won't show within the network, even if I have much more EMC than required, for example, I have a emc link that has each tier of matter, and nothing above green will show, nor allow me to manually take any out. When I take out green matter, i can take it out and it will remove the proper amount of emc from my player, but it will still allow me to take an "infinite" amount of green matter out of my network, but i can only do it 1 at a time. This can also be shown for lower tiers of matter, as it will allow me to extract them at a max quantity roughly equal to 1.1 billion EMC maximum.

The main issue is that items that have over 1.1 billion emc are unable to be extracted (such as high tier power flowers and matter), even if my total EMC is much much higher than the amount required. I have roughly 9 trillion emc at the moment from my placed MK15 flowers. Nothing above green matter will even be able to be taken out, or viewed in refined storage grid.

Steps to reproduce

  1. Put item into EMC link.
  2. Either attach external storage (refined storage, untested with AE2) or look inside of the EMC link manually
  3. Try to extract as many items as possible
  4. If the total EMC cost of (MAX 1 stack) is greater than 1.1 billion, it will only take an amount out equal to an emc value below 1.1 billion, even if you own more than 1 billion emc.
  5. Repeatedly take the items out in this stack increment, as it will still allow you to extract the correct amount (total emc amount).

Expected behaviour

When I have above the required emc for an item, I should be able to create the item using an EMC link.

Screenshots

No response

Additional information

Edit: After some more experimentation, it seems as though the actual limit for extraction is an EMC value roughly equal to the integer limit of 2.14 billion, for example, it will only take out a max of 21 Refined EMC links, equal to about 1.95b, a pink power flower max extract of 25 (1.972b emc). or violet antimatter relay mk 7 with max stack of 33 (1.965b)

Tukermine avatar Nov 24 '22 21:11 Tukermine

This is actually intended behaviour, although it is admittedly not very intuitive.

There is a config-defined limit to the amount of EMC which can be extracted from a link block in a single operation, and the default is exactly 2,000,000,000 (2 billion) EMC. This prevents items more valuable than that from being extracted via a link block.

However, the limit does not apply to the Stone Transmutation Table or Arcane Tablet, so you can extract very high value items out of those.

The server configurable is emc_link_max_output, if you want to change it. You will find it in <world-dir>/serverconfig/extended-exchange-server.toml. It's a long value, so can go above the integer limit of ~2.1billion.

desht avatar Nov 25 '22 17:11 desht

Thank you for the response, If it is intended then I am a tad confused, as yesterday before the update, this functionality was working perfectly fine, as I could mass create MK15 power flowers using an EMC link, I have no adjusted any settings on my single player worlds before nor after regarding this. I wasn't even aware that that existed.

Tukermine avatar Nov 25 '22 17:11 Tukermine

This might have been a bug in ExtendedExchange. I have an old save (from before Modpack v1.3.0, don't remember exact version), and I see the same 2B EMC limit in the ExtendedExchange config for that save. But I can also confirm I have previously been able to yank Fading Power Flowers from an EMC link hooked up to Refined Storage. Modpack v1.4.0 updated ExtendedExchange, so I suspect the update to the mod made it actually respect the config limit.

Not sure if modpack wants to use the 2B limit or increase it to restore previous functionality. That's a balance decision, but if you can only pull items >2B EMC items from the Table or Tablet, I don't know if it's possible to connect those to Refined Storage as external storage (which means higher tier ExtendedExchange blocks won't be transmutable out of EMC Links connected to Refined Storage).

hairlessOrphan avatar Nov 25 '22 23:11 hairlessOrphan

@hairlessOrphan you may well be correct. There were a couple of BigInteger->long/int conversion bugs which have been fixed recently, and it's very possible they masked this limit.

There's an argument for increasing the limit in this pack, yes, although that's not my call.

@DasBrain do you have some specific concerns, other than just a thumbs-down? I'm just stating how it is now (and that limit has always been in place, even back in 1.12: https://github.com/FTBTeam/ProjectEX/blob/1.12/src/main/java/com/latmod/mods/projectex/ProjectEXConfig.java#L85). If you have any suggestions, feel free to contribute.

desht avatar Nov 26 '22 09:11 desht

Before, it exposed all items (no matter the EMC value) up to that limit. (So other mods would see 2B Stone, 2B Diamonds...)
Increasing it to Long.MAX_VALUE seems to breaks other stuff.

Therefore, a limit on the number of items that can be taken out is required, and 2B (< Integer.MAX_VALUE) is a good value for that.

DasBrain avatar Nov 26 '22 09:11 DasBrain

The number of items displayed to AE2/RS is in fact limited to Integer.MAX_VALUE, regardless of your EMC level; the emc_link_max_output is the max EMC that be can extracted in one extraction operation. The distinction is significant for high-EMC-value items. Increasing emc_link_max_output beyond Integer.MAX_VALUE shouldn't break anything, but if you are seeing anything not working as intended, please raise an issue with instructions on how to reproduce it.

You'll never see more than Integer.MAX_VALUE of any item in your AE2/RS terminal (the amount is explicitly capped here) simply because a Minecraft ItemStack uses a 32-bit signed int for the stack size.

desht avatar Nov 26 '22 09:11 desht

noticing this specifically for items that are worth more than Integer.MAX_VALUE (Lime Matter, Yellow Matter, Orange Matter, etc in Stoneblock 3). These items are not seen in RS at all as even 1 is worth more than Integer.MAX_VALUE EMC

antisocialian avatar Nov 29 '22 14:11 antisocialian

This behaviour makes no sense at all. Especially since searching in the transmutation table crashes the game half of the time and is basically unusable in later stages of the game.

The EMC links are super overpowered blocks. But nerfing them like that is unintuitive and make late game ProjectE tedious and unfun. To make eight MK15 power flowers you would have to take out smaller matters and then microcraft your way to the highest tier.

That is fine for Gregtech, but not for Stoneblock.

EfficiencyVI avatar Dec 07 '22 07:12 EfficiencyVI

Just to be clear: this is not a nerf. The default limit has always been 2 billion (including back in 1.12.2 when it was ProjectEX), but a separate bug in earlier 1.18 releases masked the limit.

Raising the default for future SB3 releases is under active discussion; this isn't being ignored.

desht avatar Dec 07 '22 08:12 desht

One suggestion that could help with player confusion is to prevent adding items that exceed the EMC limit into the links in the first place.

FuriousSeasons avatar Dec 08 '22 19:12 FuriousSeasons

This change has potentially broken something else. To explain might be best to make a restricted case:

  1. RFTools Storage Scanner
  2. an EMC Link with Cobblestone set in it
  3. a Chest

Use the scanner to combine the Link and the Chest into one list. At this point, you will see 2b Cobblestone (from the Link). Now add some cobblestone (even just one block) to the Chest. Nothing will appear to be listed in the Scanner anymore. Removing the Cobblestone from the Chest will make it visible again.

From my testing, I think there is still a listing in the Scanner for the Cobblestone, it's just invisible and not clickable. But anything that is in both an EMC Link and some other storage container will vanish from the Scanner's list. (Well, they will end up as invisible items at the bottom of the list--you can scroll to them.)

This is probably a limitation with RFTools hitting a 2B limit per item. With 2B visible in the link, there's no room for more and instead of pinning it at 2B, it might be rolling over into negative numbers. Not sure, but it does seem to be broken. Thankfully, not in a server-crashing way, though.

My personal solution will be to return this limit to where it was. It will mean high-EMC (over 2B) items can't be extracted from Links, but I need little to none of that, while I do need everyday EMC items to work with both storage types cleanly. How this is handled for the pack is up to you. I just wanted you to be aware of this issue.

Nonsanity avatar Dec 23 '22 07:12 Nonsanity

I will take a look at EX after the holiday break and see if there's a way to support both cases at the same time (i.e. arbitrary limits but keeping the Storage Scanner happy).

desht avatar Dec 24 '22 09:12 desht

I will take a look at EX after the holiday break and see if there's a way to support both cases at the same time (i.e. arbitrary limits but keeping the Storage Scanner happy).

It's also affecting Refined Storage in a similar way: if I configure the External Storage buses on my EMC links to "extract only" (because Compressed Refined EMC Link has more slots than I can filter on an External Storage), then sometimes a handful of items trickle their way into my Disk Drive, which means I can't see any of them.

I agree that the prior limitation was easier for me to deal with.

airbreather avatar Dec 24 '22 15:12 airbreather

Following up, I changed the config vale to 2000000000 thinking that was what it was before. ~~Either something else changed or that wasn’t the number because this worked VERY well. I was still able to remove even a half stack of Faded Matter and had no trouble with the Storage scanner for items that were in both Links and chests.~~ EDIT: It actually wasn't pulling the Faded Matter from the Link--there was some in a chest. So it's actually back to the way it was.

I think the problem was the Scanner does have a limit, but it’s the same max number that the extendedxchange config has. Using the max int value in the config, the Scanner was reporting “2b” items, which I mistakenly read as two billion, but that would be “2g”. So there was a lot more coming from the Link.

I think all that is needed is to use a number in the config that leaves enough room for likely quantities of other copies of the same item. It won’t be foolproof, as someone could hook a dozen Black Hole storages to the system, each maxed out at two billion cobble, and then if they add a Link with cobble… problem.

~~But, however much is taken off the max int in the config should be how much additional of that item can be in a storage system before it breaks. Perhaps use the value of the item in the pack with the most EMC, if that isn’t too close to max int. Then you can at least get one of anything from a Link.~~ I don't have a working solution.

Nonsanity avatar Dec 24 '22 16:12 Nonsanity

I think our solution is wrong. Reducing the max EMC you can pull out of the EMC links reduces the number of items we can pull out. But actually there should be an option to limit the items no matter how much EMC it costs so storage solutions don't exceed max int items.

Since this can break multiple storage solutions it might be a good idea to ask the extended exchange modders for help.

EfficiencyVI avatar Dec 25 '22 10:12 EfficiencyVI