Page 1 of 2

[MOD 0.15.X] Wreckage Pollution

Posted: Sat Jun 04, 2016 9:14 am
by sparr
Wreckage Pollution

https://mods.factorio.com/mods/sparr/wreckage-pollution

Description:
  • This mod adds chemical spills and pollution from destroyed entities.
LONG DESCRIPTION
Details: Pictures
Chemical spill
Download
Download: https://github.com/sparr/factorio-mod-w ... 0.15.0.zip
Comments and suggestions
This thread!

Change Log
Version-0.15.0
Version-0.13.0
Version-0.0.3
Version-0.0.2
Version-0.0.1
TODO
TODO

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sat Jun 04, 2016 3:36 pm
by bNarFProfCrazy
Really nice idea,
I will try this mod once it has per liquid colors. At least for the main liquids.

Another suggestion: liquified-air/gas has or fuel has the tendency to explode if incinerated (Flamethrower).
https://www.youtube.com/watch?v=PZ1PpM4DAGQ

One minor note:
Please reference this link in your download url:
https://github.com/sparr/factorio-mod-w ... ses/latest
or this one:
https://github.com/sparr/factorio-mod-w ... n/releases

That way we can see which changes have happened and you don't have to update the link every time you release an update.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sat Jun 04, 2016 5:40 pm
by miturion
yea, nice idea. Makes you think more about placement in the first place.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sat Jun 04, 2016 8:13 pm
by sparr
bNarFProfCrazy wrote: I will try this mod once it has per liquid colors. At least for the main liquids.
Thanks. Done!
bNarFProfCrazy wrote:Another suggestion: liquified-air/gas has or fuel has the tendency to explode if incinerated (Flamethrower).
Adding explosions will probably happen after I figure out how to get/deduce more info about the fluids.
One minor note:
Please reference this link in your download url:
https://github.com/sparr/factorio-mod-w ... ses/latest
or this one:
https://github.com/sparr/factorio-mod-w ... n/releases

That way we can see which changes have happened and you don't have to update the link every time you release an update.
The download link is supposed to be a download link. You can click the "Website" link if you want to get to all the info on github without directly downloading the mod.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sat Jun 04, 2016 8:40 pm
by bNarFProfCrazy
Nice. Thanks for this quick update.

However your download file is broken since it does not contain the required wrapping folder.

Otherwise works like a charm.(Added to my permanently active mods.)
Dirtorio.png
Dirtorio.png (1.42 MiB) Viewed 11846 times
Maybe it would be nice if you can add different variations for each splash. (Just rotate/flip them in the raw graphics, similar to the trees/concrete)

Another wish of mine: Please make small slashes last longer. Because I barely destroyed my pipes with my flamethrower and the splash was already gone by the time the smoke was gone.
(Being visible only one second is not enough, maybe add a minimum time a spill is visible.)
sparr wrote:
bNarFProfCrazy wrote:Another suggestion: liquified-air/gas has or fuel has the tendency to explode if incinerated (Flamethrower).
Adding explosions will probably happen after I figure out how to get/deduce more info about the fluids.
I guess you can't. You probably have to hardcode them somewhere.
I suggest adding a config.lua in your plugin root folder, where all necessary data are stored.
(See Orbital Ion Cannon for example)

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sat Jun 04, 2016 9:31 pm
by sparr
bNarFProfCrazy wrote:However your download file is broken since it does not contain the required wrapping folder.
Thanks, fixed this. I need to make a script for packaging mods to avoid mistakes like this.
bNarFProfCrazy wrote:Maybe it would be nice if you can add different variations for each splash. (Just rotate/flip them in the raw graphics, similar to the trees/concrete)
I'll find better art and include variations, fwen this mod is popular enough to keep working on (which seems likely, yay!)
bNarFProfCrazy wrote:Another wish of mine: Please make small slashes last longer. Because I barely destroyed my pipes with my flamethrower and the splash was already gone by the time the smoke was gone. (Being visible only one second is not enough, maybe add a minimum time a spill is visible.)
Maybe? You can change pollution_intensity in the config if you want to make all spills last longer. I'm gonna wait for feedback from more players before I tweak the base values.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sun Jun 05, 2016 6:49 am
by bNarFProfCrazy
sparr wrote:
bNarFProfCrazy wrote:However your download file is broken since it does not contain the required wrapping folder.
Thanks, fixed this. I need to make a script for packaging mods to avoid mistakes like this.
I wished Factorio wouldnt require the intermedeate folder. That would make 3verything simplier.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sun Jun 05, 2016 11:11 am
by bNarFProfCrazy
Game crashes with wreckage-pollution_0.0.2 when I die/kill a rock with missiles.
Factorio-wrack.png
Factorio-wrack.png (79.47 KiB) Viewed 11183 times
EDIT: Any entity that dies causes this, if it has no corpses defined in its prototypes.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Sun Jun 05, 2016 6:44 pm
by sparr
bNarFProfCrazy wrote:Game crashes with wreckage-pollution_0.0.2 when I die/kill a rock with missiles.
Factorio-wrack.png
EDIT: Any entity that dies causes this, if it has no corpses defined in its prototypes.
Thanks. Fixed in 0.0.3

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Mon Jun 06, 2016 7:51 pm
by thereaverofdarkness
It would be neat if a water tank would create a non-polluting spill just for looks: a highly transparent dark spill that makes the ground look wet.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Mon Jun 06, 2016 7:53 pm
by sparr
thereaverofdarkness wrote:It would be neat if a water tank would create a non-polluting spill just for looks: a highly transparent dark spill that makes the ground look wet.
I think that will happen after I come up with a way to do more per-fluid things, like making other fluids safe, making gas clouds instead of liquid spills, making explosions, etc.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Tue Jun 07, 2016 6:37 pm
by bNarFProfCrazy
Hi again, its me,

I have found another issue in v0.0.4:
Destroying a diesel-locomotive (color-coding_1.0.7) will show this message and crash the game.
Error.png
Error.png (73.78 KiB) Viewed 8747 times
EDIT: AFAICT, you can simply change:

Code: Select all

 if game.entity_prototypes and game.entity_prototypes[entity_name].corpses then
to

Code: Select all

 if game.entity_prototypes[entity_name] and game.entity_prototypes[entity_name].corpses then
to fix that issue.

Another request:
Please add a link to your README file on github targetting this thread. Because it took me quite a while to find this thread again in the forums.

I also had a quick peek at your License file. It looks like you are using the MIT license, but it does not state it explicitly in the file.
Because of that I recommend you to copy paste the content of this page https://mit-license.org/ including the heading and the line-breaks to simplify things for everyone.
Another example: https://github.com/ST-DDT/Test/blob/master/LICENSE
Quick hint: The default name for license files on github is "LICENSE".
sparr wrote:
thereaverofdarkness wrote:It would be neat if a water tank would create a non-polluting spill just for looks: a highly transparent dark spill that makes the ground look wet.
I think that will happen after I come up with a way to do more per-fluid things, like making other fluids safe, making gas clouds instead of liquid spills, making explosions, etc.
Well you could do it like this:

Code: Select all

FLUID_PROPERTIES = {
  "water": {
    type: "liquid",
    pollution: 0,
    volatility: 80
  },
  "petroleum-gas": {
    type: "explosive",
    pollution: 8,
    volatility: 100
  },
  "liquified-air": {
    type: "air",
    pollution: 0,
    volatility: 100
  },
  "heavy-oil": {
    type: "liquid",
    pollution: 8,
    volatility: 20
  }
}
Explanation:
type: How to deal with that liquid, create a cloud or spill, just explode...
pollution: An indicator how much pollution should be spawned for this (used during prototype creation)
volatility: How long it will last, smaller values => longer duration (duration = amount / volatility)

If you use this or a similar approach, then you can even add support for mod provided liquids without actually depend on them.
If you need more explanation/help, just ask.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Tue Jun 07, 2016 7:09 pm
by thereaverofdarkness
sparr wrote:making gas clouds instead of liquid spills, making explosions, etc.
And fire. In real life, a large oil spill does not explode, but burns for a long time. It can spread on top of water and continue to burn. While burning, it produces noxious fumes that rise up in a gigantic thick black cloud.

I see a lot of potential for danger and rapid polluting should you accidentally set fire to your oil spill.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Wed Jun 08, 2016 3:56 am
by sparr
bNarFProfCrazy wrote:Hi again, its me
Hi! Thanks for all the feedback.
bNarFProfCrazy wrote:EDIT: AFAICT, you can simply change:

Code: Select all

 if game.entity_prototypes and game.entity_prototypes[entity_name].corpses then
to

Code: Select all

 if game.entity_prototypes[entity_name] and game.entity_prototypes[entity_name].corpses then
to fix that issue.
I've got it fixed slightly differently now.
bNarFProfCrazy wrote:Another request:
Please add a link to your README file on github targetting this thread. Because it took me quite a while to find this thread again in the forums.
If the mod portal wasn't coming very soon then I'd do that. I'll link to the mod portal page for the mod as soon as it's up.
bNarFProfCrazy wrote:I also had a quick peek at your License file. It looks like you are using the MIT license, but it does not state it explicitly in the file.
Because of that I recommend you to copy paste the content of this page https://mit-license.org/ including the heading and the line-breaks to simplify things for everyone.
The license itself doesn't require that those lines be kept. I feel that it makes more sense to only put content in the license file that the license applies to itself.
bNarFProfCrazy wrote:Quick hint: The default name for license files on github is "LICENSE".
Interesting. Github's documentation says LICENSE.txt and LICENSE.md are appropriate. I'll caps it, but not drop the .txt
bNarFProfCrazy wrote:Well you could do it like this:
...

If you use this or a similar approach, then you can even add support for mod provided liquids without actually depend on them.
If you need more explanation/help, just ask.[/quote]
I don't want to hard-code details of so many fluids, especially for other mods. I might hard code the default fluids and publish a remote for other mods to provide info through. I might instead try to figure out some of the relevant stats algorithmically.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Wed Jun 08, 2016 6:16 am
by bNarFProfCrazy
sparr wrote:
bNarFProfCrazy wrote:I also had a quick peek at your License file. It looks like you are using the MIT license, but it does not state it explicitly in the file.
Because of that I recommend you to copy paste the content of this page https://mit-license.org/ including the heading and the line-breaks to simplify things for everyone.
The license itself doesn't require that those lines be kept. I feel that it makes more sense to only put content in the license file that the license applies to itself.
Puttimg a name in that file is mainly for easier understanding.
When you open that file you read MIT and you are done.
Otherwise you have to read and compare the entire license file just to be sure it is really MIT license.
sparr wrote:
bNarFProfCrazy wrote:Well you could do it like this:

...

If you use this or a similar approach, then you can even add support for mod provided liquids without actually depend on them.
If you need more explanation/help, just ask.
I don't want to hard-code details of so many fluids, especially for other mods. I might hard code the default fluids and publish a remote for other mods to provide info through. I might instead try to figure out some of the relevant stats algorithmically.
I think that will be very hard. Since some things are cobbled together out of thin air.
Do you habe a rough outline for your algorithm?

If harcoding is too much work for you, then the community and I could do it as well.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Wed Jun 08, 2016 7:16 am
by sparr
bNarFProfCrazy wrote:
sparr wrote:I don't want to hard-code details of so many fluids, especially for other mods. I might hard code the default fluids and publish a remote for other mods to provide info through. I might instead try to figure out some of the relevant stats algorithmically.
I think that will be very hard. Since some things are cobbled together out of thin air.
Do you habe a rough outline for your algorithm?
One idea I had was to walk up the recipe tree and see what's used to make a fluid. Things made from nothing or water would have no pollution value. Things made from stone would have low pollution value. Things made from iron or copper would have medium pollution value. Things made from oil would have high pollution value. Things made from oil plus another resource would have very high pollution value.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Wed Jun 08, 2016 9:43 am
by bNarFProfCrazy
sparr wrote:
bNarFProfCrazy wrote:
sparr wrote:I don't want to hard-code details of so many fluids, especially for other mods. I might hard code the default fluids and publish a remote for other mods to provide info through. I might instead try to figure out some of the relevant stats algorithmically.
I think that will be very hard. Since some things are cobbled together out of thin air.
Do you habe a rough outline for your algorithm?
One idea I had was to walk up the recipe tree and see what's used to make a fluid. Things made from nothing or water would have no pollution value. Things made from stone would have low pollution value. Things made from iron or copper would have medium pollution value. Things made from oil would have high pollution value. Things made from oil plus another resource would have very high pollution value.
The issue is with cyclic recipes or alternative sources of liquids see bergius mod and advanced oil processing for example.
Also plugins might add add resource patches like those for crude oil.
You would also have to deal with with the volatility und explosivity. Crude oil is not explosive, but petroleum gas is.

Re: [MOD 0.12.34] Wreckage Pollution

Posted: Mon Jun 20, 2016 1:32 am
by sporefreak
Still getting an error when I die in any way, (0.0.3)
Would it be possible to add a way to disable Corpse pollution? I personally don't like the idea :P (Biters, players, etc)

Re: [MOD 0.13.X] Wreckage Pollution

Posted: Wed Jun 29, 2016 1:33 am
by sparr
Updated for 0.13, and I can't reproduce the crash on death, maybe I fixed it already?

Re: [MOD 0.13.X] Wreckage Pollution

Posted: Sat Jul 09, 2016 5:16 pm
by Bizobinator
So, I quick question: Does this mod also cause pollution when you kill an alien? Something (aka one of my bajillion mods) is causing massive amounts of pollution with each alien killed.