Chunk corruption causes?

If you're having problems with your installation of Better Than Wolves, or if you've woken up in the future and are beginning to doubt the nature of reality, here's the place to post about it.
Post Reply
User avatar
SterlingRed
Posts: 1466
Joined: Tue Jul 05, 2011 11:02 am

Chunk corruption causes?

Post by SterlingRed »

Hey guys, I'm hoping some of you with the technical knowledge on mc game saves can help me out. I just had an interesting problem. After traveling to my village via nether I discovered two chunks in the middle of the village had been corrupted. One chunk was reset completely, and the other appeared to be an odd mix of what I'd built plus a reset. Like half the church from one chunk was spawned inside the library in the neighboring chunk. The reset library spawned on top of the original one.
The end result is I lost all my priests and librarians as well as an auto pottery machine.

My harddrive is an SSD, so I don't suspect bad sectors and an integrity check of the drive comes out just fine. Ive been saving and exiting the game correctly and have had only 2 power failures causing my laptop to sleep while playing this save, but the game was paused when I resumed.

I have no backup. How do I prevent this in the future? This is the only corruption I've experienced that I couldn't link directly to a power failure or some kind of crash.
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Chunk corruption causes?

Post by Gilberreke »

Sometimes vanilla does hickup and do that. It might not be clear what the reason is.
SterlingRed wrote:I have no backup. How do I prevent this in the future?
Make backups.

In all seriousness, there's a plethora of tools that will backup your save files occasionally. An automated system is always better in case of backups as you WILL forget 10 minutes before the next corruption.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
ElectroBot
Posts: 57
Joined: Mon May 13, 2013 11:55 am
Location: ElectroBot#1327 on Discord

Re: Chunk corruption causes?

Post by ElectroBot »

You could use something like http://mineback.kvkconsultancy.co.uk/Mi ... neBack.asp. It has a very simple interface and very basic features (how often to backup and how many hours of backups to keep). I haven't had to restore a live game with it yet (but did test before hand and it does work well).

I've seen corruption in the past on vanilla (only once, but not sure what caused it), on bukkit/modded servers (one was too much modded "stuff" in a chunk probably [this was sometime during the 1.4-1.6 days when multi-block had major chunk issues so tried to have everything one chunk], others we never could determine what caused them [both were in heavily trafficked areas]).

You could try a RAM test (doubtful that this is the case, but is a possibility).

Other than frequent backups (at least every 30 min) and making sure you save and close the world before computer sleep/shutdown/etc., not having too many entities in an area (doubtful that you have a mob grinder nearby), I don't think there is anything that can really be done.
User avatar
SterlingRed
Posts: 1466
Joined: Tue Jul 05, 2011 11:02 am

Re: Chunk corruption causes?

Post by SterlingRed »

Thanks for info on it being unpreventable. I'll set something up for backups.
Ozziie
Posts: 128
Joined: Tue Sep 11, 2012 2:41 am

Re: Chunk corruption causes?

Post by Ozziie »

I just had the exact same issue. Odd that the ground underneath looks as though it has survived but the building and villagers haven't :(

Lost a couple of Farmers, a priest that was finally offering my next route of progression, a librarian and a blacksmith :/
Pictures
Show
Image

Image
Luckily I do have a backup from earlier today, I'll post a picture later of how it looked before.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

Ozziie wrote:Luckily I do have a backup from earlier today, I'll post a picture later of how it looked before.
Please keep me informed as to whether it happens again after restoring the backup. This is making me nervous that I may have screwed something up in recent releases, although I'm headscratching as to what it might possibly be.

No error logs on any of this stuff I guess? Do you guys have any add-ons installed?
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Chunk corruption causes?

Post by Gilberreke »

Hmm, with both chunks being corrupted in a village, it does sound suspicious. 2 doesn't really make a pattern though.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

Gilberreke wrote:Hmm, with both chunks being corrupted in a village, it does sound suspicious. 2 doesn't really make a pattern though.
It's two chunks containing priests and librarians smack in the middle of a village in short succession with a smaller player base than the mod used to have, with no similar issues being reported in the past, and with me having made a number of changes to villagers in the past few releases. My spider sense was tingling on the first one, with two I'm double checking everything I've done recently.

Please don't decrease the signal to noise ratio any further. Not ever thread requires comment.
User avatar
magikeh
Posts: 945
Joined: Mon Jul 04, 2011 9:57 pm
Location: Top -o- the Tower

Re: Chunk corruption causes?

Post by magikeh »

Ozziie wrote:Odd that the ground underneath looks as though it has survived but the building and villagers haven't :(
This would be most likely due to Minecraft working to replace the chunk but not doing a decoration pass on it. So there won't be any structures, vegetation, nor underground lakes iirc. I'm not sure where ores get inserted into the world. If you wouldn't mind I'd like a copy of the 'corrupt save' it may offer a few insights to the issue. I've got some ideas I'd like to test.
Magical Shit
Show
Syruse|Work: i like magic shit
MagikEh: ...
MagikEh: >.>
MagikEh: <.<
»» MagikEh walks to the bathroom
Syruse|Work: hahaaaaaaaaa
Syruse|Work: wait
MagikEh: xD
Syruse|Work: fuck
Syruse|Work: NO
Syruse|Work: DONT
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

magikeh wrote: This would be most likely due to Minecraft working to replace the chunk but not doing a decoration pass on it.
If I remember right, I think that entire structures are generated at once, and may extend into neighboring chunks as well. I think the decoration pass is indeed done on regenerated chunks, it's just that if the "root" chunk of a structure isn't regenerated, then the neighboring chunks don't get their portion of the structure either.

This would explain both why Ozziiee has chunks with missing building pieces, while Sterling Red has a weird mix of old and regenerated stuff in one of his chunks.

It's been awhile since I dug into that code to that level though, but so far everything described in these two cases fits the way I remember it working.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

All right, I went over every code change I've made in the past few releases (since I started putting them out again a month ago), and haven't found anything. I can only assume then that it isn't a problem with BTW, unless additional info to the contrary comes along.

I have a few questions for you guys (Ozziie and Sterling Red) though, which might help narrow things down if this pops up for other people:

-As I asked above, are you guys using any add-ons, particularly ones that might not have updated to my recent changes to extended blockids?

-Roughly what level were your villagers at in the affected chunks? Any other crucial trades you guys remember having unlocked with these villagers? Ozziie, you mentioned you had just unlocked a progression trade on the priest, was it the Soulforge / Anvil one? Had you unlocked that trade before updating to the most recent version of BTW, and were just revisiting the village for the first time after installing it? That soulforge trade is the only one making use of extended blockIDs at present, so it's of particular interest to me. Sterling Red, any chance your priest had that one unlocked too (it's level 4)? I ran a bunch of chunk loading tests on my end involving that trade to make sure, but everything worked fine in all cases.

-With what version of Better Than Wolves (roughly) did these villages first get generated with? What I most want to know is if they were first generated with the newest release, or if these were potentially old villagers that were being loaded into the newest version.

Any info you guys might be able to provide would be appreciated as while I have nothing to make me think this is a problem with the mod, the possibility that it might be, and that it might be messing with people's worlds, are things I'd really prefer to rule out if at all possible.
Ozziie
Posts: 128
Joined: Tue Sep 11, 2012 2:41 am

Re: Chunk corruption causes?

Post by Ozziie »

The village was generated a long time ago, way before the recent villager changes and the Priest is at max level 3 with the old ++ option available. I'm running the world on an SMP server (with no addons) on the same machine that I connect from (I have CraftGuide and The Deco Add-On on my SSP install).

The backup was made before levelling the priest and I'm able to reproduce the missing building in the chunk by levelling him up and reloading the chunk, more info in spoiler:
Trading Spoilers
Show
The priest was Max Level 3 and was requesting a Nether Star for ++.

Image

After updating his trades by trading Skeleton Skulls +, a new trade appeared: Runed Skull for ++.

After levelling him with the Runed Skull, his trades are as follows:

Image

Reloading the chunk once he is offering these trades causes the disappearing issue.
I'm still not convinced that this isn't an issue on my end but this might help narrow it down a bit.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

Ozziie wrote:I'm still not convinced that this isn't an issue on my end but this might help narrow it down a bit.
Oh boy. That's specifically the trade I was talking about, the only one using extended blockIDs for the Dormant Soulforge.

Man, thank you so much for all the detailed information. I'll dive right into looking into this further. I checked all the SSP code, but didn't think either of you guys were on SMP, so I didn't think to check the server code. That'll be my first step.

EDIT: Actually, there's another suspicion of mine in your post, about whether this had to do with winding up with 2 level up trades at once due to changes there. Will look at that also.
Ozziie
Posts: 128
Joined: Tue Sep 11, 2012 2:41 am

Re: Chunk corruption causes?

Post by Ozziie »

FlowerChild wrote:EDIT: Actually, there's another suspicion of mine in your post, about whether this had to do with winding up with 2 level up trades at once due to changes there. Will look at that also.
I specifically tested if it was them both showing at the same time that caused the disappearing, but the chunk will reload with no issues if both ++ trades are available. (EDIT: Not to say that isn't the issue further down the line, but at least it wasn't specifically them both being there that triggered the issue in the first place.)
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

Ozziie wrote: I specifically tested if it was them both showing at the same time that caused the disappearing, but the chunk will reload with no issues if both ++ trades are available. (EDIT: Not to say that isn't the issue further down the line, but at least it wasn't specifically them both being there that triggered the issue in the first place.)
Thanks man! Yeah, it was more the latter case I was thinking of, where you wind up with an old, no longer valid, level up trade from the previous level, after leveling up.

Those are the two items that jump out in the screenshot right before you got the chunk error: block with extended blockIDs, and invalid level up from previous level both in your trade list.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Chunk corruption causes?

Post by FlowerChild »

Just reproduced it with the steps you provided, so it's definitely on my end. Will fix and put out a patch as quickly as possible. I've got a SSP creative save now where I can reproduce it at will, so it shouldn't take me long to figure out the exact cause.

My sincerest apologies guys. Nothing bothers me more than screwing up people's worlds.

EDIT: Got it. Will package a release immediately.
Post Reply