Original Post — Direct link

Hey guys,

I created this topic to fully explain what exactly persistence does and why. We save the world state by writing to a binary file in the root of the server structure. It is a representation of world state that is periodically saved and also done during proper server exit.

As of this day we haven't been able to reproduce any new way that causes the items in the world to be removed. Items get removed either during runtime of the server if no player is around (we check the distance and vision cone), or during load of persistence.

Items get removed either due to their lifetime reaching zero, and all basebuilding associated items (barrels,tents etc.) have 45 days lifetime (IRL time). The lifetime gets refreshed when the item is being interacted with. This is a safety net for server performance to make sure things that clutter the system get removed at some point if they are not being used.

Items also get removed if they are ruined if the above constraints are applicable.

If item gets corrupted it is not loaded and thus disappears. This can happen by closing the server by termination of the process or crash. Right now since we are still unable to reproduce it, and the person who did at least according to the ticket he sent (thanks u/DAYZMISFITS). It seems to be the case that people are just terminating server (or the hoster) not gracefully but by killing the process. Right now you can probably replicate the issue 1/25 times by termination.

So I would like to ask all that are hosting the servers or having issues with persistence to check if by any chance this is not the thing happening.

Eugen with love <3

EDIT : Thanks for the gold <3 <3 <3 <3

External link →
over 5 years ago - /u/eugenharton - Direct link

Originally posted by Doyler92

Doesn't this just mean "no because we don't have time"?

To optimize the grid/representation would take months and its risky. So yeah we don't have time for that.

over 5 years ago - /u/eugenharton - Direct link

Originally posted by zombietopm

You're not able to reproduce it in house because you need people actually playing the game. These are player caused crashes. I've got a dev server and a prod server. Both identical right now. My dev box I forgot to shut down yesterday and has been up running for 18 hrs. The tent I placed yesterday to test forced terminations is still where I left it, obviously because the server never crashed in the 18 hours.

My prod server that actually has players on it, has crashed like 3 times in those 18 hrs. At some point my buddies barrel disappeared. But just one. His other one that was right next to it is was still there.

Also before I modded my servers, I had placed 3 tents and went to loot more. Crash happened. Worked my way back to the tents and 1 had vanished. Day or so later, they were all gone.

Also just last week I spawned in a bunch of stuff to build a few towers and a big compound. It last like 3 days. Then vanished.

We have tons of QA people playing the game, that’s not the issue. The second removal of tents is tied to a tracked crash or termination ?

over 5 years ago - /u/eugenharton - Direct link

Originally posted by The_Eastman

So just to be clear we are talking about the same thing here. Having the server write to a temp file first instead of directly, is something that would take months to optimize?

Yes it’s the fun of software development :) things don’t make much sense on surface but they are real to us.

over 5 years ago - /u/eugenharton - Direct link

Originally posted by zombietopm

I placed a tent yesterday on my prod server around 2pm cst. Some time between then and now, there were a hand full of crashes. During that same time, my dev server was up and crashed 0 times. Tent on prod is gone. Tent on dev is still there. I've got my crash log if you wanna look at it.

Thanks that just confirms what we know now

over 5 years ago - /u/eugenharton - Direct link

Originally posted by ZomboWTF

hey eugene, have you guys considered using an sqlite file based db to gradually save change to the world? in this way you wouldnt have to rewrite a whole file everytime a server kicks the bucket

sqlite has a few limitations though

We did but as I said due to performance consideration and amount of atomic operations that’s unviable.

over 5 years ago - /u/eugenharton - Direct link

Originally posted by Doyler92

It's sad that after years of waiting you guys decide that you can't work for a few more months to make it actually work right. This decision to just rush it out to a final release sucks.

We can and we will, I said it in another topic previously. Moving a release is not an option as its always something that requires multiple months of planning. There is coordination with platforms, advertising and more and taking a loss by moving a release date has to be very careful. Simply put we know there are issues, lot of them are fixed already and we will continue supporting and developing the game going forward. This is not a corporate issue as Bohemia has always supported their products for years after release.

over 5 years ago - /u/eugenharton - Direct link

Originally posted by Naut1c

hi eugene, probably you know this already, but i think maybe your current way of dealing with persistence is not optimal. even server restarts that break writes, should not cause a wipe of any sort.

instead it should be some kind of eventsourced system, where every change is written incrementally, without affecting a 'big state file'. only the loading of these incremental changes would then evaluate the current and complete state.

so this means, even if the server is killed within a write, only one change file would be broken. and when it is, you just leave it out when loading the state, as if it never happened.

this system would not only make youre persistence much more stable, it would also make it easier to reproduce and tackle bugs within persistence.

of course it is a challenge to get it right and performing well. but i believe this is the way to go.

We know :). The thing is we have been working on entity system that should get us there at some point but sadly the atomic operations on this scale are few months away.

over 5 years ago - /u/eugenharton - Direct link

Originally posted by ItsMyOnlyOption

/u/eugenharton

Just reinstalled the two instances we are running, this time 2 seperte installations, 2 different directory's.

Same behavior. One instance gets shutdown properly, and for the other one we can see the console closes, but the server executable keeps running.

Is it possible we get a #save option? so we can force a safe prior to an ungracefull shutdown?

Great catch