[0.17.79] Crash on force chunk generation request

Bugs that are actually features.
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

[0.17.79] Crash on force chunk generation request

Post by orzelek »

While trying to make sure that chunks are generated when placing ores in RSO I managed to crash the game.
I was expecting it might not work (generating chunk requests and calling force_generate_chunk_requests from handler of chunk generated event) but did not expect it to die to desktop.
Relevant log part:
log
Attachments
factorio-current.log
(34.79 KiB) Downloaded 80 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 16098
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.79] Crash on force chunk generation request

Post by Rseding91 »

Thanks for the report. What you've done is simply unsupported and the only sane way to handle it is to terminate the game. So, don't do that :P
If you want to get ahold of me I'm almost always on Discord.
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.79] Crash on force chunk generation request

Post by orzelek »

Rseding91 wrote: Thu Dec 19, 2019 1:12 am Thanks for the report. What you've done is simply unsupported and the only sane way to handle it is to terminate the game. So, don't do that :P
I'm guessing it will survive if chunk requests are from chunk generated event and force generate would get scheduled for next tick?
Rseding91
Factorio Staff
Factorio Staff
Posts: 16098
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.79] Crash on force chunk generation request

Post by Rseding91 »

The issue is requesting new chunks in the chunk generated event. It's a run-away system because "force all the queued chunksto generate" generates more, which then get forced, which generates more and so on forever.

So instead, the game detects it's happening and says "no, goodbye"
If you want to get ahold of me I'm almost always on Discord.
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.79] Crash on force chunk generation request

Post by orzelek »

Rseding91 wrote: Thu Dec 19, 2019 8:52 pm The issue is requesting new chunks in the chunk generated event. It's a run-away system because "force all the queued chunksto generate" generates more, which then get forced, which generates more and so on forever.

So instead, the game detects it's happening and says "no, goodbye"
This problem is one of reasons I'm not inclined to try and implement it over multiple ticks in mod. I don't see a good way to prevent the runaway on mod side.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5414
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.79] Crash on force chunk generation request

Post by Klonan »

orzelek wrote: Fri Dec 20, 2019 5:02 pm
Rseding91 wrote: Thu Dec 19, 2019 8:52 pm The issue is requesting new chunks in the chunk generated event. It's a run-away system because "force all the queued chunksto generate" generates more, which then get forced, which generates more and so on forever.

So instead, the game detects it's happening and says "no, goodbye"
This problem is one of reasons I'm not inclined to try and implement it over multiple ticks in mod. I don't see a good way to prevent the runaway on mod side.
The PvP scenario calls force_generate_chunk_requests on tick, and it works just fine

What are you trying to do?
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.79] Crash on force chunk generation request

Post by orzelek »

Klonan wrote: Fri Dec 20, 2019 5:08 pm
orzelek wrote: Fri Dec 20, 2019 5:02 pm
Rseding91 wrote: Thu Dec 19, 2019 8:52 pm The issue is requesting new chunks in the chunk generated event. It's a run-away system because "force all the queued chunksto generate" generates more, which then get forced, which generates more and so on forever.

So instead, the game detects it's happening and says "no, goodbye"
This problem is one of reasons I'm not inclined to try and implement it over multiple ticks in mod. I don't see a good way to prevent the runaway on mod side.
The PvP scenario calls force_generate_chunk_requests on tick, and it works just fine

What are you trying to do?
I've noticed some time ago that RSO cheats a bit in chunk generated events.
Ore generation is triggered in one chunk but can spawn in surrounding chunks too. This seems to work in most cases but there are some rare situations where part of patch won't spawn or tree removal will fail since it tries to remove trees before game spawned them (thats what I managed to figure out from debug I think).

Since I do whole patch generation in memory I wanted to make sure all the chunks are spawned first then check where ore should go and spawn it plus remove the trees as needed.

I know that proper way would be schedule this over many ticks but thats a lot of data to store in global over those ticks and it might get tricky to manage so one tick solution would be better. I think simplest thinkg would be to send chunk generation requests from generate chunk then in next on tick call the force generate and spawn the ore patch.
Post Reply

Return to “Not a bug”