[MOD 0.12.x] Finite Water
-
- Inserter
- Posts: 46
- Joined: Tue Mar 29, 2016 10:31 am
- Contact:
Re: [MOD 0.12.x] Finite Water
there are calls to 'math.random' in the mod (ex : water_drain.lua). This can't work in multiplayer.
Re: [MOD 0.12.x] Finite Water
Those actually work properly in multiplayer - they use map random gen which is same for all the peers.ritonlajoie wrote:there are calls to 'math.random' in the mod (ex : water_drain.lua). This can't work in multiplayer.
Re: [MOD 0.12.x] Finite Water
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.
Re: [MOD 0.12.x] Finite Water
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.
I would love to be able to play with friends with this, Although I haven't even tried.
Re: [MOD 0.12.x] Finite Water
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.
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!
Want some blueprints made by me? Click here then!
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: [MOD 0.12.x] Finite Water
^ I came here to say this, but Vas already said it for me.
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.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.
Re: [MOD 0.12.x] Finite Water
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.
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.
Re: [MOD 0.12.x] Finite Water
That is all known issues. But there is no active programmer for this mod.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.
Re: [MOD 0.12.x] Finite Water
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.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.
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?
-
- Burner Inserter
- Posts: 14
- Joined: Tue Mar 17, 2015 7:41 pm
- Contact:
Re: [MOD 0.12.x] Finite Water
Any chance to update ?
-
- Fast Inserter
- Posts: 136
- Joined: Wed Dec 23, 2015 1:17 pm
- Contact:
Re: [MOD 0.12.x] Finite Water
+1Any chance to update ?
English is not my native language. Translator.
Re: [MOD 0.12.x] Finite Water
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.
Re: [MOD 0.12.x] Finite Water
Probably just add "factorio_version": "0.13", to the info.json. That's why most mods broke in version 13.Factorio2016 wrote:+1Any chance to update ?
-
- Burner Inserter
- Posts: 14
- Joined: Tue Mar 17, 2015 7:41 pm
- Contact:
Re: [MOD 0.12.x] Finite Water
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"
{
"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"
Re: [MOD 0.12.x] Finite Water
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.
{
"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.
-
- Burner Inserter
- Posts: 14
- Joined: Tue Mar 17, 2015 7:41 pm
- Contact:
Re: [MOD 0.12.x] Finite Water
Add this line to file, start the game, try generate a new world and have this
Re: [MOD 0.12.x] Finite Water
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.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: [MOD 0.12.x] Finite Water
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.
Re: [MOD 0.12.x] Finite Water
I might take a crack at making a better version of this at some point.
-
- Burner Inserter
- Posts: 14
- Joined: Tue Mar 17, 2015 7:41 pm
- Contact:
Re: [MOD 0.12.x] Finite Water
any chance ?