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

8 months ago
0.16 - 1.1
1.92K

i [Fixed 0.8.1] - Bug? Or forgot to limit water areas?

3 years ago

For 5 hours straight, I've been getting an annoying message about the game still scanning the water area with lag for ages. At first, I had it scanning 1000 at a time, figuring once it reaches "ocean" level, it would stop scanning and just mark it as an infinite water area. But it didn't.... So I turned it down a little. Then a little more... Then a little more... Because playing for 3 hours with lag spikes was annoying. 5 hours of total gameplay, with at least 1 at 1000 scan, 2 at 200 scan, and the last 2 at 50 scan.... And the water area never, ever finished scanning. I'm playing on island mode right now, and figured I'd test the mod to see what it does with an infinite water size but its so far, never stopped.

Please add some sort of maximum limit in here, in the settings too. I suggest some percentage above the max water body's size that generates the "ocean" status. I attempted to look in the file for some sort of max, but I didn't see one. I did see that oceans are "600,000", so lets see... I must have scanned 3.6 million tiles within the first hour. 4.5 million tiles total. So please. For the love of god, set some sort of max here! 1 million would be fine. I could go back and set the tiles per second back to 1000.

I'm only annoyed because that bleep thing every 20 seconds for FIVE HOURS. It was very, very vexing. Now I can't stop hearing it and I closed the game 15 minutes ago. I wish to strangle the developer who chose that sound for every single thing that comes through in the chat.

3 years ago

Hello Vas,

Thanks for letting me know.

Be interesting if you enable the debug option in the mod settings to tell you the remaining tiles to scan, wonder how large that number will be.

Any ways, ive added a player setting so that you can define your maximum area, default is 2M tiles, Min is 600K and Max is 9.99B

Be in the next version.

As a side note, isnt there an option to turn down chat notifaction sounds?

3 years ago

Well I'd like chat notifications, I just wish the chat was different from console. I can't stand that some idiot thought it'd be a great idea to make chat the console key. I keep hitting enter and typing to try and talk to people in game. I had a friend say that the game chat is so bad its easier to alt tab and type out of game.

3 years ago

It seems to be stuck on some kind of infinite loop. I moved the pump earlier so now its doing two scans and never aborted the original scan.

I can't find anything inside the log file to indicate whats going on either. I may remove the mod, load the map, then add the mod back in again to reset this and test again.

3 years ago

So, I set debug mode on, and told it to scan 10,000 per second.

Debug is showing; 5481, 5528, 5590, 5649, 5704, 5763, 5817, 5872, 5927, 5974, 6033, 6088, Still Scanning FluidArea 1, 6135, 6194, 6234, 6280, 6343, 6390, 6449

That doesn't look like 10,000 tiles per second. :P Thats somewhere around 50ish.

Perhaps you can enable a visual debug mode that helps see on the map the area thats been scanned.

I just changed it to 20,000 tiles per second, takes 14 seconds to process, scanned 77 tiles. xD This is gonna take a very long time to diagnose if I can't increase the speed. I have an i9 running at 4.7GHz, this should take no time at all to scan 2 million tiles but it appears to be extremely slow. Earlier the infinite loop may have been some sort of very big number glitch, or the fact that I moved the pump while it was still calculating.

I lowered the speed to 1,000 tiles per second, and it takes 1 second to process. However the numbers the debug mode displays have shrunk so bad now that its just repeating the same number 3-4 times each time. I don't know if there's something wrong in the mod or the debug process or what. So I may go ahead and save and exit now since it seems to be going no where and wait for further instruction on debugging this.

Shame I can't attach images directly here.

3 years ago

Hey Vas,

So that queue, number is actually the number of edge tiles to scan. If you do the /WaterAreas command you'll see the number of shallow and deep tiles ticking up, thats what that additional tiles per second relates to.

I just ran 2 island maps, and I completed the scanning using 20K tiles per second in around 5 minutes.

They also got to around 125K and 169K total tiles respectfully.

Have you got the seed number or a save I could try?

The new version will have a limit on it, will just need to play around with that figure till im happy.

3 years ago

I've got a ton of mods active in my save so it'd be hard to give a seed number for that. I'll use the command and see what happens.

For debug purposes, think you can enable something more detailed for output?
"Edge Tiles: #, Tiles Scanned: #, Water Area % tiles: #" in one line like this example;
"Edge Tiles: 5481, Tiles Scanned: 20,000, Water Area 1 tiles: 120,000"

I mean, if someone's using the debug mode, clearly it wouldn't matter in screen spam. :P

So when loading a save with two active pumps and fluid area tiles per second set to 1000; (Results abbreviated)
ID1: Water Amount: 2,993,469, Shallow 1,089 / Deep 12,019
ID2: Water Amount: 2,939,060, Shallow 1,445 / Deep 11,644
1488
1113
ID1: Water Amount: 3,053,940, Shallow 1,089 / Deep 12,271
ID2: Water Amount: 2,997,580, Shallow 1,459 / Deep 11,882
1488
1125
ID1: Water Amount: 3,011,152, Shallow 1,108 / Deep 12,503
ID2: Water Amount: 3,055,320, Shallow 1,482 / Deep 12,113

(Slowed the game to 0.15 speed while I tested running the command every time those numbers came up)
Running it at 30,000 now, may increase speed. Gonna wait a bit and see what its at.
My specs if you're curious about the resources I have to scan with; https://valid.x86.fr/scg14b

While that goes on... Another idea for scanning statuses, with those that enable the "still scanning" notification, perhaps it should say what amount of tiles has been scanned so far with that still scanning status giving an idea as to progress. Remember to include the separators for the numbers to make it easier to read. "1,000,000 is easier to read than 1000000 after all. :P

I wonder if its possible to abort one of those scans. I know I can't simply pick up the pump to stop the scan.. Oh well, too late I guess.

20 minutes of scanning: (Since last ID line)
ID1: Water Amount: 115,543,375, Shallow 41,315 / Deep 367,930
ID2: Water Amount: 115,326,500, Shallow 42,820 / Deep 366,580

I'm scanning at max, 50,000 tiles per second, taking a good minute between scans, now both areas are around 760,000 total tiles so far (shallow/deep).

I give up scanning now. 2 hours of scanning time total. 1 hour at 50k tiles per second.

ID1: Water Amount: 430,680,990, Shallow 96,101 / Deep 1,156,294
ID2: Water Amount: 431,004,870, Shallow 94,377 / Deep 1,157,912

Total scan time of 10 minutes game time. 10 minutes of game time taking 2 hours to process. :P I wish this could be multi-threaded. Its not even maxing out one single thread though.

Curious about some lines in your control file however. Line 590-628
Particularly Puddle, Well, and Pond.
I think everything I've ever had scanned was qualifies as a pond, even a 2x2 size square of water (4 tiles).
Puddle is 3 tiles or less. Well is exactly 4 tiles. Pond is 5 tiles to 200 tiles based on this, right?

Perhaps it'd be more interesting to name puddles as 5 tiles or less, wells as 6 to 10 tiles, and then ponds as 11 to 200 tiles. It'd make it more likely that you get those unique names at least. :P

One more thought I had, is it possible to have your pumps scan for extra puddles not directly connected to the water area its connected to, within a certain radius? Say for example you have a pond of 32 tiles of water, with 7 small 4 tile sized puddles all around it within a short range of the pump you placed down, and you would like to drain all of those together without having to place a pump on each and every single one of them. Might be an interesting setting for a future update, that I can bring up in another topic later if you want. I'm very tired though, ended up staying up longer than I anticipated typing up information and testing things. :P

3 years ago

Hey Vas,

So the changes to the Mod work, so those 600K mim limit will stop the scanning.

I've also made a commnad /StopScan which will do that for any scans in progress, if you get bored with waiting for an area to scan, though this will mean a few functions wont fire, though I'll see If I can ammend that before releasing.

Adding the Thousands/Millions seperator is actually a bit of a task, as you need to convert the variable to a string, then count the numbers and insert a comma every 3. I'll maybe look into adding that at some point.

Initially on fluidarea setup the areas are named as a pond, only upon complete scan does the area get its designation. Though I may play around with the size now that its based on a tile m2 rather then total count, i'll think about it.

Sounds like an idea for a water tower or something, so has a set radius and just drinks all the water it finds within it. An interesting idea, not something i'll be able to look into at the moment though.

New response