Picked up product would be added to the crafting queue
Moderator: ickputzdirwech
-
- Fast Inserter
- Posts: 148
- Joined: Sun Mar 20, 2016 3:36 pm
- Contact:
Picked up product would be added to the crafting queue
Let say I build a roboport on my person. If I forget the gears but I have the iron plates it will start making a lot of gears. It would be nice if I could pick up some gears and these would then fill the gear requirement. Since it displays all the ingredients necessary on the lower left, this would be a very convenient and easy way to fill in each product after the crafting of the item has begun.
Re: Picked up product would be added to the crafting queue
Oh, that has discussed several times. The problem here is - in very short words - that this would enable you to cheat.
A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
Solution till now: I don't know. This is much more complex.
A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
Solution till now: I don't know. This is much more complex.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Picked up product would be added to the crafting queue
Can you give me the exact problem? I'm a python programe and I would like to solve it. I know I cannot give you a python result but I can give you a solution in real words like a mathematical solution.
Reasons:
Btw: I hate cheating
Reasons:
- I like this idea
I like challenges
You will not lose anything
I will inform you about my work if you want
Btw: I hate cheating
My LP Factorio series (in czech)
Re: Picked up product would be added to the crafting queue
No, cause that would mean, I know all the details...Brambor wrote:Can you give me the exact problem?
Understanding the problem is one part of programming.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Picked up product would be added to the crafting queue
Well the problem on my side is that I don't know where to search for and I don't know the programming language it is written in...
C'mon I wana help!
C'mon I wana help!
My LP Factorio series (in czech)
Re: Picked up product would be added to the crafting queue
Ok, step one: Use the help boards for help instead of suggestion board.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Picked up product would be added to the crafting queue
Thank you for the explanation. This helps.ssilk wrote:Oh, that has discussed several times. The problem here is - in very short words - that this would enable you to cheat.
A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
Solution till now: I don't know. This is much more complex.
Re: Picked up product would be added to the crafting queue
This makes no sense. You can just calculate it again, except this time with the new components.ssilk wrote:A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
Re: Picked up product would be added to the crafting queue
Consider this: You queue up stacks of ten different items that each require 6-10 assembly steps before reaching the final product. Then, you expect to be able to run around your factory doing other things. If the game had to make adjustments to the assembly queue each time you picked up a new item, the game would likely slow to a crawl. That might be a chain of one hundred or even one thousand items that each have to be checked each time you pick up an item. Plus, you may pick up one item or a stack of items. Don't get me wrong. I would love it if the game adjusted the ingredient list on the fly as I'm running around my base at lightning speed in my Power Armor MKII with six exoskeletons. But I'm not sure any computer short of a quantum computer could actually do that.Zeblote wrote:This makes no sense. You can just calculate it again, except this time with the new components.ssilk wrote:A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
Re: Picked up product would be added to the crafting queue
I'm pretty sure the devs can figure out a nice way to handle this. Really can't see how you can use it to cheat though.garath wrote:Consider this: You queue up stacks of ten different items that each require 6-10 assembly steps before reaching the final product. Then, you expect to be able to run around your factory doing other things. If the game had to make adjustments to the assembly queue each time you picked up a new item, the game would likely slow to a crawl. That might be a chain of one hundred or even one thousand items that each have to be checked each time you pick up an item. Plus, you may pick up one item or a stack of items. Don't get me wrong. I would love it if the game adjusted the ingredient list on the fly as I'm running around my base at lightning speed in my Power Armor MKII with six exoskeletons. But I'm not sure any computer short of a quantum computer could actually do that.Zeblote wrote:This makes no sense. You can just calculate it again, except this time with the new components.ssilk wrote:A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
-
- Fast Inserter
- Posts: 194
- Joined: Sat Apr 23, 2016 7:11 am
- Contact:
Re: Picked up product would be added to the crafting queue
IMO this should be quite easy.
First of all if an item (electric circuit) is collected, then we check if it is required in any pending recipe.
If no, nothing has to be done.
If yes, then we just reduce the given recipe by the collected amounts.
After that we recalculate all sub recipes (copper cable) and update them accordingly.
On modern computers this shouldn't take much longer than a few ms.
PS: Please remeber that you can also adjust the final output of ECs by cancelling one or all copper cable crafting tasks.
First of all if an item (electric circuit) is collected, then we check if it is required in any pending recipe.
If no, nothing has to be done.
If yes, then we just reduce the given recipe by the collected amounts.
After that we recalculate all sub recipes (copper cable) and update them accordingly.
On modern computers this shouldn't take much longer than a few ms.
PS: Please remeber that you can also adjust the final output of ECs by cancelling one or all copper cable crafting tasks.
Last edited by bNarFProfCrazy on Sat May 28, 2016 2:18 pm, edited 1 time in total.
Re: Picked up product would be added to the crafting queue
I'd be shocked if it takes even one ms.bNarFProfCrazy wrote: On modern computers this shouldn't take much longer than a few ms.
-
- Fast Inserter
- Posts: 194
- Joined: Sat Apr 23, 2016 7:11 am
- Contact:
Re: Picked up product would be added to the crafting queue
You'll never know how many crafting tasks are enqueued and their complexity.Zeblote wrote:I'd be shocked if it takes even one ms.bNarFProfCrazy wrote: On modern computers this shouldn't take much longer than a few ms.
If you use C or C++ this is probably <= 1ms area, but if you use lua or else you might end up > 1ms.
Please also remember that GUI updates are slow (at least the consoles I have used so far (up to 10ms/update)).
Re: Picked up product would be added to the crafting queue
Considering factorio is written in c++ and already handles hundreds of thousands of entities at 60 fps, I don't see a problem.bNarFProfCrazy wrote:You'll never know how many crafting tasks are enqueued and their complexity.Zeblote wrote:I'd be shocked if it takes even one ms.bNarFProfCrazy wrote: On modern computers this shouldn't take much longer than a few ms.
If you use C or C++ this is probably < 1ms area, but if you use lua or else you might end up > 1ms.
Please also remember that GUI updates are slow (at least the consoles I have used so far (up to 10ms/update)).
-
- Filter Inserter
- Posts: 301
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: Picked up product would be added to the crafting queue
What if, instead of calculating the whole craft queue at once, you just add the final item to the queue. Then, when an item comes up on the queue, if it's precursors arent' avaialble, add them *in front of the current item*, and jump to the head of the queue. If the item's precursors are available, they are then taken and the actual crafting is done. This way only the current tasks's items are removed, but the math issues don't come up as much, since the job is still n-units-of-item. This also means that things you pick up now are available for any crafts starting *after* now, but not the one that's currently running.ssilk wrote:Oh, that has discussed several times. The problem here is - in very short words - that this would enable you to cheat.
A bit more info: The crafting queue is calculated before beginning to craft. The needed items are taken out of your inventory. The problem here is, that it is a difference between crafting one and many items. The brutto and netto items can differ, this is due to the fact that you need for example 2 copper to craft one electronic circuit, but "only" 3 to craft 2. This is because you need 1.5 copper per one circuit netto, but because you cannot use 1/2 copper you need to take brutto 2 copper.
If you change this calculation in the middle of the process the calculation is then wrong or in other words: You can cheat here.
Solution till now: I don't know. This is much more complex.
Of course, this may be problematic if any item in your craft series produces more stacks than it consumes (because of a lower stack size, probably), since each intermediate step would have to fit in your inventory again.
Re: Picked up product would be added to the crafting queue
That can work. But I wouldn't like that; it breaks my whole calculation, if some collected items are suddenly not available, cause automatically moved into the crafter.
What makes sense here is a button "Optimize crafting queue" (or similar), which does exactly that: It tries to refit the items in the queue, which aren't already in progress.
What makes sense here is a button "Optimize crafting queue" (or similar), which does exactly that: It tries to refit the items in the queue, which aren't already in progress.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Picked up product would be added to the crafting queue
This is not ideal then I would run on the belt, hold F and be constantly clicking the button at the same time (which is like 4keys at the same time btw - close to playing a piano). I think it should be done as it is said above, automaticly and all the time, but instead of checking it every tick it could check every second and/or after an item is finished crafting. ("And" because some things takes over ten seconds to craft so it would not be fast enough)
EDIT:
If that's right then it is a bad concern because the EC would be already needed so if you pick up one then the materials for crafting a EC will be released so you will be able to craft inserter (and this will add an EC to craft the inserter).
Another thing: I don't know how is the ´inventory of future things' done (how does it know that you will have one more Cu cable cause you will use only one of the two crafted) but if it is not done yet then I would make a 'future inventory' which will act as a normal one where things that will be crafted are stored. Of course player will not be able to see it.
Would it simplify this problem, or, is it already implemented?
EDIT:
Oh! I might finally understod that. Did you ment that when you have a crafting queue and then pick up a EC to craft inserter then it would be immediately consumed by crafting queue so you cannot craft the inserter?ssilk wrote:That can work. But I wouldn't like that; it breaks my whole calculation, if some collected items are suddenly not available, cause automatically moved into the crafter.
If that's right then it is a bad concern because the EC would be already needed so if you pick up one then the materials for crafting a EC will be released so you will be able to craft inserter (and this will add an EC to craft the inserter).
Another thing: I don't know how is the ´inventory of future things' done (how does it know that you will have one more Cu cable cause you will use only one of the two crafted) but if it is not done yet then I would make a 'future inventory' which will act as a normal one where things that will be crafted are stored. Of course player will not be able to see it.
Would it simplify this problem, or, is it already implemented?
My LP Factorio series (in czech)
Re: Picked up product would be added to the crafting queue
Exactly. That is an unawaited "feature". You cannot plan ahead like so.Brambor wrote:Oh! I might finally understod that. Did you ment that when you have a crafting queue and then pick up a EC to craft inserter then it would be immediately consumed by crafting queue so you cannot craft the inserter?ssilk wrote:That can work. But I wouldn't like that; it breaks my whole calculation, if some collected items are suddenly not available, cause automatically moved into the crafter.
No, no, no, that exactly is not true.If that's right then it is a bad concern because the EC would be already needed so if you pick up one then the materials for crafting a EC will be released so you will be able to craft inserter (and this will add an EC to craft the inserter).
You need to think more general; there is not only one way to do things. Think: the much more clever way in this situation would be, that I build an assembly and put the EC's (and other stuff) into it, so that it crafts the stuff for me! Building assembly and puting stuff into it takes approximately less than 10 seconds, if you are used to it. Compared to the time you spare it's no question, that this is better. With your change that would not be possible.
I insist on this, NOT because I think this is the better way, but because I think everybody should play his style and that means, that the control must take care on all possibilities.
The current logic is simple: All stuff that is needed to craft things is moved to a "hidden inventory". That inventory is also "endless" (hint, hint, you can use this as a hidden, endless inventory by crafting slow stuff and then abort crafting! That is also one more reason to make changes here very carefully, cause this can be easy used to cheat or abused) and everything that is crafted is put into another inventory, which is reintegrated after crafting.wAnother thing: I don't know how is the ´inventory of future things' done (how does it know that you will have one more Cu cable cause you will use only one of the two crafted) but if it is not done yet then I would make a 'future inventory' which will act as a normal one where things that will be crafted are stored. Of course player will not be able to see it.
Would it simplify this problem, or, is it already implemented?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Picked up product would be added to the crafting que
I see one problem. When you pick up EC, and you get the items back, your inventory might overflow { you could get two items (Fe plate and Cu wire) while there could be only one place in your inventory }
That means that it would say you have full inventory (Cannot pick up one item EC, because {}) or it would drop one of the items on the ground, which is absolutely stupid (you would drop wires on EC belts with no space inventory to pick them up). So I now agree with your button .Yes it would have the problem too, but it could hapen only after you press the button, and it could say something like "Shorting crafting queue cannot be used because there is not enought space in your inventory".
I hope it will make sence to you, it may not since it is one sentence
So now, mod it, quickly!
Edit: gramatical adjustements
That means that it would say you have full inventory (Cannot pick up one item EC, because {}) or it would drop one of the items on the ground, which is absolutely stupid (you would drop wires on EC belts with no space inventory to pick them up). So I now agree with your button .Yes it would have the problem too, but it could hapen only after you press the button, and it could say something like "Shorting crafting queue cannot be used because there is not enought space in your inventory".
I hope it will make sence to you, it may not since it is one sentence
So now, mod it, quickly!
Edit: gramatical adjustements
My LP Factorio series (in czech)
Re: Picked up product would be added to the crafting queue
Workaround might be: swich only if there is space for the items removed from the queue (after putting the replacements here).Brambor wrote:I see one problem. When you pick up EC, and you get the items back, your inventory might overflow { you could get two items (Fe plate and Cu wire) while there could be only one place in your inventory }
That means that it would say you have full inventory (Cannot pick up one item EC, because {}) or it would drop one of the items on the ground, which is absolutely stupid (you would drop wires on EC belts with no space inventory to pick them up). So I now agree with your button .Yes it would have the problem too, but it could hapen only after you press the button, and it could say something like "Shorting crafting queue cannot be used because there is not enought space in your inventory".
Still it is a bit clunky as you may have be crafting inserters (and EC for them) and have EC in your inventory.
However the mod doesn't take those EC and thus makes no sence!
It is special case, but still, how would you say that to the user? Or how would you work around that (considering it has to be as cheat-prove as possible).
Now, nobody got to it so I guess I will have to mod it myself...
And learn how to mod beforehand...
The button is a good idea, maybe it should be a toggle button (automatic queue update on/off)
My LP Factorio series (in czech)