-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition / bad initialization order during game start vs chunk generation #2385
Comments
Happened again, or something very similar (shapes?), this time on starting an Island World from the PolyWorld module. Again appears like chunk generation started too early before everything had finished registering:
Rest of the world was fine but the initial dead chunks didn't come back even after making distance to let the area unload then coming back: After game restart the world loaded fine with the affected chunks regenerated and fully visible again. |
I encountered this once, too. I did not investigate further, but it's good to see this issue as a note. |
Hey, since I'll be out for days, note something here, hope it helpful for others who want to fix this bug. Here is the TimeLine before game began :
It seems that the blocks causing bug could only be in Problems :
|
Is that the same bug ? Encountered that in Heightmap world with the Sample module enabled. After that, game got stuck in the game loading interface(not crash, so no CR appeared). |
That does look pretty similar, yeah. Block registration still going after the crash. I missed the earlier comment but after the complexities of this situation have kept piling up I wonder if it is a fix better saved for when we expand the stages between the main menu and appearing in-game. Right now possibly too much stuff is happening at once - registration jumbled in with chunk generator threads. Part of GSOC item #2774 involves better segregating these stages so you'd probably have several UI steps like so:
That would completely avoid this issue if you thus get block registration out of the way before generating a single chunk plus improve the overall process IMHO. You could also engage options like pre-generating a far larger part of the world before dropping in the player, if for instance you have a slow server and don't want a ton of lag while moving around. However one * - I am unsure how our lazy assigning of block ids factor into this. Not every possible block combination gets an id right away, since with the amount of shapes we support that could overflow the block id even as a Maybe we need to involve better BlockFamilies as well, so you might prepare all possible Blocks by name but not give out ids to every possible shape combo until needed. |
This just happened as I was trying to test in a Heightmap world with the Sample module enabled, so nothing particularly unusual. The chunk I started in and a bunch around me failed to generate as a chunk generator thread died. Based on logs it appears like chunk gen started before all blocks were registered? Might specifically be an OakTrunk from a tree attempting to generate. That seems sort of odd and prone to problems if something in or near the starting chunk needs a block that hasn't finished registering yet.
Log snippet:
Screenie:
Edit: Linking to PR #2074 as I figure this might end up relating to how we go from the main menu to in-game (fully load and register things as part of the preview/configure stage?)
The text was updated successfully, but these errors were encountered: