Is your feature request related to a problem? Please describe.
I added the small scale anaerobic digester system to the game last month. It will produce biogas after fermentation.
A maximum of 13.33 units of biogases (0.25 liter = 250 charges per unit) can be obtained at each collection action for 1 unit of biomass (0.5 KG).
With 2000 units of biomass fluids, you will need to gather 6666500 charges of biogases, and due to that I choosed Character::i_add_or_drop to collect the generated biogases, the game will freeze if you are carrying more than 30 containers at the same time.
I did some optimization in https://github.com/CleverRaven/Cataclysm-DDA/pull/73523, so the game won't freeze if you are only carrying hundreds of containers, but the game will still freeze if you are wearing the debug pocket with 2000 jugs in it when gathering biogases.
@PatrikLundell suggested me to set the amount to 1 when calling Character::i_add_or_drop, but as I explained in https://github.com/CleverRaven/Cataclysm-DDA/issues/73509#issuecomment-2094835948, that will lead to another issue.
Same thing also happens when unloading a container with gases in it using Auto mode. The whole bulk of gases is treated as an item, if you don't have a container that can hold all of the charges, not a single charge will be added to your pockets.
Unloading using manual mode works better, but still not perfect and will cause a bug.
Solution you would like.
As @PatrikLundell and @mqrause said, we need something like the liquid_handler but for gases to fulfill these needs.
Since that gases behave differently from liquids in many ways, like you can't pour gases on the ground or they will escape from the ground, the functions might also be quite different.
Describe alternatives you have considered.
Get rid of charges in the future and add a new infrastructure for gases.
Additional context
I will make a seperate issue for the unloading action of gases.
Is your feature request related to a problem? Please describe.
I added the small scale anaerobic digester system to the game last month. It will produce biogas after fermentation. A maximum of 13.33 units of biogases (0.25 liter = 250 charges per unit) can be obtained at each collection action for 1 unit of biomass (0.5 KG). With 2000 units of biomass fluids, you will need to gather 6666500 charges of biogases, and due to that I choosed
Character::i_add_or_drop
to collect the generated biogases, the game will freeze if you are carrying more than 30 containers at the same time. I did some optimization in https://github.com/CleverRaven/Cataclysm-DDA/pull/73523, so the game won't freeze if you are only carrying hundreds of containers, but the game will still freeze if you are wearing the debug pocket with 2000 jugs in it when gathering biogases.@PatrikLundell suggested me to set the amount to 1 when calling
Character::i_add_or_drop
, but as I explained in https://github.com/CleverRaven/Cataclysm-DDA/issues/73509#issuecomment-2094835948, that will lead to another issue. Same thing also happens when unloading a container with gases in it using Auto mode. The whole bulk of gases is treated as an item, if you don't have a container that can hold all of the charges, not a single charge will be added to your pockets. Unloading using manual mode works better, but still not perfect and will cause a bug.Solution you would like.
As @PatrikLundell and @mqrause said, we need something like the liquid_handler but for gases to fulfill these needs. Since that gases behave differently from liquids in many ways, like you can't pour gases on the ground or they will escape from the ground, the functions might also be quite different.
Describe alternatives you have considered.
Get rid of charges in the future and add a new infrastructure for gases.
Additional context
I will make a seperate issue for the unloading action of gases.