Property request: force.pollution_production_statistics
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Property request: force.pollution_production_statistics
It would be nice if functions were added to the Lua modding API so that modders could create a mod that allows for true ecological game play.
The basic concept is to provide LUA functions that allow a mod to create an evolution model where evolution is caused only by pollution that does not get scrubbed from the air before it reaches the enemy.
Then the mod could enable the creation of pollution scrubbing mechanisms like mechanical scrubbers and planting trees... so that a player that makes an effort to go fully green could literally stop alien evolution and maybe even stop aggressiveness simply by building in an eco-friendly way.
I am sure that is more needed, but these would be an absolute minimum set of new eco functions:
EDIT: Apparently several of these already exist although their names are so cryptic that I confess not understanding which ones do what. This list below explains it in "English", not by function name.
- Allow controlling/disabling evolution due to time.
(apparently already exists as function)
- Allow controlling/disabling evolution due to total pollution produced.
(apparently already exists as a function)
- Allow controlling/enabling evolution due to pollution reaching a nest.
(THIS might be the only piece missing - the ability to measure the pollution reaching a nest because the cloud touched it - and to cause evolution due to it)
- Allow the creation of pollution scrubbing entities (already possible).
- Allow the creation of non-polluting entities (already possible).
NOTE:
- I am NOT a LUA programmer nor do I foresee becoming one. My hope is that someone will someday create a mod that allows "true ecological gameplay" in Factorio... but to do that they need to have the basic API calls to enable creating the mod.
- So I tried to identify the functional behaviors needed (in plain English) in order to enable the creation of such a mod. As a pleasant surprise (see the discussion below) it turns out that almost all of the API functions needed already exist, you just have to know which is which and Qon kindly identified them in terms that a LUA programmer (not me) can understand
The basic concept is to provide LUA functions that allow a mod to create an evolution model where evolution is caused only by pollution that does not get scrubbed from the air before it reaches the enemy.
Then the mod could enable the creation of pollution scrubbing mechanisms like mechanical scrubbers and planting trees... so that a player that makes an effort to go fully green could literally stop alien evolution and maybe even stop aggressiveness simply by building in an eco-friendly way.
I am sure that is more needed, but these would be an absolute minimum set of new eco functions:
EDIT: Apparently several of these already exist although their names are so cryptic that I confess not understanding which ones do what. This list below explains it in "English", not by function name.
- Allow controlling/disabling evolution due to time.
(apparently already exists as function)
- Allow controlling/disabling evolution due to total pollution produced.
(apparently already exists as a function)
- Allow controlling/enabling evolution due to pollution reaching a nest.
(THIS might be the only piece missing - the ability to measure the pollution reaching a nest because the cloud touched it - and to cause evolution due to it)
- Allow the creation of pollution scrubbing entities (already possible).
- Allow the creation of non-polluting entities (already possible).
NOTE:
- I am NOT a LUA programmer nor do I foresee becoming one. My hope is that someone will someday create a mod that allows "true ecological gameplay" in Factorio... but to do that they need to have the basic API calls to enable creating the mod.
- So I tried to identify the functional behaviors needed (in plain English) in order to enable the creation of such a mod. As a pleasant surprise (see the discussion below) it turns out that almost all of the API functions needed already exist, you just have to know which is which and Qon kindly identified them in terms that a LUA programmer (not me) can understand
Last edited by zOldBulldog on Mon May 13, 2019 10:50 am, edited 2 times in total.
Re: Friday Facts #294 - Blog thoughts & Lua documentation improvements
You could make a thread in viewforum.php?f=28zOldBulldog wrote: ↑Mon May 13, 2019 9:06 am It would be nice if functions were added to the Lua modding API so that modders could create a mod that allows for true ecological game play.
Title it: "Property request: force.pollution_production_statistics"
_____________________________________________________zOldBulldog in the future wrote: LuaForce has these:But the production view also has a pollution tab. Expose it to modders as pollution_production_statistics, please?Code: Select all
item_production_statistics :: LuaFlowStatistics [Read-only] fluid_production_statistics :: LuaFlowStatistics [Read-only] kill_count_statistics :: LuaFlowStatistics [Read-only] entity_build_count_statistics :: LuaFlowStatistics [Read-only]
It would make requested mods like evolution influenced by pollution absorbed by nests possible.
I just told you these are available in the map settings. And they are readable and writable by mods too.zOldBulldog wrote: ↑Mon May 13, 2019 9:06 am - Allow controlling/disabling evolution due to time.
- Allow controlling/disabling evolution due to total pollution produced.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Re: Friday Facts #294 - Blog thoughts & Lua documentation improvements
Qon wrote: ↑Mon May 13, 2019 9:45 amYou could make a thread in viewforum.php?f=28zOldBulldog wrote: ↑Mon May 13, 2019 9:06 am It would be nice if functions were added to the Lua modding API so that modders could create a mod that allows for true ecological game play.
Title it: "Property request: force.pollution_production_statistics"_____________________________________________________zOldBulldog in the future wrote: LuaForce has these:But the production view also has a pollution tab. Expose it to modders as pollution_production_statistics, please?Code: Select all
item_production_statistics :: LuaFlowStatistics [Read-only] fluid_production_statistics :: LuaFlowStatistics [Read-only] kill_count_statistics :: LuaFlowStatistics [Read-only] entity_build_count_statistics :: LuaFlowStatistics [Read-only]
It would make requested mods like evolution influenced by pollution absorbed by nests possible.
I just told you these are available in the map settings. And they are readable and writable by mods too.zOldBulldog wrote: ↑Mon May 13, 2019 9:06 am - Allow controlling/disabling evolution due to time.
- Allow controlling/disabling evolution due to total pollution produced.
Sorry if I did not understand you in the other post when you said these two functions are already available. I thought you were saying exactly the opposite. That is why I posted here once I noticed they had made a thread for the LUA functions. But an actual subforum for Lua requests is even better.
So, to do what I describe, is the only function still missing the one to enable/control evolution based on unscrubbed pollution that *reaches* a nest? (since you can already disable Evo through time and "generally produced")
And with this confusion I suspect I just demonstrated how bad/confusing are the Lua function names and importance of docunentation. Even with you pointing to these Lua methods their names are cryptic and different enough from the behaviors I describe that I still struggle to decipher which does what and how. Good thing that they are working to improve documentation.
Re: Friday Facts #294 - Blog thoughts & Lua documentation improvements
Yes, because it will allow the devs that actually implement the requests to see the request instead of someone unrelated to mod interface requestszOldBulldog wrote: ↑Mon May 13, 2019 10:14 am Sorry if I did not understand you in the other post when you said these two functions are already available. I thought you were saying exactly the opposite. That is why I posted here once I noticed they had made a thread for the LUA functions. But an actual subforum for Lua requests is even better.
Yes. Or technically, it is the function that allows you to read pollution absorbed by nests that is the only thing missing. Setting the evolution factor is already possible and linking them together would be possible for a mod once they can read the necessary data.zOldBulldog wrote: ↑Mon May 13, 2019 10:14 am So, to do what I describe, is the only function still missing the one to enable/control evolution based on unscrubbed pollution that *reaches* a nest? (since you can already disable Evo through time and "generally produced")
But I already wrote a technically correct and easily understandable (for the mod interface devs) suggestion title and post that you can just copy and paste to request the correct thing.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Re: Friday Facts #294 - Blog thoughts & Lua documentation improvements
Ty, I will copy paste into that forum as soon as I get to my computer (hard to do on a phone )Qon wrote: ↑Mon May 13, 2019 10:23 amYes, because it will allow the devs that actually implement the requests to see the request instead of someone unrelated to mod interface requestszOldBulldog wrote: ↑Mon May 13, 2019 10:14 am Sorry if I did not understand you in the other post when you said these two functions are already available. I thought you were saying exactly the opposite. That is why I posted here once I noticed they had made a thread for the LUA functions. But an actual subforum for Lua requests is even better.
Yes. Or technically, it is the function that allows you to read pollution absorbed by nests that is the only thing missing. Setting the evolution factor is already possible and linking them together would be possible for a mod once they can read the necessary data.zOldBulldog wrote: ↑Mon May 13, 2019 10:14 am So, to do what I describe, is the only function still missing the one to enable/control evolution based on unscrubbed pollution that *reaches* a nest? (since you can already disable Evo through time and "generally produced")
But I already wrote a technically correct and easily understandable (for the mod interface devs) suggestion title and post that you can just copy and paste to request the correct thing.
Re: Property request: force.pollution_production_statistics
I split your posts off from the FFF thread to make things a bit easier and copied the title from the "title it" quote in one of the posts.
Your posts are a bit confusing, what exactly is still missing? Is it what I put in the title? Because that already exists: https://lua-api.factorio.com/latest/Lua ... statistics
Your posts are a bit confusing, what exactly is still missing? Is it what I put in the title? Because that already exists: https://lua-api.factorio.com/latest/Lua ... statistics
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Re: Property request: force.pollution_production_statistics
Thank you Bilka. Yes, I realize there is much confusion, mostly from my lack of understanding of the various LUA functions that exist and what they do.Bilka wrote: ↑Mon May 13, 2019 10:28 am I split your posts off from the FFF thread to make things a bit easier and copied the title from the "title it" quote in one of the posts.
Your posts are a bit confusing, what exactly is still missing? Is it what I put in the title? Because that already exists: https://lua-api.factorio.com/latest/Lua ... statistics
Even after Qon listed them... I am still having trouble seeing how functions by the names he listed relate to the behaviors I described. But that is OK, I am not the one that needs to understand it, it is the devs and mod developers that need to understand how to translate the behaviors I describe to function calls.
I edited the original post to try to make things clearer, although I am not certain I understand the existing functions well enough so I might have still failed to be 100% clear.
I *think* that based on what you all said, the only piece missing for 100% ecological gameplay might be the ability to measure pollution (cloud) that reaches a nest - unscrubbed - and based on it to create evolution.
Re: Property request: force.pollution_production_statistics
Okay, that is solved with the pollution statistics access in LuaGameScript. You can read the pollution consumption by biter nests from it which is exactly what you describe. I will move this thread to "already exists" for now, but please do let me know if something requested here does not exist.zOldBulldog wrote: (THIS might be the only piece missing - the ability to measure the pollution reaching a nest because the cloud touched it - and to cause evolution due to it)
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Re: Property request: force.pollution_production_statistics
Excellent. If all the pieces exist then I am going to make a post in the Mod Requests/Ideas subforum, giving this thread as a reference for the details as to how to achieve it.Bilka wrote: ↑Mon May 13, 2019 11:02 amOkay, that is solved with the pollution statistics access in LuaGameScript. You can read the pollution consumption by biter nests from it which is exactly what you describe. I will move this thread to "already exists" for now, but please do let me know if something requested here does not exist.zOldBulldog wrote: (THIS might be the only piece missing - the ability to measure the pollution reaching a nest because the cloud touched it - and to cause evolution due to it)
Re: Property request: force.pollution_production_statistics
I had assumed it would be in force. But the game doesn't differentiate between my pollution and pollution from other forces I guess. That makes sense. I searched LuaSurface and some other places for that pollution stat but couldn't find it. Apparently I missed searching LuaGameScript, doh!Bilka wrote: ↑Mon May 13, 2019 10:28 am I split your posts off from the FFF thread to make things a bit easier and copied the title from the "title it" quote in one of the posts.
Your posts are a bit confusing, what exactly is still missing? Is it what I put in the title? Because that already exists: https://lua-api.factorio.com/latest/Lua ... statistics
Yes, everything needed exists.zOldBulldog wrote: ↑Mon May 13, 2019 11:04 am Excellent. If all the pieces exist then I am going to make a post in the Mod Requests/Ideas subforum, giving this thread as a reference for the details as to how to achieve it.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Re: Property request: force.pollution_production_statistics
The mod request has been created in the (I hope) correct forum: viewtopic.php?f=88&t=70786
Re: Property request: force.pollution_production_statistics
disabling parts of evolution in control.lua:
Must be here
LuaGameScript.html#LuaGameScript.map_settings
Concepts.html#MapSettings
but it was not added
Code: Select all
game.map_settings.enemy_evolution.time_factor = 0
game.map_settings.enemy_evolution.destroy_factor = 0
game.map_settings.enemy_evolution.pollution_factor = 0
LuaGameScript.html#LuaGameScript.map_settings
Concepts.html#MapSettings
but it was not added
Re: Property request: force.pollution_production_statistics
What? You can disable the different parts of evo, your code is just broken if the above doesn't work. Please dont post unrelated stuff in this topic.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Property request: force.pollution_production_statistics
Sorry.
The main question of the topic was "(how to) Allow controlling/enabling evolution due to pollution reaching a nest." Is it somewhere documented? I cannot find any information about it, please help.
Re: Property request: force.pollution_production_statistics
That's basically asking to program a mod. Luckily for you there is a mod that does that already: https://mods.factorio.com/mod/NextGenEvolution
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Property request: force.pollution_production_statistics
Nice mod, he is just overwrite evolution factor every minute.Bilka wrote: ↑Wed Jun 12, 2019 12:28 pmThat's basically asking to program a mod. Luckily for you there is a mod that does that already: https://mods.factorio.com/mod/NextGenEvolution
For example by the data stage I have this definition:
Code: Select all
data.raw["map-settings"]["map-settings"].enemy_evolution =
{
enabled = true,
time_factor = 0,
destroy_factor = 0,
pollution_factor = 0
}
2. Where on the lua-api.factorio.com/latest/ I can find information about it?