Water As A Resource


Turns Water into a non infinite resource. Water bodies get removed and replaced by solid ground. Offshore Drains allow water & oil to be put back into these depleted areas. 0.8.0 - 1.1 Factorio Compatibility, Multiplayer Multiple Forces Update, Krastorio2 Support, Reworked MapMarkers

1 year, 4 months ago
0.16 - 1.1
2.13K

g [Fixed 0.8.1] infinite water scan. (8.0, i also made an easy fix.)

3 years ago
(updated 3 years ago)

just pointing out i see a few 8.1 in the titles but i do not see it up. back in Factorio 0.16.51 this mod had the same problem... i see you put a quick fix for ctg and sea block but forgot to implement the fix for the actual mod...
Example:

if game.active_mods["SeaBlock"] or game.active_mods["ctg"] then
TotalArea = global.WaterGlobalArea[a]["ShallowWater"] + global.WaterGlobalArea[a]["DeepWater"]
if TotalArea > 60000 then
WASearchQueue = {}
end
end

you need this under:

TotalArea = global.WaterGlobalArea[a]["ShallowWater"] + global.WaterGlobalArea[a]["DeepWater"]
if TotalArea > 600000 then
WASearchQueue = {}
end

so it stops at Ocean Level. (the scan will continue for ever as long as the "WASearchQueue" not equal "nil." )

second bug i encounter is the pumps are draining water endlessly even when the tanks are full, even if i plug one pipe connected to nothing. (maybe if they are connected for too long; or between save and loads?)

i also encounter odd bugs when placing certain entities from Bio Industries(the wood growing mod) i think it happens when multi entity types are placed (the treaformer has a factory, turret, radar in one entity.) i get the same error in mods doing a similar thing. it does not crash the game but says it is a irrecoverable error. (not game breaking from what i can tell.)

anyhow this post might be a garbled mess, i don't know if this is a type of site that gets annoying with formatting.

3 years ago

Hello EpicSlayer7666,

Thanks for reporting.

For the Next version I have put int a user configurable upper limit on the WaterAreas, so this it already fixed.

Regarding placing entites, I've just made a big change to how my mod is detecting entity creation for another mod, so hopefully it'll be fixed for this, but ill download BioInd and give it a play around see what occurs.

Infinite pumping i assume you mean (taking water out an area) can occur for the first 5 minutes in a save the mod has been added too, as a bit of a grace period for the player to panic sort out a water supply. After this, there shouldnt be problems with it. SOme one will every now and then report this, but i never seem able to recreate it or see it happen, if you have got a save with this in, then please share it so I can take a look.

Thanks.

3 years ago

for the water pumping i mean, when the tank is full, the pump continues to drain water from the area even if the tank is full. so if i take off a pipe connected to it, it stops but if i take only one piece of pipe and put it on but have no tank to fill or any system, just one single pipe 1x1 tile pipe, it pumps water in but does not stop putting water in even tho the pipe is full. so it says "100 water" but the lake continues to drain and the pumps is pumping, just that the water disappears like an invisible infinite tank was plugged on or a "void pipe". (in other words it kind of deletes the water.)

also 4 things about uploading a save, 1, i have 95 mods, 2, for a lot, i modified the dependencies since they were not updated, 3, i also modified some values in some mods like scanning radar for example, i modified the power dump values since i only play single player and 4, i have since deleted the save.

but that bug is something that occurs if you pump water from 2 or 3 sources for a long time then save and load... looks like when the tanks don't drain as much later on, the draining is the same... i also use "pumps" at the exit of each water pumps, the entrances of each tanks and the exit of each tanks and the entrances of each devices and the exits of each devices. (so every drops enters and leaves tanks and devices.)

3 years ago

Hello EpicSlayer7666,

So the long and short of it, is that is how the mod is designed and works. Its the only way to be able to track which offshore pumps are active. The Devs in there infinite wisdom decided that Offshore Pumps are Always ON, Always Working and flow rate goes to 0 when then connecting entities fluidbox equals 100%. Essentially meaning I have no way to ask, is it on, is it active or is it pumping? I've have to use the fluid statistics and a ton of calculations and logic checks to even get the mod working.

So the mod presumes that if you connect anything to a pump, that it is active and pumping, providing some fluid for the fluid statistics. The mods logic and math works out which areas and how many pumps, to its assigns the correct % to each area. But the Mod is making a best guess, as you say if you don't connect anything up afterwards, you are throwing away water.

I've asked and been ignored by the devs in trying to get offshore pumps changed to provide me with something to use, so the only other way to do this, would be to code a new entity from scratch where i can make my own statuses and readings. This is not something trivial and beyond the work of the mod at the moment. It would be one of the final long standing goals, but would require significant work to do and is something I don't have the time to do.

When you play with this mod, just come with the understanding that, if you put a pipe connection onto the pump, the mod considers it active, if you don't want that or are not ready, then leave that pipe/storage-tank/pump until the last one to connect.

As for your second point, the calculations and maths should be ok, but I may just need to check what pumps fluidbox buffer is as I may need to write in some code for that. Pipes and Storage-Tanks are calculated from a Vanilla perspective.

3 years ago
(updated 3 years ago)

Ok just checked with using a pump as an output to a offshore pump and a drain all seems to be working ok.

3 years ago

well i think you might not have to code a "new" entity to make it work. just copy the normal fluid pumps, call it a water output so you can use it's pump speed as the number of units per second to deduct.

so each water areas has water pumps, they need to be connected to those special pumps and only accept water as a fluid (fluid filter) this way you can track how much water do deduct from the water area from each connected pumps.

if you can't read pump speed, then make it turn on and off so it empty it's fluid and refill to keep track.

just an idea, as far as coding goes, i can only copy/past existing code and change values... so i have no idea what internal values you actually have access to keep track of the water demand.

also 8.3 worked flawlessly for me, but this bug naturally was still there. also did not try to remove water areas after depletion since it was bugged in 8.0 (crashed the game.) i might need to retry this option if it is now fixed.

3 years ago
(updated 3 years ago)

Just a heads up this still seems to be an issue with 0.8.4. I have a huge body of water next to my base and so far the script for detecting water zones has been running for the better part of 20 minutes with no end in sight. Currently my 'lake' is well over 155 MILLION liters and still growing. Also i set what seems to be the smallest maximum water body size of 600000. I would suggest adding an option to set a timer for that script to run so it will stop searching and finalize the water body after a set amount of time if its taking too long otherwise.

3 years ago

well just in case, " 600000" is the number of "tiles" and the "155 MILLION liters" is the amount they form... so by the looks of it, you might be near the end of the search... it usually takes about 20 minutes for me as well using 4096 tiles in the search number. (takes about 1 sec between search for 5 minutes then slows to about 10 secs over time... too bad there is not a "special" search for an ocean where it traces the island then try going out in 4 directions like 600-800 tiles guesstimating... like how 800*800=640000 tiles...)

3 years ago

Hey The_event_horizon and EpicSlayer7666,

So in this regard, I'm also not happy with the speed of the scanning. In its current form the Mod at default run through 1000 tiles per second, 600K should take around 10 minutes, in pure maths, though it may indeed take longer. If you use /WaterAreas you can see a count of the number of tiles so you can get an idea on how much further it has to go.

There used to be an old version of the mod, where it was unbounded, but as you can imagine, this lead to Factorio locking up at 0 FPS for periods, which isn't very good for a mod todo, so I had to put some limit into the mod. The setting can go as high as 50K tiles per second, but expect to have almost 0 FPS when you do this.

I do intend, to implement chunk scanning, so the mod will highlight an entire chunk, and if its purely water, mark as scanned, pick the adjacent chunks and scan those, when it encounters land, it'd goto tile scanning. This should offer up some performance improvements on massive water areas, as long as all the tiles are withing the chunk. I made some early progress on this a few months back, but have been busy with life and bug fixes to get back to that. Though with the number of reported bugs dropping, I intend to get back onto the chunk scanning implementation soon.

New response