[MOD 0.12.11+] Diesel Generator

Topics and discussion about specific mods
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

[MOD 0.12.11+] Diesel Generator

Post by Klonan »

Image

**Updated Diesel generator available as part of the KS Power mod**

Type: Mod
Name: Diesel Generator
Description: Adds a generator for burning oil and straight up producing electricity. It can burn petroleum, light oil and heavy oil. It requires research. Pics below show stuff.
License:Ask me
Version: 0.3.0
Release:2015/09/26
Tested-With-Factorio-Version: 0.12.16
Category: Energy
Tags: Electricity, production, generation, oil, late game
Latest Release:
Diesel_Generator_0.3.0.zip
--New Sprite, Icons, Technology. Greatest thanks to YuokiTani

--Changed recipe
--Pollution now dependant on fuel type
--Size, fluid boxes changed
(483.7 KiB) Downloaded 13878 times
Images

NOTE: Updating from 0.2.1 to 0.3.0 will break EVERYTHING about the generators. They are different sizes, and the fluid boxes are different. Nothing I can do about that. There is nothing wrong with the old version, just the new version has a new sprite, so do whatever pleases you

Uhh so basically, max output is dependant on liquid type.
Max output is as follows

Burning Petroluem = 1.6 MW
Burning Heavy Oil = 1.0 MW
Burning Light Oil = 2.2 MW

also pollution is fixed, independent of energy production, i dont think it is very much at the moment, i mat look at revising the pollution values at some point.

Greatest thanks to YuokiTani for creating the Spritesheet and icon

As always, any comments, feedback, compliments or complaints i am more than happy to hear them!

After more testing:

10 light oil = 75MJ
10 petroleum = 55MJ
10 heavy oil = 35MJ

Comparison to solid fuel ~> boilers

10 light = 10 solid fuel = 250MJ = 125MJ power
Generator = 60% as efficient

10 petro = 5 solid fuel = 125MJ = 62.5MJ power
Generator = 88% as efficient
10 heavy = 5 solid fuel = 125MJ = 62.5MJ power
Generator = 56% as efficient

So as you can see...

Its more efficient to use steam engines still, but this acts as a supplementary way to provide power for your base, backup power, remote (no water) power and other such fun!
Old releases
Last edited by Klonan on Sat Dec 19, 2015 12:36 pm, edited 14 times in total.
Kayser
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Mon Aug 10, 2015 9:43 am
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Kayser »

So, this is similar to https://forums.factorio.com/forum/vie ... =93&t=9873, except this does not heat water but create power directly?

How do these two compare in terms of fuel efficiency?
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Kayser wrote:So, this is similar to https://forums.factorio.com/forum/vie ... =93&t=9873, except this does not heat water but create power directly?

How do these two compare in terms of fuel efficiency?
Oil steam boiler is more efficient (and can burn crude oil too), its also cheaper, and a lower technology level (green science), but it requires water and steam engines to work
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by SHiRKiT »

So no liquid can reach 100% efficiency?
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

SHiRKiT wrote:So no liquid can reach 100% efficiency?
100% efficiency? In terms of oil burning, non of the options are 100% efficient.

in terms of 'Output', no, none of the oils can reach 100% output, since the default temp of oils is 25.

The oils are balanced around one another, using the following logic:

2 heavy oil = 1 solid
2 petro = 1 solid
1 light = 1 solid

So that light oil I will set to temp 100,

and the other i will set to half the difference between 100 and 25
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

I've been doing some tests with the latest version (0.1.3) and have the following information

Max output is as follows

Burning Petroluem = 1.6 MW
Burning Heavy Oil = 1.0 MW
Burning Light Oil = 2.2 MW

This is because Light oil has twice the energy per fluid as petroleum or heavy oil! But i've rebalanced it somewhat so that burning petroluem is more efficient than burning heavy oil and light oil, but that light oil results in maximum power output
Kayser
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Mon Aug 10, 2015 9:43 am
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Kayser »

What is the consumption in units/s?
What is the pollution? Is it same pollution per time for all fluids? or same per MW generated?

I'd like a complete tech spec in pdf, please :)
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Kayser wrote:What is the consumption in units/s?
What is the pollution? Is it same pollution per time for all fluids? or same per MW generated?

I'd like a complete tech spec in pdf, please :)

Consumption is 0.3 fluid/sec at max, but differs for the different oils

pollution is currently is 1.5 per second, irregardless of power produced and oil type used

Complete specs are hard to come by... a lot of this is brim of my trouser calculations...

but dont worry about specifics! just have fun with it :P
Kayser
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Mon Aug 10, 2015 9:43 am
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Kayser »

I'm running a RSO/Marathon with Bob's mods and some more. Techs are expensive. Need to know if I should go for this one... ;)
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Kayser wrote:I'm running a RSO/Marathon with Bob's mods and some more. Techs are expensive. Need to know if I should go for this one... ;)

well really its up to you, its not cheaper than standard boiler/steam engine energy setups, but you dont need water to make power, it can be set up more quickly and ripped down far more easily.

Its good for remote oil outposts, emergency backup power and burning off unwanted oils
Michelle
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 01, 2015 6:51 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Michelle »

Hey Klonan, i'm really enjoying your mods, and at one point i wanted to kinda merge some of them, sooo i tweaked the diesel engine files to be able to accept hydrogen gas as fuel :D (from the Bergius process mod). Now if i could just make it so it doesn't produce any pollution, or a very very small amount (like a fictitious real life internal combustion hydrogen generator probably should) that would be great. I just recently started to try and mod factorio and im a rookie, so i was wondering if you could maybe help me out a bit, how do i make it so that different fuels produce different amount of pollution, or is it specifically linked to a generator. Pretty please? I've set the hydrogen-gas max temperature to a value of 70, so kinda between petrol and heavy oil, not the best but not the worst either. I realise that the tweak is maybe an overkill, but its only good fun :)
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Ranakastrasz »

Only seems to be working for heavy oil. not sure why. The rest will go in and be consumed, but don't heat up or give off any power.

Edit:

According to Lua wiki, "elseif" is the correct syntax, not "else if"
According to notepad++, the if statements are not paired correctly with the end statements. Only in the case of heavy oil does it get to the part where it sets the temperature.

Edit2:
This is my revamped code, which appears to work. I suggest you use indentation in the future, since it makes it easier to figure out what is paired with what.

Code: Select all


function check_generators()
    if global.petroleum_generator ~= nil then
        for k,petroleum_generator in pairs(global.petroleum_generator) do
            if petroleum_generator.valid then
                if petroleum_generator.fluidbox[1] ~= nil then 
                    local gen = petroleum_generator
                    local pot = gen.fluidbox[1]
                    local surface = gen.surface
                    local p = gen.position

                    if pot.type == "petroleum-gas" then 					
                        pot["temperature"] = 75 

                    elseif pot.type == "light-oil" then 					
                        pot["temperature"] = 100 

                    elseif pot.type == "heavy-oil" then 					
                        pot["temperature"] = 50 
                    else 					
                        pot["temperature"] = 15
                    end

                    petroleum_generator.fluidbox[1] = pot
                    surface.pollute({p.x, p.y}, 0.1)
                end
            end
        end
    end
end

My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Ranakastrasz wrote:Only seems to be working for heavy oil. not sure why. The rest will go in and be consumed, but don't heat up or give off any power.
What version of the mod are you using?

the latest version (0.2.0) works fine for me
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Ranakastrasz »

Klonan wrote:
Ranakastrasz wrote:Only seems to be working for heavy oil. not sure why. The rest will go in and be consumed, but don't heat up or give off any power.
What version of the mod are you using?

the latest version (0.2.0) works fine for me
Oh, that would explain it. No patchlog, and no update post, so I didn't realize I had an outdated version.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Ranakastrasz wrote:
Klonan wrote:
Ranakastrasz wrote:Only seems to be working for heavy oil. not sure why. The rest will go in and be consumed, but don't heat up or give off any power.
What version of the mod are you using?

the latest version (0.2.0) works fine for me
Oh, that would explain it. No patchlog, and no update post, so I didn't realize I had an outdated version.
The latest version is very clearly stated on the OP, and posting to say 'its been updated' seems a little meh.

But yea, you must have downloaded it from when i first posted the mod, because i quickly noticed the problem you had and fixed it.

Soon when factorio has a mod portal or in game implementation updated will be much easier to notice
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2173
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Ranakastrasz »

Eh, I post saying update myself since it makes it easier for people to know you updated. Why? Because unlike editing a post, it shows up on subscription/view your posts.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Michelle wrote:Hey Klonan, i'm really enjoying your mods, and at one point i wanted to kinda merge some of them, sooo i tweaked the diesel engine files to be able to accept hydrogen gas as fuel :D (from the Bergius process mod). Now if i could just make it so it doesn't produce any pollution, or a very very small amount (like a fictitious real life internal combustion hydrogen generator probably should) that would be great. I just recently started to try and mod factorio and im a rookie, so i was wondering if you could maybe help me out a bit, how do i make it so that different fuels produce different amount of pollution, or is it specifically linked to a generator. Pretty please? I've set the hydrogen-gas max temperature to a value of 70, so kinda between petrol and heavy oil, not the best but not the worst either. I realise that the tweak is maybe an overkill, but its only good fun :)
Hey Michelle, Im really glad you're enjoying my mods :D

In my generator mod the pollution is done via script in the control lua using this command

Code: Select all

gen.surface.pollute({p.x, p.y}, 0.1)
This means that for my generator it is a fixed amount of pollution per script update(which is every second)
If you wanted to reduce the pollution you could write it something like this

Code: Select all

local pollution = 0.1
if pot.type == "hydrogen-gas" then pollution = 0 end
gen.surface.pollute({p.x, p.y}, pollution)
However im not sure why you would want to use hydrogen gas as a fuel, since the only way it is produced is my electrolysing water, which uses more energy than it would produce :P

Anyway, i hope you found this helpful :D
Michelle
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu Oct 01, 2015 6:51 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Michelle »

Yes, exactly what I needed, thank you Klonan :) Well, hydrogen as fuel because it doesnt pollute (now), and i make it during the day with solars, so any excess electricity gets used to make hydrogen which is stored to be used as emergency generator fuel, if I ever need it. Just adds to the fun factor in my case :D I already have tons of ideas for some other mods that i wish to make, and i wanted to ask you if you have heard about the E-diesel that Audi makes? It is basically the same as Bergius process, the difference being that not coal is used, but CO2 from the atmosphere. In factorio, maybe that could be achieved by creating some kind of an air filter that cleans the pollution and feeds CO2 to the chemical plant instead of coal. That is what i want to make basically, so wish me luck :D
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5284
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by Klonan »

Michelle wrote:Yes, exactly what I needed, thank you Klonan :) Well, hydrogen as fuel because it doesnt pollute (now), and i make it during the day with solars, so any excess electricity gets used to make hydrogen which is stored to be used as emergency generator fuel, if I ever need it. Just adds to the fun factor in my case :D I already have tons of ideas for some other mods that i wish to make, and i wanted to ask you if you have heard about the E-diesel that Audi makes? It is basically the same as Bergius process, the difference being that not coal is used, but CO2 from the atmosphere. In factorio, maybe that could be achieved by creating some kind of an air filter that cleans the pollution and feeds CO2 to the chemical plant instead of coal. That is what i want to make basically, so wish me luck :D
Hey i think thats a really good idea! My sucking up pollution (in the form of CO2) and turning it back into usable energy.

Theres a method called the Sabatier Reaction whereby CO2 and H2 are turned into Methane and water, perhaps something like this would be good to model in the game, and be able to burn methane in a diesel generator, or even solid fuel. Additional steps could be taken to turn this gas into petroluem Using some of these methods

I might have a look at making something like this, if you've not already done so, could be very interesting gameplay (ie turning pollution into oils)
capthavic
Inserter
Inserter
Posts: 30
Joined: Tue Oct 13, 2015 10:05 pm
Contact:

Re: [MOD 0.12.x] Diesel Generator

Post by capthavic »

Update today broke the mod, hope you can patch it soon.
Post Reply

Return to “Mods”