Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Ignoring "Expensive electrolysis mode" option from "bobplates" mod #920

Open
Vetal-inside opened this issue Jul 29, 2023 · 5 comments
Labels
Angels Petrochem petrochem related Impact: Bug Something could be wrong Impact: Mod compatibility Mainly involves 3rd party mods

Comments

@Vetal-inside
Copy link

Describe the bug
Angels electrolysers ignoring option "Expensive electrolysis mode" from bobplates mod, what do them electricity positive at any case: you can gain more energy from burning hydrogen, that spent on water->hydrogen+oxygen splitting reaction. And as angel's electrolysers disable bob's by default, seems this is bug.
fctr12

To Reproduce

  1. Game Version: 1.1.87
  2. Modlist: all angels(except angels exploration) + all bobs(except bobs greenhouse), components
  3. Affected mods: angelspetrochem, bobplates, bobassembly

Additional context
Bob's electrolysers, its parameters and overrides (with enabled "Expensive electrolysis mode" option) defined into two different places:
1). First tier - electrolyser.
Parameteres at \bobplates\prototypes\entity\entities.lua, line 96 and bellow:

data:extend({
  {
    type = "assembling-machine",
    name = "electrolyser",
    icon = "__bobplates__/graphics/icons/electrolyser.png",
...........
    crafting_speed = 0.75,
    energy_usage = "420kW",
    energy_source = {
...........

"Expensive mode" override at \bobplates\data-updates.lua, line 11:

...........
--Electrolyser power
if settings.startup["bobmods-plates-expensive-electrolysis"].value == true then
  data.raw["assembling-machine"]["electrolyser"].energy_usage = "1050kW"
end
...........

2). Next tiers - electrolyser-2, electrolyser-3, electrolyser-4 and electrolyser-5.
Power consumption parameters at \bobassembly\prototypes\electrolyser.lua, lines 287, 321, 355 and 388:

 ...........
energy_usage = "650kW",
...........
energy_usage = "960kW",
...........
energy_usage = "1210kW",
...........
energy_usage = "1400kW",
...........

"Expensive mode" override at \bobassembly\prototypes\electrolyser-updates.lua, line 7:

...........
  --Electrolyser power
  if
    settings.startup["bobmods-plates-expensive-electrolysis"]
    and settings.startup["bobmods-plates-expensive-electrolysis"].value == true
  then
    data.raw["assembling-machine"]["electrolyser-2"].energy_usage = "1625kW"
    data.raw["assembling-machine"]["electrolyser-3"].energy_usage = "2400kW"
    data.raw["assembling-machine"]["electrolyser-4"].energy_usage = "3025kW"
    data.raw["assembling-machine"]["electrolyser-5"].energy_usage = "3500kW"
  end
...........

As we see - with expensive electrolysis, power consumption higher at 2.5 times, that with default settings.

And at the same time, all angels electrolysers and their parameters are defined at \angelspetrochem_0.9.24\prototypes\buildings\electrolyser.lua, with next power consumption(lines 48, 174, 300 and 425):

...........
energy_usage = "300kW",
...........
energy_usage = "350kW",
...........
energy_usage = "400kW",
...........
energy_usage = "450kW",
...........

And no matter - enabled "Expensive electrolysis mode" option or not. These values do not change.

Possible solution
Adding if-check for enabled "Expensive electrolysis mode" option at override section: \angelspetrochem_0.9.24\prototypes\override\bobplates.lua, with the same 2.5x multiplier at example. Something like this:

if mods["bobplates"] then
  if settings.startup["bobmods-plates-expensive-electrolysis"].value == true then
	data.raw["assembling-machine"]["angels-electrolyser"].energy_usage = "750kW"
	data.raw["assembling-machine"]["angels-electrolyser-2"].energy_usage = "875kW"
	data.raw["assembling-machine"]["angels-electrolyser-3"].energy_usage = "1000kW"
	data.raw["assembling-machine"]["angels-electrolyser-4"].energy_usage = "1125kW"
  end
end

As me seems, angelspetrochem has many tiers for electrolysers by default, with no options to change it, so there are no reason for checking if bobassembly mod enabled with his high tier electrolysers(with only bobplates mod, without bobassembly and angels mods, you will have just one, first tier electrolyzer). Or if I'm wrong - just add additional checking for bobassembly mod, that to apply power override for high-tier electrolysers only when mod active and expensive mode is on.

Regards

@LovelySanta LovelySanta added Impact: Bug Something could be wrong Angels Petrochem petrochem related labels Jul 31, 2023
@LovelySanta
Copy link
Collaborator

LovelySanta commented Jul 31, 2023

In angels this is more complicated, we should only make it more expensive in the case where you can (still) burn hydrogen...

@Vetal-inside
Copy link
Author

Electrolysis is very energy-consuming process as itself, in reallife. Case with receiving more energy than spent on it, with water electrolysis - just mostly obvious example.
May be right solution will be increasing power consumption, or decreasing resulting production, or increasing working time, or some combination of these variants. And all of this complicated and will impact on balance.

But my main idea was increasing compatibility with bob's mods, and just considering settings from there(I guess, that 2.5x multiplier has some theoretical justification, and mr. Bob didn't take it "just because"... of if he did, at least this is partial solution - simple water electrolysis will become energy deficient).

Also, this option("Expensive mode") is disabled by default, so player needs manually activate it, if he want a little bit harder game experience. For other players, on default settings, nothing changes.

p.s.: Sorry for close-reopen issue, that was misclick

@KiwiHawk
Copy link
Collaborator

KiwiHawk commented Aug 2, 2023

Another option is to just hide the setting ... 🤔
There are a lot of these kind of settings that I'm considering just removing from Bob's.

@LovelySanta
Copy link
Collaborator

Another option is to just hide the setting ... 🤔 There are a lot of these kind of settings that I'm considering just removing from Bob's.

I would prefer to have the issue 'fixed' that it cannot be used as a power generator... At that point the setting can be removed...
In any case, no matter what, angels should also prevent it from being used as a power generator?

@Vetal-inside
Copy link
Author

Another option is to just hide the setting ... 🤔 There are a lot of these kind of settings that I'm considering just removing from Bob's.

No option - no problem... Yep, this is also some kind of "solution". At least players will not confuse "why its not working?"
But in my opinion, will be better to rework power consumption, with saving optional expensive mode setting

@KiwiHawk KiwiHawk added the Impact: Mod compatibility Mainly involves 3rd party mods label Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angels Petrochem petrochem related Impact: Bug Something could be wrong Impact: Mod compatibility Mainly involves 3rd party mods
Projects
None yet
Development

No branches or pull requests

3 participants