Reverse Factory

by Kryzeth

Reverse Factory machine will recycle (uncraft) nearly any item placed inside. Supports the recycling of most, if not all, modded items. Fully featured integration with Bobs Mods, Industrial Revolution, and Fantario (independently, not simultaneously)

Content
a month ago
0.13 - 1.1
56.4K
Manufacturing

i Automatic Item Push

6 years ago
(updated 6 years ago)

Thank you so much for enabling the automatic push of input items to output. You did it so fast and I am really happy.

I was wondering if you'd be willing to expose to checking interval to the mod options? A number of mods are exposing a "Ticks between updates / cycles / etc". To allow the user to determine how aggressive the mod is in what it does.

It would be awesome if users could change the check interval from 4 seconds to something they feel like works for them.

For me, I would love to make the mod more aggressive, checking like every two seconds or less. The default value could be the 4 seconds.

Thank you again!

6 years ago
(updated 6 years ago)

Lol, I am definitely not opposed to exposing the numbers. Should be a simple enough addition.

Would I do that in seconds or ticks? I feel like seconds would be easier for users to understand

6 years ago
(updated 6 years ago)

Seconds would be easier to understand but ticks would be more similar to what other mods have done. In general, this is ideal because it streamlines the adoption process. The more similar the options are to other things the user sees, the less they have to think and the quicker they can dive right in.

Think of the difference between an automatic and manual shifting car. Once one learns either system they can usually easily go to another of that system because the interface is similar. The pedals are on the same side and somewhere there is a shifter somewhere to change the transmission mode.

Now if you look at a manual car, you still have the same pedals. But you've added one and now your shifter makes you do more things as your have more control. The interface changed. Is it better? Is it worse? It's just different.

It can be hard for people switch between driving an automatic vs manual car but some people manage to learn both.

So in this case, I think the better route would be asking the user to input the number of ticks required for update. You could describe roughly how many ticks are in a second in a tool tip to make it more clear to the user.

6 years ago

Ooh, good idea. Alright, got it!

6 years ago
(updated 6 years ago)

I was editing my response above when you posted, do you think it explains the idea better or was it just rambling?

edit: and then of course in this one, I made a spelling error...

6 years ago
(updated 6 years ago)

EDIT: Didn't see previous edit. Car analogies go a bit over my head, but I understood your idea from the beginning. I hadn't noticed other mods had already implemented a setting like this, how fancy

Oh yeah, a problem with reducing the delay by too much is because of the way I have the timer setup. Maybe I could do it better, but right now it's set to check every 600 ticks (10 seconds, forgot when I changed that) in game time. Then it goes through a shitton of checks, starting with, does rf table exist, does recycler exist in table, does recycler have power, does recycler have item in input, etc. and pushes the item out at the end.

This runs asynchronous to whether there's an item being processed (which there is no check for), so there is a chance that when it checks, an item is being processed, but gets pushed out because it was unlucky. The crafting time for all reverse recipes are 0.5s, so with a long enough timer like 10s, there's a greatly reduced chance for an unlucky item to slip through.

I suppose the better way to do it would involve checking when a recycler has finished processing, and starting/restarting a timer then, but I'm not sure I can do that easily...

6 years ago

Btw, I am absolutely loving this automatic push setting! Before my recycling plant was having issues keeping up because so many of the recyclers were clogged. But now it can't get enough input :).

6 years ago

Do assemblers send out any notices when they've completed a cycle? Would it be possible to tap into one of those?

6 years ago
(updated 6 years ago)

Okay, so there IS a check for "is_crafting". The problem is when the timer is set too low (I tested 10 tick delay lmao) there is a window of opportunity between the item actually beginning to be recycled, and the timer recycling the object. So when the item has not yet begun processing, but the timer has hit, then the item will be pushed instantly.

There are boundaries I can set for the setting, forcing at least a minimum timer that won't contradict. Something like half a second.. or just slightly above that should work?

6 years ago
(updated 6 years ago)

Is there a 'has_input' check? If there is maybe you could use that and 'is_crafting' to determine if the item can be recycled or not?

Like, if you have a polling time, say 10 ticks. And 'has_input' is true, but 'is_crafting' isn't true you mark a strike.

Then when you come back around on the poll if you notice that 'has_input' is still true, but 'is_crafting' is now true, you clear the strike and move on. However when you come back around if you notice that 'is_crafting' is still false, then because there is the strike, then you flush the input.

6 years ago

I am not sure if you're aware of this, I am sure you are, but according to the wiki there are 60 ticks per second. Nice of them, huh? Keep the game time similar to our knowledge of time by making it also a multiple of 60.

6 years ago
(updated 6 years ago)

There is a "get_inventory" that I use to check if there is an item. Hmm, that might be a bit tick hungry, but probably doable. EDIT: Maybe not doable. At least not easily. Will see

Also, I can't force multiples of 60 or 30 (afaik) but I do have the max, min and default set to multiples of 30

6 years ago

Alright, so because I've done so many updates today, I'm shelving this until a later date. For you though, I've made this with hardcoded values (adding to an existing save had issues with being unable to change the auto push option). The auto push is always enabled, and the tick timer is set to 10. From my small tests, it seemed to work every time, very efficiently.

But I have not extensively tested with existing saves or anything like that. It maaay break. Call it... an experimental alpha build of 4.0.7 and if it doesn't work, just use the mod portal version. That one works. Probably

6 years ago

Haha you're awesome. I'll give it a run and I'll happily be your guinea pig.

6 years ago

I'm gonna guess it worked lol. If anybody else wants to test that alpha version in multiplayer, please feel free to test it, and report the results here.

6 years ago

For some reason, the automatic push isn't working anymore. I'm running version 0.15.28. I've tried toggling the setting both in-game and through the main menu but neither of those change anything.

Furthermore, the delay time in the main menu options isn't the same as the delay time in the in-game mod options menu. So some how those text boxes seemed to be mapped to different fields. Maybe that's why changing the value in game isn't being respected?

However it's not just the text box, the check box for enabling doesn't persist between the in-game menu and the out of game menu.

I've also tried removing and factory but it doesn't update and allow for auto push.

6 years ago

The special version I gave you is hardcoded and ignores the settings by design (I didn't wanna deal with that settings bug, where you had to go in-game, enable a thing, save and exit, change a setting out of game, then go back in the game.. etc).

Although if you're talking about the version on the mod portal currently uploaded... that would be a problem. Either way, I'd have to look into it. It was working before though?

6 years ago
(updated 6 years ago)

For you, v4.0.9: download

This one takes the updates from the main series, uses the player-specified settings, and hopefully with fixed auto push? I know that the mod portal v4.0.8 works, especially when enabled in new games.

There's still a weird bit about switching the option in existing games though. For one slightly older save, I had to change the setting externally, load up the save, change the setting there, then save it again, then load it again, and then the setting stuck. Mileage may vary? This is basically the sole reason I don't push this series to the mod portal. It's finnicky

New response