Power outage: scenes files destroyed, scripts can't resolve

Today there was a power outage while I was doing stuff in Godot.

When I reopended the project, a couple of scene files (I believe those I had opened) were broken. They wouldn’t open in Godot or Windows (notepad or anything else)
They were completely broken, no missing dependencies etc. that I could have fixed in notepad or so.

And some scripts (I believe those were opened as well) were somehow broken too. Godot suddenly didn’t recognize the class_names. I deleted the broken scenes and reloaded the project a couple of times and restarted the editor. The only thing that eventually helped, was to change the class_names on those scripts by removing one or more chars and then write them again.

Btw. all scenes and scripts were already saved before the outage.
Any idea why the scene files broke and the class_names couldn’t be resolved (is this the correct term?)?
And what can you do to avoid this?

You may have saved them but on computers the filesystem doesn’t really sync every millisecond with the disk (ssd)… That’s also the reason why someone has to shut down the system instead of simply turning the switch off.

So in your case you just might have lost some data. One possibility can be a filesystem check and repair run… so you might get some data back… maybe… :person_shrugging:

I believe the outage happened a couple of seconds after saving. That’s why I was blaming Godot somehow for it. Anyways, this was the final push to finally use Version control systems — Godot Engine (stable) documentation in English :grimacing:

Version control could also save you in other ways, not just by rolling back to a good commit, but also the git clean command can get rid of all the temp and godot cache files, which may have been causing your class_name issue. It’s kind of wild how many editor internal files Godot creates and relies on.

1 Like

Thanks, this is good to know!