[MOD 0.16.x] Delete Empty Chunks

Topics and discussion about specific mods
Post Reply
Strath
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Jan 01, 2018 1:05 pm
Contact:

[MOD 0.16.x] Delete Empty Chunks

Post by Strath »

Mod-Info-Header
  • Name: Delete Empty Chunks
  • Version: 0.3.1
  • Factorio-Version: 0.16.x
  • Description: Delete chunks which contain no player entities, configurable chunk radius & paving detection
  • License: MIT
  • Release: 2018-03-11
  • Download-Url: Download
  • Website: viewtopic.php?f=92&t=58658
  • Category: Helper Mod
Change Log
Before
After
Settings

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.16.x] Delete Empty Chunks

Post by steinio »

Perfect.

Thanks for adding RSO support.
Image

Transport Belt Repair Man

View unread Posts

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

Re: [MOD 0.16.x] Delete Empty Chunks

Post by orzelek »

Hmm what do you mean by RSO support?
Situation you are describing with "pinning" resource is not clear for me. I think it should not be happening so I would be interested in more information about whats happening.

Strath
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Jan 01, 2018 1:05 pm
Contact:

Re: [MOD 0.16.x] Delete Empty Chunks

Post by Strath »

Starting a new game, default settings, RSO 3.5.8 and DeleteEmptyChunks 0.3.1 (with lines commented out for demonstration)
ExchangeString
Map scanned to 320 tiles

Code: Select all

/c local radius=320  game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})
untouched.png
untouched.png (86.32 KiB) Viewed 6992 times
Deleted all chunks except the one the player is standing on with behavior of DeleteEmptyChunks 0.3.0.
Any previously explored areas are regenerated devoid of any resources
deleted.png
deleted.png (84.44 KiB) Viewed 6992 times
"Support" added for RSO in DeleteEmptyChunks 0.3.1

Code: Select all

	if game.active_mods["rso-mod"] then
		remote.call("RSO", "disableStartingArea")
		remote.call("RSO", "resetGeneration", surface)
	end
Now any chunk that was previously generated, then deleted will regenerate the resources that were present except the additional resources placed in the starting area.

If one calls "resetGeneration" by without having previously called "disableStartingArea" the starting area ends up looking like this
duplicate.png
duplicate.png (87.55 KiB) Viewed 6992 times
If one places something on part of a resource (in this case a stone furnace on the coal patch to the southwest) The identical resource regenerated shifted 1 chunks to the west.
pinned.png
pinned.png (86.38 KiB) Viewed 6992 times

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

Re: [MOD 0.16.x] Delete Empty Chunks

Post by orzelek »

You are using resetGeneration method that is not supposed to be called on already existing surface. It's been added for mods that switch to different surface that is created from scratch - thats why you are seeing everything doubled.

RSO doesn't support selective deletion of resources. Making RSO work properly when semi-random parts of map are removed and created again would be pretty difficult. There are to many variables to track when regenerating especially if some ore patches would be only partially deleted. You are seeing it already since duplicate patches are a result of collision and water avoidance algorithm that sees previous patch parts and tries to move new one to not place them on top of each other.

Please don't claim RSO support - there is none currently and for reasons mentioned above it might not be added.

Strath
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Jan 01, 2018 1:05 pm
Contact:

Re: [MOD 0.16.x] Delete Empty Chunks

Post by Strath »

orzelek wrote:RSO doesn't support selective deletion of resources.
I'm not asking you to support selective deletion of resources. I also did not claim that RSO supported my mod. I stated the fact that my mod supported RSO as well as can be and informed the users of the side effects of using this mod in conjunction with yours. Under most circumstances there are no side effects, One (losing the resources in the starting area) only happens if the chunks in the start area get deleted. Two (pinned duplication) only happens if only part of a resource gets deleted. This solution seems to be good enough as it solves the original problem of regenerated areas being completely devoid of resources.

You asked what I meant by 'pinning' and I believe that I more that adequately complied.

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

Re: [MOD 0.16.x] Delete Empty Chunks

Post by orzelek »

Strath wrote:
orzelek wrote:RSO doesn't support selective deletion of resources.
I'm not asking you to support selective deletion of resources. I also did not claim that RSO supported my mod. I stated the fact that my mod supported RSO as well as can be and informed the users of the side effects of using this mod in conjunction with yours. Under most circumstances there are no side effects, One (losing the resources in the starting area) only happens if the chunks in the start area get deleted. Two (pinned duplication) only happens if only part of a resource gets deleted. This solution seems to be good enough as it solves the original problem of regenerated areas being completely devoid of resources.

You asked what I meant by 'pinning' and I believe that I more that adequately complied.
You have only listed issues you know about now with your mod working with RSO. You don't know if there will be other issues and also your mod in this form allows someone to mine one ore field repeatedly without the need to expand - that contradicts base idea behind RSO.

You are stating that your mod works with RSO - and as I wrote you did use interface that is not meant for that. This doesn't make the mod work with RSO - it simply cheats a bit hoping all will be ok :)

Strath
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Jan 01, 2018 1:05 pm
Contact:

Re: [MOD 0.16.x] Delete Empty Chunks

Post by Strath »

orzelek wrote:
Strath wrote:
orzelek wrote:RSO doesn't support selective deletion of resources.
I'm not asking you to support selective deletion of resources. I also did not claim that RSO supported my mod. I stated the fact that my mod supported RSO as well as can be and informed the users of the side effects of using this mod in conjunction with yours. Under most circumstances there are no side effects, One (losing the resources in the starting area) only happens if the chunks in the start area get deleted. Two (pinned duplication) only happens if only part of a resource gets deleted. This solution seems to be good enough as it solves the original problem of regenerated areas being completely devoid of resources.

You asked what I meant by 'pinning' and I believe that I more that adequately complied.
You have only listed issues you know about now with your mod working with RSO. You don't know if there will be other issues and also your mod in this form allows someone to mine one ore field repeatedly without the need to expand - that contradicts base idea behind RSO.

You are stating that your mod works with RSO - and as I wrote you did use interface that is not meant for that. This doesn't make the mod work with RSO - it simply cheats a bit hoping all will be ok :)
I have never used RSO, I find vanilla resource generation sufficient. Though when users asked, I did download and evaluate what RSO does. I had expected a hard slog of deep mangling of data structures so I was pleasantly surprised to find a ready made API that did exactly what was needed, thank-you. Modding a game is about finding ways to make it function as one desires, taking what is available and using what one needs. There are many features to this game that the developers never intended and still they support the community and go out of their way to not break what is built around them. I never asked anything of you, users asked for help and I used what was available to provide an acceptable level of compatibility. You had expressed an interest in the interaction between our mods and I reported, in a detailed manner, the apparent effects. Your response of 'I don't like it, therefore don't" isn't very befitting a community that builds upon each others work. If something is found to be broken: it will be fixed, it will be mitigated, or it will have to be accepted, as everything in life. I have never presented this mod as a way to 'cheat', though it was an obvious use-case. How someone chooses to find enjoyment in playing a game is their own business. It is not my place nor yours to dictate otherwise.

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

Re: [MOD 0.16.x] Delete Empty Chunks

Post by orzelek »

Strath wrote:
orzelek wrote:
Strath wrote:
orzelek wrote:RSO doesn't support selective deletion of resources.
I'm not asking you to support selective deletion of resources. I also did not claim that RSO supported my mod. I stated the fact that my mod supported RSO as well as can be and informed the users of the side effects of using this mod in conjunction with yours. Under most circumstances there are no side effects, One (losing the resources in the starting area) only happens if the chunks in the start area get deleted. Two (pinned duplication) only happens if only part of a resource gets deleted. This solution seems to be good enough as it solves the original problem of regenerated areas being completely devoid of resources.

You asked what I meant by 'pinning' and I believe that I more that adequately complied.
You have only listed issues you know about now with your mod working with RSO. You don't know if there will be other issues and also your mod in this form allows someone to mine one ore field repeatedly without the need to expand - that contradicts base idea behind RSO.

You are stating that your mod works with RSO - and as I wrote you did use interface that is not meant for that. This doesn't make the mod work with RSO - it simply cheats a bit hoping all will be ok :)
I have never used RSO, I find vanilla resource generation sufficient. Though when users asked, I did download and evaluate what RSO does. I had expected a hard slog of deep mangling of data structures so I was pleasantly surprised to find a ready made API that did exactly what was needed, thank-you. Modding a game is about finding ways to make it function as one desires, taking what is available and using what one needs. There are many features to this game that the developers never intended and still they support the community and go out of their way to not break what is built around them. I never asked anything of you, users asked for help and I used what was available to provide an acceptable level of compatibility. You had expressed an interest in the interaction between our mods and I reported, in a detailed manner, the apparent effects. Your response of 'I don't like it, therefore don't" isn't very befitting a community that builds upon each others work. If something is found to be broken: it will be fixed, it will be mitigated, or it will have to be accepted, as everything in life. I have never presented this mod as a way to 'cheat', though it was an obvious use-case. How someone chooses to find enjoyment in playing a game is their own business. It is not my place nor yours to dictate otherwise.
I don't really mind that it semi-works. It just feels wrong for me since it's very quirky. And one thing I noticed is that often people don't read mods description. I placed stuff there and still had bug reports about things that were clearly stated in description that they can't work like lack of ores in preview.

Potential solution would be not deleting chunks with resources in them and not triggering the regeneration then. It could be a mod option or just permanently active if RSO is detected.

Alusares
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Jun 01, 2016 5:50 pm
Contact:

Re: [MOD 0.16.x] Delete Empty Chunks

Post by Alusares »

Here's some screenshots I took in researching how map generation / chunk deletion works in conjunction with the Whistlestop mod (https://mods.factorio.com/mod/WhistleStopFactories)

First, I generated a new map with default settings, and revealed the surrounding area with the following command:
/c local radius=1000 game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})

https://drive.google.com/open?id=1h4L7P ... xm6f0W5qhI

Next, I did a standard chunk deletion with your mod:

https://drive.google.com/open?id=1FEJFF ... lsVdkHCvjB

After seeing that the Whistlestop factories weren't deleted, I chose 4 nearby factories to destroy, highlighted with the green circles:

https://drive.google.com/open?id=1IJt4L ... id3nkOnhUb

I then ran another chunk deletion to clear those chunks, and another map reveal command to regenerate everything again to see any changes:

https://drive.google.com/open?id=1rJodZ ... m3eMMu3WV3

The 4 Whistlestop factories I destroyed did not regen with the rest of the map (green circles), but I did notice that there was a new factory in the top right corner. After seeing this, I opened the save file from when I first made the map, and then ran the map reveal command:

https://drive.google.com/open?id=1G14zg ... XNcAahBj0Y

This showed me that the Whistlestop factories generated in somewhat random locations, but were also largely all in the same areas if you compare the first image to the last one. In conclusion, it seems that Whistlestop does not respawn after a chunk deletion, but are somewhat randomly generated when a chunk is created for the first time. I hope this helps ^.^;;

Post Reply

Return to “Mods”