Forum BigDB What to Save, Where and When? Strategies?

Discussion and help relating to the PlayerIO database solution, BigDB.

What to Save, Where and When? Strategies?

Postby mrgreen » April 21st, 2011, 4:31 pm

Of course I know, it depends on what type of game you are making, but generally speaking, whats the best strategy for Saving your game's State? ( with special consideration for making it economic in terms of Bandwidth )

So for example, in my project, the Player has some simple light statistics like "Experience", as well as some heavier, more complex (Non-PayVault) objects ( an "Inventory "), which are complex data types, and bigger in size.

I suppose there is no point in calling the .save() function on the PlayerObject to save everything every 500 ms right? as that would be just a waste of bandwidth? So I am calling it only when something changes from any of the above properties. But here is the interesting bit, If I call .save() every time the user just gains a new experience point, which is just an integer, then does that mean that the entire local set of Data gets sent again to the remote server, including the heavier "Inventory" items which have not changed?

So would it be a good idea to create another Table, with a different set of objects, corresponding with each PlayerObject, specifically just for their "Inventory", where the heavier Items would be stored, that don't get updated too often? And run a separate set of logic for it to determine when to perform a .save() on that?


PS: is there some kind of built in "protection" for the save() function similar to the PayVault.refresh() that it only saves if there has been a change since it last sent the data back?
In an ideal world, it would check the properties against a local copy and only send the bits to the server that have changed
mrgreen
 
Posts: 52
Joined: February 12th, 2011, 7:27 pm

Re: What to Save, Where and When? Strategies?

Postby Benjaminsen » April 21st, 2011, 10:38 pm

BigDB saves deltas. IE only changes in an object is send to the server. Thus if you call save and nothing has changed, nothing will be send to the server.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: What to Save, Where and When? Strategies?

Postby mrgreen » April 21st, 2011, 10:56 pm

wow thats great!

SO its actually safe to call the save() function like every half a secs, as PlayerIO figures out what to save then!
mrgreen
 
Posts: 52
Joined: February 12th, 2011, 7:27 pm

Re: What to Save, Where and When? Strategies?

Postby jasonMcIntosh » April 24th, 2011, 5:58 pm

Nice! I was wondering about how BigDB handles that, too.
Jason McIntosh
Otherwhere Gameworks
jasonMcIntosh
 
Posts: 81
Joined: February 25th, 2011, 4:51 am

Re: What to Save, Where and When? Strategies?

Postby mrgreen » April 24th, 2011, 11:51 pm

Also is there a point in "encoding" Objects and for example String variable names to integers ?

Like for example I use the actual classnames to refer to stuff, which could be very long. So for instance
"MyMagicalManaPotionWithVeryLongNameString" could be mapped to an integer as "1" and then I could use a Dictionary to lookup and map these integers in the sent/received data to actual names i use internally?

Or is something like this is already happening automatically when PlayerIO sends/receives data?


would this save bandwith/data storage usage?
mrgreen
 
Posts: 52
Joined: February 12th, 2011, 7:27 pm

Re: What to Save, Where and When? Strategies?

Postby Henrik » April 25th, 2011, 10:19 am

mrgreen wrote:Also is there a point in "encoding" Objects and for example String variable names to integers ?

There's no compression in the protocol, but no. Don't overcomplicate things.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to BigDB