Modules not working as intended
Moderator: bobingabout
Modules not working as intended
The problem is machines produce less (or more in few cases) than they should.
This is setup that I used to test this.
And the test itself.
As you can see result depends on recipe craft time. I didn't test very long (5s+) recipes but I think they would be closest to expected result. As for cause of this behaviour I think the problem is that the real craft time of quick recipes after modification by machine speed and modules is close if not lower than one game tick and because of huge productivity would require to output product 2-5 times per tick and that's impossible. This is big problem because many recipes use 0.5s or 1s craft time.
This problem also occur in Drills and is even more significant because even 1 God module 5 would decrease real productivity in mk5 drill (compared to full raw productivity modules setup)
This is setup that I used to test this.
And the test itself.
As you can see result depends on recipe craft time. I didn't test very long (5s+) recipes but I think they would be closest to expected result. As for cause of this behaviour I think the problem is that the real craft time of quick recipes after modification by machine speed and modules is close if not lower than one game tick and because of huge productivity would require to output product 2-5 times per tick and that's impossible. This is big problem because many recipes use 0.5s or 1s craft time.
This problem also occur in Drills and is even more significant because even 1 God module 5 would decrease real productivity in mk5 drill (compared to full raw productivity modules setup)
-
- Filter Inserter
- Posts: 778
- Joined: Sun Sep 07, 2014 12:59 pm
- Contact:
Re: Modules not working as intended
That's a known issue with the game, it simply breaks with very high speeds of assemblers: https://forums.factorio.com/forum/vie ... 41&t=15093
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.
Re: Modules not working as intended
Could you post a save with this setup for devs in that thread with bug report?
Re: Modules not working as intended
maybe thats kind of the reason why productivity modules in the base game slow down production?
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Modules not working as intended
I don't think that is the reason.
But I will admit that putting 6 god modules in an assembling machine is beyond the intention of the devs.
I think the current way the game works is that you are basically allowed one entire bar fill per tick. if the bar fills faster than this. if you get more than one fill per tick, the excess is carried over to the next tick. in a situation where it is running flat out constantly, these excess productions arn't fully taken account for.
But I will admit that putting 6 god modules in an assembling machine is beyond the intention of the devs.
I think the current way the game works is that you are basically allowed one entire bar fill per tick. if the bar fills faster than this. if you get more than one fill per tick, the excess is carried over to the next tick. in a situation where it is running flat out constantly, these excess productions arn't fully taken account for.
Re: Modules not working as intended
Productivity modules in the base game slow down production because it's a good balance system for generating free items
Regarding the weirdness when super overclocking a machine - picture this:
9 * 60 ticks (1 second) and now the number is wrong by 540 floating point rounding errors. 1 second later that number is up to 1080 and it keeps going. 10 minutes into constant crafting and the number would be wrong by 324,000 rounding errors.
Now, these errors are consistent - that is to say that the same error happens every time the same calculation is done. If they weren't then the game would be desyncing every few ticks. However, they throw off these types of calculations by massive amounts over time.
As the crafting system is now when the machine produces an item it re-sets the energy stored value to 0 - erasing all of the left over rounding errors accumulated over the life time of the 1 craft. That's why a crafting machine with a calculated energy-per-tick of 0.3875 only produces 2 items over the course of 4 ticks when 0.3875 * 4 > 1.55.
Regarding the weirdness when super overclocking a machine - picture this:
- Iron gear wheels have a crafting time of 0.5s.
- That means they have an "energy" of 0.5 - the literal floating point number "0.5".
- Crafting machines produce: (recipe energy / 60 energy per tick) * crafting speed.
- So in this instance you have: (0.5 / 60) * 1 = 0.0083333333333333 "energy" produced per game tick for a total craft tine of 30 game ticks (0.5 seconds).
- Now this works just fine for a crafting speed of 1: 0.0083333333333333 * 30 ~ 0.5 so you get ~1 item per half second.
- Iron gear wheels crafting time: 0.5s - energy of 0.5.
- Crafting machine 6 crafting speed: 3.5
- Modules: 6 totaling 1200% speed and 300% productivity
- In this instance you have: (0.5 / 60) * 15.5 * 3 = 0.3875 energy produced per game tick
- Now you'd experience a crafting time of 2 ticks: 0.3875 + 0.3875 > 0.5 and the energy re-sets to 0 after producing the item.
9 * 60 ticks (1 second) and now the number is wrong by 540 floating point rounding errors. 1 second later that number is up to 1080 and it keeps going. 10 minutes into constant crafting and the number would be wrong by 324,000 rounding errors.
Now, these errors are consistent - that is to say that the same error happens every time the same calculation is done. If they weren't then the game would be desyncing every few ticks. However, they throw off these types of calculations by massive amounts over time.
As the crafting system is now when the machine produces an item it re-sets the energy stored value to 0 - erasing all of the left over rounding errors accumulated over the life time of the 1 craft. That's why a crafting machine with a calculated energy-per-tick of 0.3875 only produces 2 items over the course of 4 ticks when 0.3875 * 4 > 1.55.
If you want to get ahold of me I'm almost always on Discord.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Modules not working as intended
If this is true, it's wrong. it shouldn't reset to 0 just because an item is made. it should reset to 0.3875 + 0.3875 = 0.775 - 0.5 = 0.275 and get an item. Then since this would result in a cumulative increase in items given, if an item is given, it should check again to see if it is above the time, therefore allowing more than 1 item to be given per tick.Rseding91 wrote:Now you'd experience a crafting time of 2 ticks: 0.3875 + 0.3875 > 0.5 and the energy re-sets to 0 after producing the item.
-
- Filter Inserter
- Posts: 778
- Joined: Sun Sep 07, 2014 12:59 pm
- Contact:
Re: Modules not working as intended
But if you do that, rounding errors will start accumulating. Wouldn't that lead to desyncs in MP games (since floating point precision isn't guaranteed to be the same across platforms).
Also, realistically, how big of a deal is this? With 1 item created every tick, you're going to need a decent amount of inserters already for input and output. Add in the productivity bonus of your god modules and it moves into ridiculous territory I would find it an acceptable compromise to limit production to one item per tick from regular production and the proper amount of items from productivity bonus - as long as input consumption is correct and no input is lost along the way.
Also, realistically, how big of a deal is this? With 1 item created every tick, you're going to need a decent amount of inserters already for input and output. Add in the productivity bonus of your god modules and it moves into ridiculous territory I would find it an acceptable compromise to limit production to one item per tick from regular production and the proper amount of items from productivity bonus - as long as input consumption is correct and no input is lost along the way.
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.
Re: Modules not working as intended
That still gives maximum of 1 item per second since even if you get that 0.275 for next tick, itll be completed in 1 tick and give another 0.275 in next tick resulting in 0.275 shifts per tick giving nothing but troubles.bobingabout wrote:It should reset to 0.3875 + 0.3875 = 0.775 - 0.5 = 0.275 and get an item. Then since this would result in a cumulative increase in items given, if an item is given, it should check again to see if it is above the time, therefore allowing more than 1 item to be given per tick.
Re: Modules not working as intended
guess a work around would be to produce bigger stacks in a proportional time.
Re: Modules not working as intended
Even if you max out the production to make 60 items per second and 60 items from productivity per second it still gives you 7200 items per minute. You need about 10 inserters to get it out of the assembly machine (5 with bobs inserters) and you need space for inserters that put stuff in the machine as well. Its already impossible to fit. With copper wire its 14400 items per minute since it produces 2 items per tick.crysanja wrote:guess a work around would be to produce bigger stacks in a proportional time.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Modules not working as intended
this is basically where the check to see if you get an item needs to be a loop, so if the speeed would give you 10 completed cycles in a tick, you should get 10 completed cycles worth of items in a tick.oLaudix wrote:That still gives maximum of 1 item per second since even if you get that 0.275 for next tick, itll be completed in 1 tick and give another 0.275 in next tick resulting in 0.275 shifts per tick giving nothing but troubles.bobingabout wrote:It should reset to 0.3875 + 0.3875 = 0.775 - 0.5 = 0.275 and get an item. Then since this would result in a cumulative increase in items given, if an item is given, it should check again to see if it is above the time, therefore allowing more than 1 item to be given per tick.
It's a bit pointless debating it in here though, the devs are unlikely to see this, it's not often they snoop through mod subforums.