[MOD 0.12.x] Finite Water

Mods that are directly focused on adding, removing or changing a game-concept to the vanilla game.
You need to rebuilt many things if you remove the mod, but it is still possible to remove it, without completely destroying the game.

[MOD 0.12.x] Finite Water

Postby ljdp » Tue Aug 04, 2015 3:46 pm

Name: Finite Water
Description: Offshore pumps slowly drain lakes until they are removed entirely.
Licence: MIT
Version: 1.0.0
Last Release: 2015-08-04
Tested With Factorio: 0.12.1
Dependencies: Factorio 0.12.x
Tags: Enhancement, Water, Lakes, Finite
Download Link: https://github.com/perky/factorio-finitewater/releases
Updated download by db48x.

This mod adds functionality for finite water. Offshore pumps will slowly drain lakes, causing them to shrink until they disappear entirely. The more pumps at a single lake, the faster it's drained. Huge oceans aren't affected and are still infinite sources of water.

See a GIF of Finite Water in action. (Sped up for demonstration purposes)

If you want to change how fast the water is drained, perhaps to show it off in a spotlight, then in water_drain.lua you can change line 11: "local WATER_PER_TILE". Setting that to something small like 1 or 0.5 will cause lakes to drain really fast.
Last edited by ljdp on Mon Apr 25, 2016 10:06 pm, edited 3 times in total.
ljdp
Long Handed Inserter
Long Handed Inserter
 
Posts: 95
Joined: Wed Jul 01, 2015 12:33 am

Re: [0.12.x] Finite Water

Postby Dawnzy » Tue Aug 04, 2015 6:03 pm

Looks interesting, could be quite nice for a hardcore playthrough :)
Dawnzy
Manual Inserter
Manual Inserter
 
Posts: 3
Joined: Tue Aug 04, 2015 6:02 pm

Re: [0.12.x] Finite Water

Postby Darloth » Tue Aug 04, 2015 8:06 pm

If it's possible to add a new ground texture, then a sandy ground texture that has almost no border with water, but a strongly defined border with grass/sand/other, would make it look like you're leaving a lake-bed behind.

I'm not sure it actually is possible to add new ground textures like this (they'd be a new biome, I assume, and I don't know how the graphics for in between biomes / terrain works) but it's a nice idea.

Regardless, good stuff, thanks!
Darloth
Fast Inserter
Fast Inserter
 
Posts: 113
Joined: Sun Jun 08, 2014 3:57 pm

Re: [0.12.x] Finite Water

Postby ares0027 » Thu Aug 06, 2015 12:16 am

awesome one. but i was guessing maybe add some ore generation to it? (i have no idea if it is possible) but i dont know some stones, or if we are lucky other ores "generate" occasionally from water?
ares0027
Long Handed Inserter
Long Handed Inserter
 
Posts: 75
Joined: Sun May 04, 2014 6:48 pm

Re: [0.12.x] Finite Water

Postby db48x » Thu Aug 06, 2015 9:42 am

This is working well so far, but there's a bug that must be fixed before it'll run. The data.lua script loads prototypes/items.lua, but the file is actually called entities.lua. The easiest fix is to extract the contents of the zip file, then navigate into the prototypes directory and rename entities.lua to items.lua. Then go back and delete the zip file (Factorio won't start if it detects duplicate mods).

I can't say for sure how the balance is; this map I'm using has quite a large number of medium-sized ponds so I doubt I'll ever run out. It does work though. Our power generation is pumping from one of the smaller ponds in the starting area and it's gotten smaller as we played. It's slow enough that you have to pay close attention to notice it. I expect that this small pond will last through the mid-game before we must pump from somewhere else.
User avatar
db48x
Long Handed Inserter
Long Handed Inserter
 
Posts: 84
Joined: Wed Mar 13, 2013 12:15 pm

Re: [0.12.x] Finite Water

Postby ljdp » Thu Aug 06, 2015 3:17 pm

db48x wrote:This is working well so far, but there's a bug that must be fixed before it'll run. The data.lua script loads prototypes/items.lua, but the file is actually called entities.lua. The easiest fix is to extract the contents of the zip file, then navigate into the prototypes directory and rename entities.lua to items.lua. Then go back and delete the zip file (Factorio won't start if it detects duplicate mods).

I can't say for sure how the balance is; this map I'm using has quite a large number of medium-sized ponds so I doubt I'll ever run out. It does work though. Our power generation is pumping from one of the smaller ponds in the starting area and it's gotten smaller as we played. It's slow enough that you have to pay close attention to notice it. I expect that this small pond will last through the mid-game before we must pump from somewhere else.


Thanks, i've re-uploaded a fixed version.

So far I'm happy with the balance in my current play-through. 2 hours in and I had a blackout and I was thinking "there's loads of coal left", completely forgot about my own mod! Rather than moving all my boilers I created a huge pipeline to another lake, which I thought looked pretty cool, there are some really long pipelines here on earth. I am interested to hear how it spans out in other people's maps.
ljdp
Long Handed Inserter
Long Handed Inserter
 
Posts: 95
Joined: Wed Jul 01, 2015 12:33 am

Re: [0.12.x] Finite Water

Postby Airat9000 » Fri Aug 07, 2015 7:17 am

ljdp wrote:
db48x wrote:This is working well so far, but there's a bug that must be fixed before it'll run. The data.lua script loads prototypes/items.lua, but the file is actually called entities.lua. The easiest fix is to extract the contents of the zip file, then navigate into the prototypes directory and rename entities.lua to items.lua. Then go back and delete the zip file (Factorio won't start if it detects duplicate mods).

I can't say for sure how the balance is; this map I'm using has quite a large number of medium-sized ponds so I doubt I'll ever run out. It does work though. Our power generation is pumping from one of the smaller ponds in the starting area and it's gotten smaller as we played. It's slow enough that you have to pay close attention to notice it. I expect that this small pond will last through the mid-game before we must pump from somewhere else.


Thanks, i've re-uploaded a fixed version.

So far I'm happy with the balance in my current play-through. 2 hours in and I had a blackout and I was thinking "there's loads of coal left", completely forgot about my own mod! Rather than moving all my boilers I created a huge pipeline to another lake, which I thought looked pretty cool, there are some really long pipelines here on earth. I am interested to hear how it spans out in other people's maps.


the author, it would be good to do all the same ends oceans.
Airat9000
Smart Inserter
Smart Inserter
 
Posts: 1189
Joined: Fri Mar 28, 2014 12:32 am
Location: Russia-Kazan city

Re: [0.12.x] Finite Water

Postby orzelek » Fri Aug 07, 2015 5:14 pm

I think you might need to mark this mod as single player only.

My lua knowledge is a bit limited but I was curious to see how you implemented the water removal and took a peek - this mod is threaded which might mean desyncs in multiplayer.
orzelek
Smart Inserter
Smart Inserter
 
Posts: 2735
Joined: Fri Apr 03, 2015 10:20 am

Re: [0.12.x] Finite Water

Postby ljdp » Fri Aug 07, 2015 5:16 pm

orzelek wrote:I think you might need to mark this mod as single player only.

My lua knowledge is a bit limited but I was curious to see how you implemented the water removal and took a peek - this mod is threaded which might mean desyncs in multiplayer.


The mod uses coroutines but that isn't to be confused with threads. Coroutines are still deterministic. (But I haven't tested this with multiplayer yet).
ljdp
Long Handed Inserter
Long Handed Inserter
 
Posts: 95
Joined: Wed Jul 01, 2015 12:33 am

Re: [0.12.x] Finite Water

Postby adalah217 » Mon Aug 10, 2015 3:59 pm

Awesome mod. Perfect for an added challenge to a world with "very low" resources, and forces me to use trains to transport water from far.

I seem to be getting weird behavior though. At the beginning of the game, I drained a small pond fairly quickly with ~5 steam engines and a few boilers. I set up a new intake, and eventually it started going down too. But it just kinda stopped. Water across the map is staying infinite, across all the ponds. I double checked to make sure I had the mod installed of course. Maybe some weird behavior with bob's mod? Maybe the larger pond is acting like an ocean? Or maybe I haven't observed long enough to watch the water drain. Either way, I tried draining the water into about 10 fluid tanks and nothing happened. Just wanted to drop by and mention it :) Bob's mods are the only other thing installed.
adalah217
Burner Inserter
Burner Inserter
 
Posts: 5
Joined: Sun Aug 09, 2015 5:34 am

Re: [0.12.x] Finite Water

Postby Degraine » Wed Aug 12, 2015 3:59 am

Now all we need is a weather mod to add rain that refills the lakes.

It looks like it has a maximum range it will draw from, similar to how Red Power's drain + pump worked in Minecraft (which is probably the only sane way to do it, really). Have you thought about an option for sufficiently large bodies of water to be inexhaustible?
Degraine
Filter Inserter
Filter Inserter
 
Posts: 257
Joined: Wed Aug 13, 2014 10:49 am

Re: [0.12.x] Finite Water

Postby TheSAguy » Wed Aug 12, 2015 4:13 pm

Degraine wrote:Now all we need is a weather mod to add rain that refills the lakes.

It looks like it has a maximum range it will draw from, similar to how Red Power's drain + pump worked in Minecraft (which is probably the only sane way to do it, really). Have you thought about an option for sufficiently large bodies of water to be inexhaustible?


Great mod idea, going to give it a try when I have the time!

To add to the above note from Degraine, I think that small bodies of water should drain faster than larger bodies. Since larger bodies should be deeper and get more input that smaller bodies of water.
So very large bodies will take a very long, close to infinite to drain.
TheSAguy
Smart Inserter
Smart Inserter
 
Posts: 1000
Joined: Mon Jan 13, 2014 6:17 pm

Re: [0.12.x] Finite Water

Postby reddutton » Wed Aug 19, 2015 11:32 pm

TheSAguy wrote:
Degraine wrote:Now all we need is a weather mod to add rain that refills the lakes.

It looks like it has a maximum range it will draw from, similar to how Red Power's drain + pump worked in Minecraft (which is probably the only sane way to do it, really). Have you thought about an option for sufficiently large bodies of water to be inexhaustible?


Great mod idea, going to give it a try when I have the time!

To add to the above note from Degraine, I think that small bodies of water should drain faster than larger bodies. Since larger bodies should be deeper and get more input that smaller bodies of water.
So very large bodies will take a very long, close to infinite to drain.


this would be a nice feature even if there are tiers of pumps for the range they can pump
thy may be stupid but thy am smart (reddutton 2006 seconlife)
reddutton
Long Handed Inserter
Long Handed Inserter
 
Posts: 54
Joined: Sun Jul 19, 2015 12:35 am

Re: [0.12.x] Finite Water

Postby Afforess » Thu Aug 20, 2015 9:52 pm

FYI, I have noticed this mod tends to cause unpredictable and non-reproducible freezes (In the console it reports that a linked-list has been corrupted in the game engine). This is not a normal factorio crash where you get logs, it is a very terse error message, and the game stays up, but no longer accepts input. I am on Linux, but I suspect this issue occurs on all platforms. I am suspect this is due to the use of coroutines, and that the game engine does not support asynchronus access to the lua API. I think it would be worthwhile to either a thread-safe lua API from the game devs, or rewrite this mod to not use coroutines.

The issue tends to occur when a lake or body of water nears becoming completely drained, although I have rarely had it occur in otherwise normal gameplay.

Just a word of caution to users, if your game freezes/crashes, try uninstalling this mod.
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 417
Joined: Tue May 05, 2015 6:07 pm

Re: [0.12.x] Finite Water

Postby TheSAguy » Sat Aug 22, 2015 10:02 pm

Afforess wrote:FYI, I have noticed this mod tends to cause unpredictable and non-reproducible freezes (In the console it reports that a linked-list has been corrupted in the game engine). This is not a normal factorio crash where you get logs, it is a very terse error message, and the game stays up, but no longer accepts input. I am on Linux, but I suspect this issue occurs on all platforms. I am suspect this is due to the use of coroutines, and that the game engine does not support asynchronus access to the lua API. I think it would be worthwhile to either a thread-safe lua API from the game devs, or rewrite this mod to not use coroutines.

The issue tends to occur when a lake or body of water nears becoming completely drained, although I have rarely had it occur in otherwise normal gameplay.

Just a word of caution to users, if your game freezes/crashes, try uninstalling this mod.


I've had this happen a few times with me. I think the freeze occurs when you empty a body of water, while laying new pipe.
I've opened a crash report: http://www.factorioforums.com/forum/viewtopic.php?f=7&t=15144

Still love the mod!
TheSAguy
Smart Inserter
Smart Inserter
 
Posts: 1000
Joined: Mon Jan 13, 2014 6:17 pm

Re: [0.12.x] Finite Water

Postby Afforess » Sun Aug 23, 2015 9:42 pm

TheSAguy wrote:
Afforess wrote:FYI, I have noticed this mod tends to cause unpredictable and non-reproducible freezes (In the console it reports that a linked-list has been corrupted in the game engine). This is not a normal factorio crash where you get logs, it is a very terse error message, and the game stays up, but no longer accepts input. I am on Linux, but I suspect this issue occurs on all platforms. I am suspect this is due to the use of coroutines, and that the game engine does not support asynchronus access to the lua API. I think it would be worthwhile to either a thread-safe lua API from the game devs, or rewrite this mod to not use coroutines.

The issue tends to occur when a lake or body of water nears becoming completely drained, although I have rarely had it occur in otherwise normal gameplay.

Just a word of caution to users, if your game freezes/crashes, try uninstalling this mod.


I've had this happen a few times with me. I think the freeze occurs when you empty a body of water, while laying new pipe.
I've opened a crash report: http://www.factorioforums.com/forum/viewtopic.php?f=7&t=15144

Still love the mod!


My crash doesn't look like yours. I intentionally started using a script that captures the stdout/stderr for factorio so I could catch the exact message next time. Here is an example of my log, and the only error msg I see:

*** Error in `/home/afforess/Downloads/factorio/bin/x64/factorio': corrupted double-linked list (not small): 0x00007fb7c4030a00 ***
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 417
Joined: Tue May 05, 2015 6:07 pm

Re: [MOD 0.12.x] Finite Water

Postby ljdp » Fri Aug 28, 2015 7:21 pm

Interesting, not had that error.
I doubt it is because of coroutines, coroutines are not like threads, they are synchronous. But I would like to hear from the devs if they cause any other side-effects.
ljdp
Long Handed Inserter
Long Handed Inserter
 
Posts: 95
Joined: Wed Jul 01, 2015 12:33 am

Re: [MOD 0.12.x] Finite Water

Postby orzelek » Fri Aug 28, 2015 8:08 pm

ljdp wrote:Interesting, not had that error.
I doubt it is because of coroutines, coroutines are not like threads, they are synchronous. But I would like to hear from the devs if they cause any other side-effects.


Devs already said that coroutines are not tested so might cause unexpected behavior.
Take a look here:
Suspicious bug thread
orzelek
Smart Inserter
Smart Inserter
 
Posts: 2735
Joined: Fri Apr 03, 2015 10:20 am

Re: [MOD 0.12.x] Finite Water

Postby db48x » Fri Oct 23, 2015 5:59 pm

I've updated the mod for 0.12.11 and put the code into a fork of the github repository at https://github.com/db48x/factorio-finitewater.

Initial testing looks good, though I cannot be entirely sure I haven't broken anything.
Attachments
finitewater_1.0.1.zip
My modified version of the Finite Water which supports Factorio 0.12.11.
(87.22 KiB) Downloaded 166 times
User avatar
db48x
Long Handed Inserter
Long Handed Inserter
 
Posts: 84
Joined: Wed Mar 13, 2013 12:15 pm

Re: [MOD 0.12.x] Finite Water

Postby Darkestnoir » Fri Oct 23, 2015 7:17 pm

Code: Select all
Error while running the event handler: __finitewater__/water_drain.lua:52: attempt to index field 'water_drain' (a nil value)


Can't start a new game with 12.13.
User avatar
Darkestnoir
Inserter
Inserter
 
Posts: 24
Joined: Sun Nov 23, 2014 8:57 pm
Location: Germany

Next

Return to Gameplay / Vanilla+

Who is online

Users browsing this forum: No registered users and 1 guest