I just had a thought...rather than trying to do a bunch of fancy stuff, why not reverse the save process?

Originally, during a save, those bin files are created. So why not leave the Save process as it is, but offer the option to reverse it to simply a csv file? The save happens, everything is written, and then the background process starts that creates the csv output. Just keep overwriting the same location after every save. This would also give shard owners a chance to "recover lost items", after a save goes bad.
 
I just had a thought...rather than trying to do a bunch of fancy stuff, why not reverse the save process?

Originally, during a save, those bin files are created. So why not leave the Save process as it is, but offer the option to reverse it to simply a csv file? The save happens, everything is written, and then the background process starts that creates the csv output. Just keep overwriting the same location after every save. This would also give shard owners a chance to "recover lost items", after a save goes bad.

Well what you are describing can pretty much be done now. Each item is saved to its own row in the items table along with the base attributes. If say one item is corrupt you can just delete the row, along with any references to that item and the game will load. I have actually tested this out adding and removing items to my backpack via the database. You can also if you really want to export the database to a csv file. Maybe if I can motivate myself I will create a youtube video showing how to do it.

The stuff I am actually working on now is the extended attributes like magic properties and such are still basically using the old serialization system and then just tagged on to the end in a column in the item row. Once I get rid of all the serialization there will be much less potential for corruption.
 
I'm bored again so I'm working on redoing this but with mysql or mariadb so it will work in linux using mono and the latest pull from the git to keep it up to date. So far the only thing I got working now is just connecting to the db and creating tables. I'm thinking of doing something where it doesn't overwrite old saves that way you can look at the history and do some data stuff with it or even do some sort of time warping things in game.
 
Back