[MOD 0.12.x] Finite Water

Topics and discussion about specific mods
ritonlajoie
Inserter
Inserter
Posts: 46
Joined: Tue Mar 29, 2016 10:31 am
Contact:

Re: [MOD 0.12.x] Finite Water

Post by ritonlajoie »

there are calls to 'math.random' in the mod (ex : water_drain.lua). This can't work in multiplayer.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.12.x] Finite Water

Post by orzelek »

ritonlajoie wrote:there are calls to 'math.random' in the mod (ex : water_drain.lua). This can't work in multiplayer.
Those actually work properly in multiplayer - they use map random gen which is same for all the peers.

ljdp
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Wed Jul 01, 2015 12:33 am
Contact:

Re: [MOD 0.12.x] Finite Water

Post by ljdp »

This mod has been on the back-burner for a while and probably will be for a lot longer. This problem is really best solved at the C/C++ level rather then lua. There are a few misconceptions going around though. Yes a factorio dev stated that the mod API has not been tested with co-routines and so they are not supported, this is the main reason I rewrote homeworld to remove all co-routines. However co-routines are not threads, they do not run code simultaneously, they're just a fancy way doing flow control in code. Also the constant ALL_CAP variables would not be causing desyncs, there are ..constant, they never change (unless you change them manually), most likely the co-routines are causing the desyncs as it may be undeterministic on the C-boundary.

thebacon
Inserter
Inserter
Posts: 21
Joined: Mon Feb 29, 2016 6:04 am
Contact:

Re: [MOD 0.12.x] Finite Water

Post by thebacon »

Just figured I should chime in and mention that this is my favorite mod, has to be combined with water drill (or some such water generation) if you play with water only in start area. Because every oil processing takes too much water.

I would love to be able to play with friends with this, Although I haven't even tried.

Vas
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Apr 12, 2016 11:02 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Vas »

I had an idea thanks to some people in the IRC, but when you fix this for multiplayer, you can add a replenish rate for water based on its size.

For example:
50 water per tile
It gains 0.1 per second for a single tile.

Use scaling math for it, an exponential curve, so when you have 100 water tiles, you've got a gain of say something like 25 water per second. If you are draining only 20 water per second, that would make that water infinite. However if you are draining 30 per second, you'll lose 5 water per second until a tile runs out, and you do the math again to assess how much water is gained from the new one.

Alternatively, you calculate how many cells there are, do all the same math, but when removing water you calculate how many tiles would make 10% rounded to the nearest tile, say we use 100 water tiles again, making 10% be 10 tiles, makes 500 water before you drain anything. This means you drain 10 "random" tiles of water along the edges as soon as this value hits zero. Allowing you to have the script run a more advanced check on what tiles to remove so it doesn't create water puddles like it currently does.

One more thing you can do, is use clouds to determine what water gets restored to its maximum values. I'm not entirely sure how you currently handle water, so if you were to total up all the water in the lake from all connected water blocks, and drain water the same way I mentioned above with that 10% method, you could handle clouds better, I assume.

I'd also like you to calculate deep water as triple the water.
Green water should be 60% the normal water, as it appears to be swamp water which has lots of other things in it, and is thicker so its actually less water than it looks like.

I likely have further ideas, but not at the moment.
You can get my mods by clicking here, and use discussions there or PMs here to suggest or report issues.
Want some blueprints made by me? Click here then!

User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: [MOD 0.12.x] Finite Water

Post by thereaverofdarkness »

^ I came here to say this, but Vas already said it for me.
Vas wrote:This means you drain 10 "random" tiles of water along the edges as soon as this value hits zero. Allowing you to have the script run a more advanced check on what tiles to remove so it doesn't create water puddles like it currently does.
I think it's good that it leaves puddles behind. When you find out that your water has run out, you can tap into those puddles to buy you some time while you search for a new lake.

Pagan_PL
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed May 18, 2016 12:57 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Pagan_PL »

Greetings!

First off - This is great mod in my opinion. But I have serious issues and performance drops because of Finite water. Let me explain. First issue appears sometimes when I am trying to remove pump from dry land - game crashes. Unfortunalely there is nothing I can send and show here. Second, most disturbing: Game is laggy. It happends when one of the pump completly drain water from tile where it was placed and when that pump is on gras tile - it is impossible to place pump on the ground normally. Now, when I am far far away from my base and lags starts to occur I know that one of the pump drains water from tile and it is on the dry ground.

Woehler
Inserter
Inserter
Posts: 25
Joined: Wed Nov 11, 2015 8:47 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Woehler »

Pagan_PL wrote:Greetings!

First off - This is great mod in my opinion. But I have serious issues and performance drops because of Finite water. Let me explain. First issue appears sometimes when I am trying to remove pump from dry land - game crashes. Unfortunalely there is nothing I can send and show here. Second, most disturbing: Game is laggy. It happends when one of the pump completly drain water from tile where it was placed and when that pump is on gras tile - it is impossible to place pump on the ground normally. Now, when I am far far away from my base and lags starts to occur I know that one of the pump drains water from tile and it is on the dry ground.
That is all known issues. But there is no active programmer for this mod.

patmo98
Inserter
Inserter
Posts: 27
Joined: Sat Mar 21, 2015 10:59 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by patmo98 »

Pagan_PL wrote:Greetings!

First off - This is great mod in my opinion. But I have serious issues and performance drops because of Finite water. Let me explain. First issue appears sometimes when I am trying to remove pump from dry land - game crashes. Unfortunalely there is nothing I can send and show here. Second, most disturbing: Game is laggy. It happends when one of the pump completly drain water from tile where it was placed and when that pump is on gras tile - it is impossible to place pump on the ground normally. Now, when I am far far away from my base and lags starts to occur I know that one of the pump drains water from tile and it is on the dry ground.
I've been thinking about fixing what I can on this mod, and porting it to 0.13. I'm having trouble understanding what you're saying though.

Are you saying that the pump will remove all of the water, including the water under the pump, and that once the pump is not sitting on water, the game will lag?

patrykbono20
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 17, 2015 7:41 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by patrykbono20 »

Any chance to update ?

Factorio2016
Fast Inserter
Fast Inserter
Posts: 136
Joined: Wed Dec 23, 2015 1:17 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Factorio2016 »

Any chance to update ?
+1
English is not my native language. Translator.

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Afforess »

For the love of all things holy, please don't update this mod. It is dangerous, will crash your game in spectacular ways, and should not be used or installed by anyone.

Woehler
Inserter
Inserter
Posts: 25
Joined: Wed Nov 11, 2015 8:47 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Woehler »

Factorio2016 wrote:
Any chance to update ?
+1
Probably just add "factorio_version": "0.13", to the info.json. That's why most mods broke in version 13.

patrykbono20
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 17, 2015 7:41 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by patrykbono20 »

this is from json file:


{
"name": "finitewater",
"version": "1.0.2",
"title": "Finite Water",
"author": "Luke Perkin",
"contact": "",
"www": "www.locogame.co.uk",
"description": "Offshore pumps slowly drain lakes until they are removed entirely.",
"dependencies": ["base >= 0.12.11"]
}

Where I must paste this: "factorio_version": "0.13"

Woehler
Inserter
Inserter
Posts: 25
Joined: Wed Nov 11, 2015 8:47 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Woehler »

Doesn't matter.

{
"name": "finitewater",
"version": "1.0.2",
"title": "Finite Water",
"author": "Luke Perkin",
"contact": "",
"www": "www.locogame.co.uk",
"description": "Offshore pumps slowly drain lakes until they are removed entirely.",
"dependencies": ["base >= 0.12.11"]",
"factorio_version": "0.13"
}

something like that.

patrykbono20
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 17, 2015 7:41 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by patrykbono20 »

factorio blad.png
factorio blad.png (435.34 KiB) Viewed 7867 times
Add this line to file, start the game, try generate a new world and have this :)

Woehler
Inserter
Inserter
Posts: 25
Joined: Wed Nov 11, 2015 8:47 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Woehler »

Yeah. The mod is broken and needs to be remade. I'm only a script kiddie and have no idea how what kind of task it would take to remake this mod although I would like having this mod.

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by aubergine18 »

It would be great if the drained area was filled with sand or dirt rather than fresh grass land. Also, if there was a way for lakes to refill should there be deep water nearby.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.12.x] Finite Water

Post by Nexela »

I might take a crack at making a better version of this at some point.

patrykbono20
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Mar 17, 2015 7:41 pm
Contact:

Re: [MOD 0.12.x] Finite Water

Post by patrykbono20 »

any chance ?

Post Reply

Return to “Mods”