Applied Energistics 2

Applied Energistics 2

137M Downloads

AutoCraft Calculation Suggests

DoremySwee opened this issue · 5 comments

commented

(I haven't tried rv7 yet. Forgive me if this had been added to rv7)
(Why are my two other issues closed without even a reasonable response? The only response is completely nonsense.)

Suppose if there is a loaded Encoded Pattern: 1charcoal+8log=>8charcoal. When I have a charcoal and enough logs in the ME network and I start auto craft(10 charcoal), it shows that I need 1 more charcoal to do this.
And another example is: I've got a bucket and I'm going to use a water bucket which will be returned later to do some auto craft. Even though I put it when I tried starting crafting two recipes with water bucket in it, it ends up needing two bucket in all.
This seems to be necessary.

However, I know there can be such a situation that may cause errors: if I have a pattern which is:1A->4A, and I start autocrafting xA without 4xA.

And
捕获
I have a draft here: (just a draft, I don't have any experience in modding, I wrote in this way only to make it a little bit similar to the actual situation than common words)
//I have no idea what itemstack exactly means. I mean item, amount, metadata, nbt and so on by itemstack.
//On the other hand, I don't know where the file that calculates the Ingredients is. I will be very greatful if I know……

list require_craft_item(itemstack aim, listfurther_aim,listavailable_items)
{
listIngredients;
while(?) //just try all the patterns that end up in aim.getItem(). If CraftingFeatures.CraftingManagerFallback=false,then just
{ //try one pattern
??? //move available items form available_items to Ingredients. Record changes to fix it after calculation. this is much
faster than give another listto store the information.
listfurther_craft=????; //list the items that need to be craft later
if(???) //???:If any type of items needing further_craft has a bigger number than that in further_aim, then "???" is true.
{
fix available_items.
try the next pattern or end the program and return a message that means failure.
|
else
{
Ingredients=Ingredients+require_craft_item(further_craft,further_aim+aim,available_items)
//A+B simply refers to add B into list A here
return Ingredients;
}
}
}
If this won't slow down the system a lot……
I think 1 to 3 seconds before thousands-byte autocrafting is acceptable, while the calculation won't cost much more time as the number of autocrafting grows……

Forgive me if I didn't express well, for I'm poor at English expressing.

commented

Recursive recipes are simply not possible. The crafting uses a top down approach, so it has to check what it needs to craft charcoal. For which it would need charcoal and to craft that, it needs charcoal again and again. Which would end up with an infinite loop.

commented

Recursive recipes are simply not possible. The crafting uses a top down approach, so it has to check what it needs to craft charcoal. For which it would need charcoal and to craft that, it needs charcoal again and again. Which would end up with an infinite loop.

But the number of wanted charcoal is decreasing……

And I hope to know where the present calculater is, so that I may give a more proper "solution"……
"If any type of items needing further_craft has a bigger number than that in further_aim, then "???" is true."

commented

Auto crafting does not work sequential, the required items are calculated and stored inside the crafting cpu, recursive recipes like that can not be simulated properly or the whole crafting system has to be rewritten to work sequential, introducing a lot of other problems. Also your other issue was not properly reported and the first one was clearly answered, telling a response non-sense just because you dont like it is very rude.

commented

Auto crafting does not work sequential, the required items are calculated and stored inside the crafting cpu, recursive recipes like that can not be simulated properly or the whole crafting system has to be rewritten to work sequential, introducing a lot of other problems. Also your other issue was not properly reported and the first one was clearly answered, telling a response non-sense just because you dont like it is very rude.

1)I'm sorry for forgetting Ingredient allocation during the auto crafting……I will think further. Would you mind offering the current calculation? So that I can learn more about it. Thank you.
2)I provided how to reproduce the situation: just use P2P to input x mb of water into the cell, and use anyway to fulfill it with lava, such as fluid input-bus and ME-IO Port
3)You were talking about security controller while I was talking about appliedenergistics2:matrix_frame. I was simply considering why the same action gave different result on different computers.

commented
  1. i can not, the autocrafting code is complex enough, i just know the basic order of operation, sorry, i did not dare myself to try to understand that part of the code
  2. i do not know what that is related to
  3. yueh gave you an answer, i tried to make sense of your log there and yueh actually nailed it down