small fixes, changelog and readme

This commit is contained in:
Joey De Pauw 2019-10-08 20:41:57 +02:00
parent f1c680ab81
commit 79621f1b83
5 changed files with 56 additions and 10 deletions

View File

@ -1,2 +1,40 @@
# Factorio-Better-Air-Filtering
A mod for Factorio that provides complex air filtering steps to remove pollution.
# Better Air Filtering
#### A mod for Factorio that provides complex air filtering steps to remove pollution.
## Overview
![overview]()
This mod features three tiers of air filtering machines. These machines remove pollution from the air in their region by using air filters. Each consecutive tier has a larger radius and stronger filtering effect. Keep in mind that you will still need filters spread around your base at strategic locations to effectively counteract the spread of pollution.
#### Air filter machine 1
You start with a basic passive air filter machine that cleans the air in its own [chunk](https://wiki.factorio.com/Map_structure#Chunk). It should help keep biter attacks at bay through the early game.
#### Air filter machine 2
The upgraded version has a stronger filtering effect. In addition, by using a moderate amount of electricity this machine is able to pull in pollution from neighboring chunks in the shape of a diamond. This version has a radius of two chunks (in [manhattan distance](https://en.wikipedia.org/wiki/Taxicab_geometry)). Note that a continuous amount of energy is consumed for this suction effect in addition to the cost of filtering the air.
![range_mark_2](res/radius_mk2.png)
#### Air filter machine 3
The third and final upgrade of the air filtering machine features a larger radius of three chunks along with more air filtering per second.
#### Filter Types
There are currently two types of filters: __expendable filters__ and __recyclable filters__. The first ones are easier to craft, but filter out less pollution and are destroyed upon use. __Recyclable filters__ are more expensive but can be refreshed with a bit of coal to be used again.
## Technical Details
Some things to keep in mind when using this mod:
- The [evolution](https://wiki.factorio.com/Enemies#Evolution) factor of enemies is based on the total amount of produced pollution. Cleaning it back up does not reverse this effect. This means that biters will still get stronger, no matter how proficient you are at cleaning pollution. You can prevent attacks caused by pollution reaching the biter nests however.
- Pollution from other chunks is sucked toward air filters at an exponentially decreasing rate depending on the distance. The formula is `suction = base_suction * (1/4)^distance`. This means that filters only pull in approximately as much pollution as they can filter.
## Changes
Refer to the Factorio mod page for the complete [changelog](https://mods.factorio.com/mod/better-air-filtering/changelog).
## Future Features
- A third and more efficient air filtering production chain based on first "dissolving" pollution in water and then treating it in chemical plants.
## Bugs / Crashes / Suggestions
> Important! This mod is in it's early stages of development and has not yet been extensively tested and balanced.
If you experience issues, please notify me on the [forum](https://mods.factorio.com/mod/better-air-filtering/discussion). Suggestions for future releases are also welcome.

View File

@ -0,0 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.1.0
Date: 2019.10.08
Info:
- Initial release
Locale:
- Only English
License:
- Using MIT License.

View File

@ -50,7 +50,7 @@ function getBasePurificationRate(entity)
if entity.name == "air-filter-machine-1" then
return 2 * INTERVAL / 60 -- max pollution cleaning per second among mk1 recipes
elseif entity.name == "air-filter-machine-2" or entity.name == "air-filter-machine-3" then
return 6 * INTERVAL / 60 -- max pollution cleaning for mk2 and mk3 recipes (liquid)
return 4 * INTERVAL / 60 -- max pollution cleaning for mk2 and mk3 recipes TODO: change if fluid filtering is implemented
else
return 0
end
@ -314,7 +314,7 @@ function FilteredChunk:equal(other)
end
function FilteredChunk:addToMap()
game.print("Adding chunk to map")
--game.print("Adding chunk to map")
local chunkListX = global.air_filtered_chunks_map[self.surface.name] or {}
local chunkListY = chunkListX[self.x] or {}
assert(chunkListY[y] == nil, "Chunklist entry should not exist yet.")
@ -325,12 +325,12 @@ function FilteredChunk:addToMap()
end
function FilteredChunk:removeFromMap()
game.print("Removing chunk from map")
--game.print("Removing chunk from map")
table.remove(global.air_filtered_chunks_map[self.surface.name][self.x], self.y)
for i, c in pairs(air_filtered_chunks) do
if self:equal(c) then
table.remove(air_filtered_chunks, i)
game.print("Removing chunk from list")
--game.print("Removing chunk from list")
break
end
end
@ -454,7 +454,7 @@ function onEntityRemoved(event)
--end
if pollution > 0 then
game.print("Dispersing " .. pollution .. " pollution back")
--game.print("Dispersing " .. pollution .. " pollution back")
event.entity.surface.pollute(event.entity.position, pollution)
end
end
@ -469,7 +469,6 @@ function preEntityRemoved(event)
if recipe ~= nil then
for _, ingredient in pairs(recipe.ingredients) do
game.print("Ingredient: " .. ingredient.name)
if ingredient.name == "pollution" then
pollution = pollution + ingredient.amount
elseif ingredient.name == "polluted-water" then
@ -479,7 +478,7 @@ function preEntityRemoved(event)
end
if pollution > 0 then
game.print("Dispersing " .. pollution .. " pollution back")
--game.print("Dispersing " .. pollution .. " pollution back")
event.entity.surface.pollute(event.entity.position, pollution)
end
end

View File

@ -21,7 +21,7 @@ data:extend({
}
},
unit = {
count = 100,
count = 50,
ingredients = {
{ "automation-science-pack", 1 },
{ "logistic-science-pack", 1 }

BIN
res/radius_mk2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 MiB