Mods / Auto-Sifter

Category: #Technology
Author: OmegaHaxors
Side: Both
Created: Aug 22nd 2022 at 4:17 AM
Last modified: Nov 15th 2022 at 8:10 AM
Downloads: 6677
Follow Unfollow 147

Latest file for v1.17.9:
autosifter.zip 1-click install


Adds vanilla-balanced auto-sifters which run on mechanical power. One windmill will produce items slightly slower than a player panning themselves, however you'll also gain the same items had you panned them yourself, and you can feed more power to make it even faster.

Recipe:
12 durability on a soldering iron and 12 solder (one for each plate)
2 plates of Brass as a rust-resistant trim and also internal workings
2 plates of Iron for each side provides a chassis for the machine
1 set of Bronze/Iron/Meteoric/Steel chain will allow the machine to work
and finally a toggle to provide precussive force that makes it all happen

Feed the device mechanical power and place panning blocks above it and items will fall out the bottom. The faster the MP input is, the faster it will process. It uses the same calculation as the helvehammer, so be sure to give it lots of power to get the most out of it. The sifter will scan up the stack so you can place a line of pannable blocks into the sky and it will pan them from the top. The device will still consume MP even when no blocks are being processed, however it will be half as much as if it were. Attach it to a clutch to turn it off when you don't need it.

The device will make three noises:
You'll hear a "thunk" every now and then. This is the sound of the toggle impacting the inside and producing vibration
After about 4 thunks, you'll then hear the glorious sound of sand sifting through the seive, potentially meaning sweet loot
If you got lucky to find a drop, you'll hear a final noise of the item dropping out the bottom onto the ground, ready to be picked up by either you or your hopper.

The "speed" of the device is infinite. If you produce items faster than a tick can handle, it will just produce multiple items within that tick. I plugged it into my giant wall of gears and it cleared an entire stack of bony in one tick. Good luck getting that much power in the real game, though.

The level of chain you use determines which auto-sifter you get. Higher tier auto-sifters can support more blocks on top of it before the chain will break. Bronze can only support one, Iron supports two, Meteoric can support four, and Steel can support eight. You won't lose any material if the chain breaks (it will drop metal bits when this happens) but you will need to smith the chain again. Obviously a machine without chain won't work at all. If you want to tweak the values or liked the old unlimited steel chain, you can adjust these values in the tieredautosifter JSON. You can also add your own tiered autosifter by adjusting the metal varient groups, setting its maxblocks attribute and providing the textures.

No animations or particles yet since I couldn't get them to work, but the rest of the mod works perfectly fine.

Attention modders: Want to dip your toes into the MP system? The decomp of this mod is a perfect place to get started.
Don't feel bad about copying most if not all of the code in here. It's all copied from the main game anyway.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.1.0 4789 Nov 15th 2022 at 8:10 AM Show autosifter.zip Install now
v1.0.2 393 Nov 7th 2022 at 7:22 AM Show autosifter.zip Install now
v1.0.1 1041 Aug 31st 2022 at 2:01 AM Show autosifter.zip Install now
v1.0.0 420 Aug 22nd 2022 at 4:17 AM Show AutoSifter.zip Install now

41 Comments (oldest first | newest first)

💬 OmegaHaxorsAuthor, Nov 25th at 6:33 AM

AngliNex
It goes off the siftable metadata so you'd have to decomplile it, go into the code and exclude it from checking bony soil explicitly.
This is one of the few mods that hasn't required being decompiled as it's worked as-is.

Feel free to post a decompiled version if you do, most of the code is stolen from the main game anyway.
The fact you've thought of adding in the ability to exclude a type of block means you're already putting in more thought that I have and deserve rights to publish your own fork.

💬 AngliNex, Nov 21st at 2:46 AM

Is there a way to deny a block to be sifted?  Like could I make it not work on Bony Soil?

💬 wojtek16, Nov 19th at 2:39 PM

Do you know which mods this has broken? I was going to test it on my friends 1.19.8 server, but we do have around 100+ mods, so wouldn't want to risk it

OmegaHaxors

💬 Nut_Torquer, Sep 21st at 3:30 AM

works for me in 1.19.8

💬 OmegaHaxorsAuthor, Feb 7th at 3:43 AM

CDragonDream
I don't know what the lastest update did but it seems to have broken a ton of mods.
Send a crash report if it breaks and i'll see what I can do to fix it. Otherwise i'm inactive.

💬 CDragonDream, Feb 7th at 12:43 AM

dose this still work or has this died?

tried it out on 1.19.3 still works as far as i can tell. tested it on creative mode

 

💬 liliya, Dec 8th 2023 at 9:18 PM

Frepo

Have you uploaded your fixes anywhere?
Sorry for multiple comment edits, I've never commented here before and I kept screwing up. -_-

💬 OmegaHaxorsAuthor, Oct 14th 2023 at 5:11 PM

Frepo
If you can figure out how to get it to work the rights for a fork are all yours.
My code quality is really bad, most of it is just copied from the base game.

💬 Frepo, Oct 11th 2023 at 6:41 PM

OmegaHaxors
Yeah, I wanted to get into modding stuff for the mechanical power system, so I thought this lovely little machine would be nice to start working on. Did you base the code off the wooden toggle?
Anyway, I've fixed so the game doesn't crash when placing the block next to spinning mechanics. I've added particles flying off each time the machine conducts a sift operation, and some dust particles while it's working (much like the quern).
I've split the shape model into 3 separate jsons (autosifter-inventory, autosifter-stand, autostifter-moving... just like the toggle). Currently I'm stuck at getting the mesher to combine the static model (-stand) and the animated part (-moving), the moving part is just the horizontal axle running through the machine. I'm VERY stuck actually, I think it's time to consult the VS forum... we'll see how this turns out.... 

💬 OmegaHaxorsAuthor, Oct 8th 2023 at 4:22 PM

Frepo
Mod is not in active development at the moment, though you're free to fork the code and take a crack at it.
jamescook
At the moment you have to convert electricity into rotary power first, but i'm not against rewriting this to work with electricity instead.

💬 jamescook, Oct 6th 2023 at 6:19 PM

quick question will this work with the electricty mod?

💬 Frepo, Oct 6th 2023 at 4:00 PM

Wow! This machine sounds wonderful!

I read about the bug below, is it being worked on? To prevent the game from crashing you could do somewhat of a quick-fix; When placing the machine in the world, check all nearby blocks, if anyone of them is an axle (or any of those that crashes the game) then prevent placement and have the UI display a message like "Place the sifter first, then connect rotary power."

💬 OmegaHaxorsAuthor, Aug 30th 2023 at 4:24 AM

Briccars
Argh that bug reemerges with the port to NET7. Don't know what I can say other than don't do that. The Mechanical Power (MP) system is a disaster to work with and i'm not a very good programmer so there isn't much I can do to fix it. Maybe someone with a bit more experience working with the MP can write a patch because I am far too dispassionate at this to deal with it myself. I can only be bothered to fix things that are game-breaking and can't be trivially worked around.

Spleen
You can adjust the durabilities in the tieredautosifter JSON. Look for attributes: { maxblocksByType: {
The number represents how many blocks that tier can support before it breaks. Due to a programming flaw, it will support 1 more than the amount listed there. I'll fix it later, but for now it's a feature(tm)

💬 Briccars, Aug 27th 2023 at 4:22 PM

Had the game crash the instant I placed it next to a wooden toggle, and again next to a wooden axle, it was placeable next to no power blocks, and then I ran an axle up to it and it didnt crash and ran normally. power was turning the whole time

Running on 64 bit Windows with 32716 MB RAM
Game Version: v1.18.8 (Stable)
8/27/2023 11:14:51 AM: Critical error occurred in the following mod: autosifter@1.1.0
Loaded Mods: abandonedkingdom@0.0.4, aculinaryartillery@1.0.14, cheaperarmor@2.0.2, autosifter@1.1.0, backpackpackplus@1.0.3, betterarchery@3.0.0, betterbackpacks@1.0.0, bettercrates@1.6.0, betterpoultice@1.0.0, betterruins@0.2.1, buzzwords@1.3.0, craftables@1.1.1, fancysky@1.0.6, quickerbarrel@1.1.1, fulldrop@1.0.0, instruments@1.2.2, justmoreruins@0.9.2, reducedarmornegatives@1.0.4, meteoricexpansion@1.2.4, moreclasses@1.2.5, nomolding@2.0.1, orepulverizer@1.1.1, primitivesurvival@3.2.7, sexyswords@0.1.2, usefuldrifterloot@1.0.3, visibleore@1.0.1, vtpp@1.0.0, game@1.18.8, zyrails0break0down0tools@1.17.8, alchemy@1.6.4, animalcages@2.1.5, beehivekiln@1.2.2, commonlib@2.2.0, expandedfoods@1.6.4, expandedtraderswithfish@1.0.2, farmlanddropssoil@1.4.0, medievalexpansion@3.10.0, prospectorinfo@4.3.0, SimpleMobFootStepsUpdate@1.0.1, usefulstuff17@1.0.2, vesselbuff@1.0.6, creative@1.18.8, survival@1.18.8, wildfarmingrevival@1.1.2, xlib@0.7.4, metalrecovery@0.1.19-pre.1, knapster@2.4.2, defensive@0.1.7-pre.0, helvehammerext@1.5.1, moremolds@1.2.0, moddownloader@1.1.0, xskills@0.7.5
System.NullReferenceException: Object reference not set to an instance of an object.
at AutoSifter.AutoSifterBlock.TryPlaceBlock(IWorldAccessor world, IPlayer byPlayer, ItemStack itemstack, BlockSelection blockSel, String& failureCode) in S:\VintageStoryModding\AutoSifter\src\autosifter.cs:line 150
at Vintagestory.Client.NoObf.ClientMain.OnPlayerTryPlace(BlockSelection blockSelection, String& failureCode) in VintagestoryLib\Client\ClientMain.cs:line 1626
at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.OnBlockBuild(BlockSelection blockSelection, Block onBlock, String& failureCode) in VintagestoryLib\Client\Systems\Player\MouseInWorldInteractions.cs:line 701
at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.HandleMouseInteractionsBlockSelected(Single dt) in VintagestoryLib\Client\Systems\Player\MouseInWorldInteractions.cs:line 447
at Vintagestory.Client.NoObf.SystemMouseInWorldInteractions.OnFinalizeFrame(Single dt) in VintagestoryLib\Client\Systems\Player\MouseInWorldInteractions.cs:line 92
at Vintagestory.Client.NoObf.ClientEventManager.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\Util\ClientEventManager.cs:line 185
at Vintagestory.Client.NoObf.ClientMain.TriggerRenderStage(EnumRenderStage stage, Single dt) in VintagestoryLib\Client\ClientMain.cs:line 790
at Vintagestory.Client.NoObf.ClientMain.RenderToDefaultFramebuffer(Single dt) in VintagestoryLib\Client\ClientMain.cs:line 983
at Vintagestory.Client.ScreenManager.Render(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 668
at Vintagestory.Client.ScreenManager.OnNewFrame(Single dt) in VintagestoryLib\Client\ScreenManager.cs:line 643
at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(FrameEventArgs e) in VintagestoryLib\Client\ClientPlatform\GameWindow.cs:line 75
at OpenTK.Windowing.Desktop.GameWindow.DispatchRenderFrame()
at OpenTK.Windowing.Desktop.GameWindow.Run()
at Vintagestory.Client.ClientProgram.Start(ClientProgramArgs args, String[] rawArgs) in VintagestoryLib\Client\ClientProgram.cs:line 312
at Vintagestory.Client.ClientProgram.<>c__DisplayClass9_0.<.ctor>b__1() in VintagestoryLib\Client\ClientProgram.cs:line 129
at Vintagestory.ClientNative.CrashReporter.Start(ThreadStart start) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 93

Event Log entries containing Vintagestory.exe, the latest 3
==================================

💬 Spleen, Aug 24th 2023 at 11:08 PM

Are you able to add configurable durabilities? Love the mod.

💬 OmegaHaxorsAuthor, Jun 20th 2023 at 6:11 AM

ThreeHeadedDingo
Ah! I thought I fixed that. Well this is going to come across really poorly, but just try not to do that.
The MP system is a total hack and lets just say the code quality of the sifter isn't the best.
Will probably address the issue next time I return to active development, it's not enough of a break to justify exiting hiatus.

💬 ThreeHeadedDingo, Jun 10th 2023 at 7:40 PM

Looks like it only occurs when trying to place it directly next to a transmission.

💬 OmegaHaxorsAuthor, Jun 10th 2023 at 6:26 PM

ThreeHeadedDingo
Could not reproduce issue. Going to need more information.

💬 ThreeHeadedDingo, Jun 9th 2023 at 9:14 PM

Placing sifter crashes the game.

💬 OmegaHaxorsAuthor, Apr 24th 2023 at 10:04 AM

Yanazake
It tested it, it works fine. The API changes didn't touch this one.

💬 AzuliBluespots, Apr 22nd 2023 at 10:12 PM

Is this still  working fine in 1.18.x?

💬 OmegaHaxorsAuthor, Feb 11th 2023 at 9:08 AM

Just_a_cat
Yikes nice find, that seems to be a vanilla bug.
It seems to be running while the chunk is unloaded and drops the items while it's still loading.

💬 Jozhin_z_bazhin, Feb 4th 2023 at 6:17 PM

May be i find a bug...

If you leave the area, where sifter installed, and chunks are unloaded, then, when you return to sifter, it will drop bunch of items. But not from bottom, but on top of nearest north block

💬 SalazarWindriver, Jan 28th 2023 at 1:35 AM

any way of having the config setting out of the zip into the modconfig folder?

💬 OmegaHaxorsAuthor, Nov 15th 2022 at 8:14 AM

Something I should have done from the beginning: Auto-Sifters now have tiers.
Bronze can only support one block at a time, iron two, meteoric four and steel can support eight.
If you exceed the limit of pannable blocks over the sifter, it will break the chain into metal bits.
You won't lose any material but you will need to smelt the bits back into a new chain.

The recipe for auto-sifters has been tweaked to be slightly cheaper on chain, now that they can break.
Don't worry about that massive pile of blocks you put over your old sifter. It will still retain its old stats.
Only sifters created in this version will use the new tier system. Old sifters remain unbreakable.

You can tweak the maximum amount of blocks the sifters can support in the tieredautosifter JSON.

💬 OmegaHaxorsAuthor, Nov 7th 2022 at 7:24 AM

I got tired of waiting for the devs to fix the issue with item substitution, so I created a work-around.
Now there's a seperate recipe for both versions of chain, with both taking each type of solder.

💬 OmegaHaxorsAuthor, Sep 20th 2022 at 4:05 AM

l33tmaan
It does, it's just the current game version won't handle recipe substitutions properly.
Instead of adding 4 recipes to cover each substituion, it only adds 2.
If you have issues, use the other type of soldier or chain.

💬 l33tmaan, Sep 20th 2022 at 12:43 AM

Just to confirm before I download: This current release doesn't actually work in survival mode?

💬 OmegaHaxorsAuthor, Sep 16th 2022 at 6:26 PM

Brotherlui
Thanks for reporting the issue, seems to be an issue on my end as well.
Going to try to fix the issue, it's probably just a case of bad JSON somewhere.

I figured it out. It's a glitch in the main game. The way it handles substitutions, you have to use the other kind of soldier.
Steel only works with one kind of soldier and Meteoric only works with the other.
Will forward this to the developers so that they can fix it on their end.

You're not going to lose any gamer cred for throwing away the items and using /giveitem autosifter:autosifter-ns

💬 Brotherlui, Sep 15th 2022 at 4:29 PM

Hi, using 1.17.3 stable all parts in the crafting grid but no Auto-Sifter. Update necessary?

💬 OmegaHaxorsAuthor, Sep 1st 2022 at 1:14 AM

Had to reupload the latest update since it had a broken lang JSON.

💬 Zaldaryon, Aug 31st 2022 at 11:07 PM

@OmegaHaxors gotcha. No worries. I understand the current point of not being "fully automated". I like the way it is too :D

💬 OmegaHaxorsAuthor, Aug 31st 2022 at 9:15 PM

Not willing to do that. The whole point of the auto sifter is to reward the player for building out how to run it.
If you could just put a hopper on it and call it a day, it would just become a braindead sand->metal converter.
One thing worth knowing is that you can stack multiple panning blocks and it will draw from the top of the pile.
Another option is to top it up as it runs, see if you can work a schedule to keep the device running at all times.
I designed it around the helvehammer, where your work alongside your machine, but it can work on its own too.
Just like with the helvehammer, your input is inputting the work material and picking up the drops when they're done.
Zaldaryon

💬 Zaldaryon, Aug 31st 2022 at 3:20 PM

@OmegaHaxors I'd love if you could feed the blocks from a chest on the top with a hopper or a chute, like the quern.

💬 OmegaHaxorsAuthor, Aug 31st 2022 at 3:56 AM

bluelightning32
Already addressed. JSON will load in the dev environment but then refuse to load in the main game.
It's insufferable because you'll make a perfectly good mod and when you go to ship, everything falls apart.
As part of my completely blind "change everything and hope it works" that JSON issues on ship forces you to do to in order to get a timely release, the file is now all lowercase. Make sure to delete the old one.

💬 bluelightning32, Aug 31st 2022 at 3:29 AM

v1.0.0 worked, but v1.0.1 crashes during start up:

20:28:39 [Server Notification] Entering runphase WorldReady
Game Version: v1.17.0-rc.8 (Unstable)
8/30/2022 8:28:39 PM: Critical error occurred
Loaded Mods:
System.NullReferenceException: Object reference not set to an instance of an object
at Vintagestory.ServerMods.ModStdWorldGen.LoadGlobalConfig (Vintagestory.API.Server.ICoreServerAPI api) [0x00050] in <7184b6136735497d8d8eade88f301110>:0
at Vintagestory.ServerMods.GenSnowLayer.initWorldGen () [0x00000] in <7184b6136735497d8d8eade88f301110>:0
at Vintagestory.Server.ServerSystemSupplyChunks.LoadWorldgenHandlerAndSpawnChunks () [0x000a6] in <de92e11e138b4846accc12709ee431b0>:0
at Vintagestory.Server.ServerSystemLoadAndSaveGame.OnBeginWorldReady () [0x00000] in <de92e11e138b4846accc12709ee431b0>:0
at Vintagestory.Server.ServerMain.EnterRunPhase (Vintagestory.API.Server.EnumServerRunPhase runPhase) [0x000cf] in <de92e11e138b4846accc12709ee431b0>:0
at Vintagestory.Server.ServerMain.Launch () [0x00256] in <de92e11e138b4846accc12709ee431b0>:0
at Vintagestory.Server.ServerProgram.Main2 () [0x000e5] in <42e5d5b64f154c1eb771d6ffa3ac5643>:0
at Vintagestory.ClientNative.CrashReporter.Start (System.Threading.ThreadStart start) [0x00007] in <de92e11e138b4846accc12709ee431b0>:0
Crash written to file at "./../live_data/Logs/server-crash.txt"

💬 OmegaHaxorsAuthor, Aug 31st 2022 at 2:02 AM

People were struggling WAY more than anticipated on obtaining steel.
Now the recipe allow you to use Meteoric Iron chain as a substitution.
That change should make the mod just a little bit more accessible.

💬 OmegaHaxorsAuthor, Aug 23rd 2022 at 3:56 AM

Check out Harp's Mechanical Revolution which adds new MP sources to run the autosifter with.

💬 OmegaHaxorsAuthor, Aug 22nd 2022 at 5:01 AM

Should work now bluelightning32

💬 OmegaHaxorsAuthor, Aug 22nd 2022 at 4:31 AM

slight issues for some reason that meme of "it worked in the dev environment" is actually happening here.
Hold tight while I work on a solution.
EDIT Turns out the mod asset folder must share the same capitalization as the mod itself. Fix soon.

💬 bluelightning32, Aug 22nd 2022 at 4:27 AM

v1.0.0 fails to start up with v1.17.0-rc.5 on Linux. First, this error appears in the console:

21:26:08 [Server Error] Exception thrown during handling event OnSaveGameLoaded: System.Exception: Can't create itemstack without item!
at Vintagestory.API.Common.ItemStack..ctor (Vintagestory.API.Common.Item item, System.Int32 stacksize) [0x0001f] in <dd02eb3223a5453a83e1fa3625df3e8b>:0
at Vintagestory.GameContent.ModSystemAuction.Event_SaveGameLoaded () [0x0001b] in <7b1d3b86d4794c5fbefa65fa3ab35337>:0
at (wrapper delegate-invoke) <Module>.invoke_void()
at Vintagestory.Server.ServerEventManager.TriggerSaveGameLoaded () [0x0000a] in <f5f10b0f67c94dd6a5c07b0c00e2f868>:0

 

Then this error appears:

21:26:08 [Client Fatal] System.NullReferenceException: Object reference not set to an instance of an object
at Vintagestory.ServerMods.ModStdWorldGen.LoadGlobalConfig (Vintagestory.API.Server.ICoreServerAPI api) [0x00050] in <7b1d3b86d4794c5fbefa65fa3ab35337>:0
at Vintagestory.ServerMods.GenSnowLayer.initWorldGen () [0x00000] in <7b1d3b86d4794c5fbefa65fa3ab35337>:0
at Vintagestory.Server.ServerSystemSupplyChunks.LoadWorldgenHandlerAndSpawnChunks () [0x000a6] in <f5f10b0f67c94dd6a5c07b0c00e2f868>:0
at Vintagestory.Server.ServerSystemLoadAndSaveGame.OnBeginWorldReady () [0x00000] in <f5f10b0f67c94dd6a5c07b0c00e2f868>:0
at Vintagestory.Server.ServerMain.EnterRunPhase (Vintagestory.API.Server.EnumServerRunPhase runPhase) [0x000c3] in <f5f10b0f67c94dd6a5c07b0c00e2f868>:0
at Vintagestory.Server.ServerMain.Launch () [0x00256] in <f5f10b0f67c94dd6a5c07b0c00e2f868>:0
at Vintagestory.Client.ClientProgram.ServerThreadStart () [0x000b0] in <b9cdf349ac844cf2ad1f5d8ef396f19f>:0

(edit comment delete)