[MOD 0.16] Realistic Reactors

Topics and discussion about specific mods
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

I think the performance issue you are having is one of the known issues (see the first post). I'm afraid there is currently only the workaround I described there.

I am thinking of adding a "simple neighbour mode", that only checks if reactors are near each other, not if they are actually connected. That would reduce the lag on maps with a lot of heat pipes. It's not an ideal sollution, but I don't have any better ideas...

And what exactly is the problem with the interfaces? Are they not beeing created when you build a reactor from a blueprint?
User avatar
Light
Filter Inserter
Filter Inserter
Posts: 678
Joined: Mon Oct 10, 2016 6:19 pm
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by Light »

IngoKnieto wrote:And what exactly is the problem with the interfaces? Are they not beeing created when you build a reactor from a blueprint?
Correct.

The blueprint itself also shows unusual numbers of reactors because it's probably selecting the other components which might be related to the missing interface problem.

Image
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

OK, this is a HUGE blueprint ;)
And I think I know what the problem is: the state of the reactors when you took that blueprint.

The background to this is, that every reactor state is actually a seperate reactor building. For example there is a building (=entity) for the stopped reactor, one for the starting one, and one for the bonus level 2,3,4. This is necessary, because I can't modify the values for energy production and fuel efficency in game, these values can only be set on the entity itself.
You don't see all these different reactors in your building menu, you only build the stopped reactor, and it gets replaced automatically when the necessary criterias are met.

And that seems to be the problem. In the blueprint in your screenshot you have 33+25+4+2 reactors, so I assume a few stopped ones and the others probably running on different bonus levels. And if you build a reactor that is not in stopped state (which you can't do by hand, but you can do it with a blueprint), weird stuff happens.

So long story short: you need to replace all the reactors in your blueprint with the regular stopped reactor.
If you use the Upgrade Planner mod this should be fairly easy. In the upgrade planner config just place the second till fourth reactor (these are the running ones in their different modes) in the From section, and the first reactor (this is the stopped one) in each To section. Then use it on your blueprint.
upgrade_reactors.png
upgrade_reactors.png (906.27 KiB) Viewed 8101 times
I'm sorry there is no easier solution. I had actually looked into this before, but I don't know how to alter buildings in blueprints (yet). You also have to attach the wires to each reactor interface manually after you build them by blueprint.

Hope that helps, let me know...
User avatar
Light
Filter Inserter
Filter Inserter
Posts: 678
Joined: Mon Oct 10, 2016 6:19 pm
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by Light »

Fortunately I build my sectors with a master control panel, so it was no issue shutting them all down at once, redoing the blueprint, and setting it down again.

After a 3 minute pipe check, all 64 reactors had their interfaces and simply had to be rewired. While not perfect, it does allow me to blueprint sections and not have to deal with the repeated pipe check due to missing interfaces anymore. These bugs were known to me since the mod was created but didn't impact much until I went larger scale like this, so I had to inquire about it before it got worse.

Might want to include the information about proper blueprinting on the main post or even the mod portal so people can avoid this issue in the future.
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

I included the information about blueprints in the "known issues" section.

Wow, a 3 minute check is intense, I really must get working on the simple neighbour calculation mode...
mark9064
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Feb 11, 2018 11:23 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by mark9064 »

Would it be possible to add an fuel left percentage circuit signal (as the red bar burn bar depletes, so does the fuel left signal) ?

It would be really useful in circuit controlled reactor setups for finer control.
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

I think theoretically yes, the amount of current fuel in a burner is available, so it should be possible to output that in percent.
I'm just not sure why you would need that. Why don't you use the signal for fuel cells in the reactor, and program the inserters in a way, that there is always one full fuel cell in the reactor?
mark9064
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Feb 11, 2018 11:23 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by mark9064 »

IngoKnieto wrote:I think theoretically yes, the amount of current fuel in a burner is available, so it should be possible to output that in percent.
I'm just not sure why you would need that. Why don't you use the signal for fuel cells in the reactor, and program the inserters in a way, that there is always one full fuel cell in the reactor?
In my efficent setup, I only want to burn fuel when steam is low. This allows me to not waste heat by having to use cooling towers. I'm the kind of guy that has a little combinator army for each reactor :D
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by Ranakastrasz »

A quick look at the factorio API says you might be able to resolve that blueprint issue.

On taking a blueprint "on_player_setup_blueprint", As long as it is in fact a blueprint (And not one of those weird other blueprint types)
Use the "get_blueprint_entities" function on that item (maybe delay a tick if it isn't instant, not sure)
And replace any of the other versions of the reactor with the correct first version.

Not sure if that would work or not admittedly, but it might.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 402
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Energy output scaling with heat

Post by ownlyme »

Maybe the reactor energy output could scale with its heat.
MOX Fuel Rods become more efficient as reactor heat increases (up to 5 times normal efficiency at 99.9% maximum heat) (from the industrial-craft wiki, but i've read that it has this property somewhere else too)
Maybe you could also make it dependand on the type of fuel cell the reactor uses.
I'm currently working on a revamped production chain of the Uranium Power mod, thats where i got the idea from.
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

I'm glad to see people still use my mod :)

But I'm afraid the reactor power output (=heat output) is an attribute of the reactor building, and I can't modify it in-game. To achieve the power output bonus for connected reactors, I have actually four different reactor buildings with different power output in the mod, and when for example you connect two Level 1 reactors, they are both replaced with the Lvl 2 reactor.


@Ranakastrasz : Thanks for the tip, I'll look into that - if I ever find the time to continue this mod :roll:
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 402
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by ownlyme »

i didn't notice any negative impact (not even loading time) when adding 1000 entities and items to the game

Code: Select all

function make_reactor(rname)
return
  {
    type = "reactor",
    name = rname,
	icon = "__RealisticReactors__/graphics/icons/nuclear-reactor.png",
    icon_size = 32,
    flags = {"placeable-neutral", "player-creation"},
    minable = {mining_time = 1.5, result = "realistic-reactor"},
    max_health = 500,
    corpse = "big-remnants",
    consumption = "100MW",
    neighbour_bonus = 1,
    burner =
    {
      fuel_category = "nuclear",
      effectivity = 2.5,
      fuel_inventory_size = 1,
      burnt_inventory_size = 1
    },
    --collision_box = {{-2.2, -2.2}, {2.2, 2.2}},
    --selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
	collision_box = {{-1.4, -1.4}, {1.4, 0.7}},
    selection_box = {{-1.5, -1.5}, {1.5, 0.5}},

	working_sound =
	{
		sound = { filename = "__RealisticReactors__/sound/reactor-active.ogg", volume = 0.6 },
		idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
		apparent_volume = 1.5
	},
	
    picture =
    {
      layers =
      {
        {
		  filename = "__RealisticReactors__/graphics/entity/nuclear-reactor.png",
          width = 140,
          height = 160,
          shift = {0.6875, -0.59375}
        }
      }
    },

    working_light_picture =
    {
      filename = "__RealisticReactors__/graphics/entity/nuclear-reactor-workinglight.png",
      width = 140,
      height = 160,
      shift = {0.6875, -0.59375},
	  priority = "extra-high",
      blend_mode = "additive"
    },
    light = {intensity = 1, size = 9.9, shift = {0.0, 0.0}, color = {r = 0.0, g = 0.5, b = 0.0}},

    heat_buffer =
    {
      max_temperature = 1000,
      specific_heat = "5MJ",
      max_transfer = "10GW",
      connections =
      {
        {
          position = {1, -1.5},
          direction = defines.direction.north
        },
        {
          position = {0, -1.5},
          direction = defines.direction.north
        },
        {
          position = {-1, -1.5},
          direction = defines.direction.north
        },
        {
          position = {1, -1},
          direction = defines.direction.east
        },
        {
          position = {1, 0},
          direction = defines.direction.east
        },
        {
          position = {-1.5, 0},
          direction = defines.direction.west
        },
        {
          position = {-1.5, -1},
          direction = defines.direction.west
        }
      }
    },

    connection_patches_connected =
    {
      sheet =
      {
        filename = "__RealisticReactors__/graphics/entity/reactor-connect-patches-empty.png",
        width = 32,
        height = 32,
        variation_count = 12
      }
    },

    connection_patches_disconnected =
    {
      sheet =
      {
        filename = "__RealisticReactors__/graphics/entity/reactor-connect-patches-empty.png",
        width = 32,
        height = 32,
        variation_count = 12,
        y = 32
      }
    },

	pipe_covers = pipecoverspictures(),
	
    vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65},
    meltdown_action = nil
   
  }
end

function make_item(rname)
return  {
    type = "item",
    name = rname,
    icon = "__RealisticReactors__/graphics/icons/nuclear-reactor.png",
	--icon  = "__base__/graphics/icons/nuclear-reactor.png",
	icon_size = 32,
    flags = {"goes-to-quickbar"},
    subgroup = "energy",
    order = "f[nuclear-energy]-a[reactor]",
    place_result = rname,
    stack_size = 10
  }
end

function make_recipe(rname)
return  {
    type = "recipe",
    name = rname,
    enabled = false,
    energy_required = 20,
    ingredients =
    {
      {"concrete", 500},
      {"steel-plate", 500},
      {"advanced-circuit", 500},
      {"copper-plate", 500},
    },
    result = rname
  }
end

for i=1,1000 do

data:extend({make_reactor("reactor"..i)})
data:extend({make_item("reactor"..i)})
data:extend({make_recipe("reactor"..i)})

end
the only other idea i have is periodically adding fuel to the reactor, increasing the fuel uptime with power production
if you don't like the idea at all, the entities could first be added with my mod, but altering another mod's control.lua is impossible afaik.
i don't want to steal your mod's content either.
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

Ok, adding several reactors with these functions would be a lot easier than I did it :)
It still would be quite an effort, but I think it could be done. I mean there are already 4 (running) reactor versions for the 4 bonus levels, and if you'd add a version with more power output for for example every 100 degree (500-600, 600-700 etc.) then you would end up with 4x5 = 20 reactor buildings - for which you'd also have to modify the function that checks and modifies the reactor states.
Is that anything like what you had in mind?

I also like the idea with periodically adding fuel to the reactor, and that would be fairly easy to achieve. You could say that a reactor operating on higher temperatures has a better fuel efficiency - not sure if that is realistic, but that could make sense in the game.

I really like both of these two ideas, because currently you have no reason to operate a reactor above 500 degrees. Both of these mechanisms would change that, and you would have to build a better control system for temperature and cooling. So well thought 8-)

I think a combination of these two ideas would be nice. I was actually planning on adding a second reactor type - something like a breeder reactor - that has a better power output, and thus burns fuel cells faster (if you play with modded fuel that is sometimes useful).
Currently I am thinking of adding the fuel efficiency thing to the current reactor and adding a second reactor type, that changes power output like you described.
What do you think?

Btw. I published this under the MIT license, so you are free to add, modify and republish - however I appreciate you asking.
But from my point of view we could also add the two ideas as new version of this mod...
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 402
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by ownlyme »

i'm not sure how well this periodically adding fuel would turn out because i think it would look most natural if you put fuel in at least every 1-2 seconds.

about the entity thing, i was thinking about a more fluent solution that would also cover the multiple-reactors mechanic.
So it would choose a reactor based on an energy-calculation factoring in both amount of reactors and current heat. (around 100 entities between 40 and 140 MW or something like that)
But replacing the reactor so quickly would probably require making the internal heat buffer much smaller.
This might look like the most natural solution but it would probably consume more system-resources than just periodically adding (dummy-)fuel.
But from my experience, constantly creating entities doesn't really cause a noticable performance impact, as you can see from my turret shields mod (though that are just dummies for graphics).
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by IngoKnieto »

100 reactor entities are a lot. Creating them will probably not be the main problem performance-wise, but the algorythm that checks and places them will probably have an impact.
But let me think about it and do some tests next week...
User avatar
Light
Filter Inserter
Filter Inserter
Posts: 678
Joined: Mon Oct 10, 2016 6:19 pm
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by Light »

IngoKnieto wrote:I really like both of these two ideas, because currently you have no reason to operate a reactor above 500 degrees.
I will disagree with this. The blueprint I showed previously uses Bob's Mk2 turbines which require the reactors to reach >900 degrees to maintain 100% load with dozens of Mk2 exchangers. This is greatly pushing the limits of an overheating situation which is why the cooling loop activates above 950 and scram at 980, which isn't a large margin for error should something go wrong. It took many tries to fine tune the system to avoid wasting precious heat through cooling towers or hitting scram too early (wasting precious fuel) but it's a very compact and powerful setup when it's well primed by providing 1.9GW instead of the 1.2GW vanilla limit using the same number of buildings. At 100% load the cooling towers should never have to run if it's balanced perfectly, resulting in a 100% efficient power system that trumps the rest.

A larger scale vanilla build could also use >900 heat for the same effect, despite vanilla games often needing far less power than a heavily modded game. Yet I find that it's worth the effort anyway since you shouldn't waste heat with your cooling towers that could be providing far more power for you, vanilla or otherwise. Losing efficiency by wasting heat makes reactors worse then other power production options if set up quite poorly.

It's pushing that thermal limit without exploding the reactor to obtain every single MW possible that's the fun challenge, even if you don't think you need it. That's what ultimately drew me to this mod.
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 402
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by ownlyme »

is there any mod that forces you to go above 900° except bobs mods?
i can't really see what you would loose with this change.
If you don't have a big powerplant with poor heat distribution, something like this would be a nice reward for pushing the limits, and it seems like you had fun with pushing the limits.
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
User avatar
Light
Filter Inserter
Filter Inserter
Posts: 678
Joined: Mon Oct 10, 2016 6:19 pm
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by Light »

ownlyme wrote:is there any mod that forces you to go above 900° except bobs mods?
i can't really see what you would loose with this change.
If you don't have a big powerplant with poor heat distribution, something like this would be a nice reward for pushing the limits, and it seems like you had fun with pushing the limits.
To clarify, I'm only disagreeing with the statement of not needing >500 degree heat in current setups for both Bob's or Vanilla.

Bob's simply allows a more compressed setup to achieve the same goal as a larger vanilla reactor, which is why the temperatures are higher to run the Mk2 exchangers as it's doing the job of x1.5 Mk1's, but ultimately you could scale up with Mk1's and still require >900 to heat them all. I'm likely one of the very few who will tap the full thermal efficiency of these reactors to ensure every MW possible so fuel cells aren't pointlessly wasted. Overkill to most for sure, as many seem to play with high resource counts which permit inefficient designs and yet still have an excess of fuel.

I've only glanced at your idea and don't have any opinion on it until it's more refined for playtesting.
Splicer9
Inserter
Inserter
Posts: 29
Joined: Sun May 06, 2018 6:28 pm
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by Splicer9 »

Hello, was trying to disable the vanilla reactor using code I saw on page 2 of this post:

Code: Select all

    data:extend({

      {
        type = "technology",
        name = "nuclear-power",
        icon_size = 128,
        icon = "__RealisticReactors__/graphics/technology/realistic-reactors.png",
        effects =
        {
          {
            type = "unlock-recipe",
            recipe = "realistic-reactor"
          },    
          {
            type = "unlock-recipe",
            recipe = "rr-cooling-tower"
          },
          {
            type = "unlock-recipe",
            recipe = "centrifuge"
          },
          {
            type = "unlock-recipe",
            recipe = "uranium-processing"
          },
          {
            type = "unlock-recipe",
            recipe = "uranium-fuel-cell"
          },
          {
            type = "unlock-recipe",
            recipe = "heat-exchanger"
          },
          {
            type = "unlock-recipe",
            recipe = "heat-pipe"
          },
          {
            type = "unlock-recipe",
            recipe = "steam-turbine"
          }
        },
        prerequisites = {"advanced-electronics", "concrete"},
        unit =
        {
          ingredients =
          {
            {"science-pack-1", 1},
            {"science-pack-2", 1},
            {"science-pack-3", 1}
          },
          time = 30,
          count = 1000
        },
        order = "e-p-b-c"
      }
    })
But then I get this error: http://prntscr.com/k3zb1h

Any way to include that mod option to disable the vanilla recipe or help me fix this code? Thanks!
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 402
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: [MOD 0.16] Realistic Reactors

Post by ownlyme »

put this into the realistic reactors data.lua:
data.raw.technology["nuclear-power"].effects[1]=nil

or if you have already researched it, enter this in the console:
/c game.players[1].force.recipes["nuclear-reactor"].enabled = false
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance
Post Reply

Return to “Mods”