Better Air Filtering

by JoeyDP

An overhaul of the air filtering mod by Schorty. Includes complex air filtering steps to remove pollution.

Content
3 years ago
0.17 - 1.1
10.3K
Environment

b [Bug] remove the used filters from the first tier cleaner

5 years ago

I seem to have ran into a bug, but it wasn't with a clean start with mod from the beginning.

Tried to use an inserter to remove the used filters from the first tier cleaner, and it didn't work.
Upgrading to a tier two allowed the inserters to pull out the used filters.

5 years ago
(updated 5 years ago)

Thank you for bringing this to my attention. There is indeed a 'bug' where inserters cannot access the used filters in the first tier. Unfortunately this is a limitation of the base game, not of this mod. We are considering a potential workaround in the future.

5 years ago

What is the root of the problem if it seems to be working as intended for tier 2?

5 years ago

The same problem as described here: https://forums.factorio.com/viewtopic.php?t=55738
It boils down to inserters only being able to access one inventory, which is an issue when a mod decides to give a crafting machine a fuel slot. The second and third tier use a different, less visually pleasing and rewarding mechanic (because they need electricity anyway).

It appears that the first tier is burning the filter as fuel, and burnt fuel is not supposed to give an output. I imagine (haven't tested) that adding efficiency modules to first tier would make the filter last much longer. Higher tier machines use a crafting recipe, so the efficiency modules make the machine use less electricity, but the pollution to filter ratio and the time to filter ratio remain the same.

5 years ago
(updated 5 years ago)

It appears that the first tier is burning the filter as fuel, and burnt fuel is not supposed to give an output. I imagine (haven't tested) that adding efficiency modules to first tier would make the filter last much longer.

Yes, that is why the first tier does not have module slots and isn't affected by beacons.

4 years ago

Up!
Is there any solution? Like, for example, prohibit using recyclable filters in tier 1 cleaner?

4 years ago

you should be using the same machine type for each of the tiers, because replacing the entity to upgrade them from an assembling machine with fluid spot, to a furnace with fluid spot, causes the game to desync and crash, seemingly upon the used filter output becoming full. this is due to a known race condition in the base game, but it is certainly exacerbated by the odd design choice of using separate machine subtypes for each tier.

4 years ago

@ptx0 Thank you very much for telling me it is the desync reason!!! I have removed the mod, and now everything is stable, like a charm!

4 years ago

you should be using the same machine type for each of the tiers, because replacing the entity to upgrade them from an assembling machine with fluid spot, to a furnace with fluid spot, causes the game to desync and crash, seemingly upon the used filter output becoming full. this is due to a known race condition in the base game, but it is certainly exacerbated by the odd design choice of using separate machine subtypes for each tier.

In version 2.2 I changed all tiers to the furnace type. It's difficult for me to resolve, because I can't seem to reproduce these issues locally. Even when the corrupt saves that were reported on the forum worked fine for me. Anyway, let me know if your suggestion fixes the issue :).
- Joey

4 years ago

ok, interesting. i can try and send you the save file, because for now i have reverted to the previous air filtering mod (sorry!) to ensure my base doesn't become overrun while I'm scaling up build.

4 years ago
(updated 4 years ago)

@JoeyDP
I have restored the updated mod into my game. Now, upon joining the server I get an error message:
424.759 Error ClientMultiplayerManager.cpp:1121: mod-better-air-filtering was not registered for the following events when the map was saved but has registered them as a result of loading: on_tick (ID 0)
424.760 Error ClientMultiplayerManager.cpp:101: MultiplayerManager failed: "" + multiplayer.script-event-mismatch + "mod-better-air-filtering"

4 years ago
(updated 4 years ago)

Hmm.. apparently: https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_load

on_load(f):
Register a function to be run on module load. This is called every time a save file is loaded except for the instance when a mod is loaded into a save file that it previously wasn't part of.

In v2.3 the on_tick event is registered at a different callback. Let me know if this resolves the issue.

4 years ago
(updated 4 years ago)

I briefly tested the new version. So far I could connect successfully. Thank you for the fix

New response