Optimizing SaveWorldState()
Posted: Wed Mar 06, 2013 8:59 pm
Hello,
I am a Developer at Chaos Age Server.
The server is quite old now and, as a consequence, we have a huge amount of items in storage (storage.txt has about 500mb, mostly in bank boxes and secure chests). I believe this might be an important reason why SaveWorldState() takes about 1 minute to run. That also seems to be the main reason for the long load time of the server.
What seems to be at our advantage is that, although storage is huge, only a little bit of it changes between each world save. Does SaveWorldState() take advantage of this sparsity?
If not, I had the following idea. Bank boxes and secure chests wouldn't be loaded to storage area when the server is loaded. Instead, we would keep a datafile for the contents of each bankbox or secure chest . When a player opens a bankbox, the content of that datafile would be created in a storage area. We would save the world in the following way:
a) Transfer all items in storage area to their respective datafiles.
b) Destroy items in storagearea.
c) SaveWorldState().
Does this make sense or am I missing something devious?
If this does make sense, is there a good way to save UO Objects to datafiles?
Thanks!
I am a Developer at Chaos Age Server.
The server is quite old now and, as a consequence, we have a huge amount of items in storage (storage.txt has about 500mb, mostly in bank boxes and secure chests). I believe this might be an important reason why SaveWorldState() takes about 1 minute to run. That also seems to be the main reason for the long load time of the server.
What seems to be at our advantage is that, although storage is huge, only a little bit of it changes between each world save. Does SaveWorldState() take advantage of this sparsity?
If not, I had the following idea. Bank boxes and secure chests wouldn't be loaded to storage area when the server is loaded. Instead, we would keep a datafile for the contents of each bankbox or secure chest . When a player opens a bankbox, the content of that datafile would be created in a storage area. We would save the world in the following way:
a) Transfer all items in storage area to their respective datafiles.
b) Destroy items in storagearea.
c) SaveWorldState().
Does this make sense or am I missing something devious?
If this does make sense, is there a good way to save UO Objects to datafiles?
Thanks!