So I was trying to concider what would be better.
I can either store all saveable varibles into list and upload them to their mysql database names, or to have a text string and load all the varibles into the same field and split them when the new mob is created.
I.e varname=amt;varname2=amt2
Which way (if either) would be the better way of doing this?
Another way would be to update the database as actions occour( such as save the players new level on levelup along with their stats. )
Thanks!
ID:151562
Apr 4 2010, 3:32 am
|
|
In response to Stephen001
|
|
Edit: I get what you mean about sperate mapping, that makes sense.
would it be better to update them as they change, or periodically, or a mixture of both or even only on logouts. |
In response to Pirion
|
|
Oh. Well, that's really up to you I guess. Do players stay logged in for long periods of time?
|
In response to Stephen001
|
|
Yes they would. So I guess that takes out only on logouts...
I guess I would have to do a little bit of testing to figure out how much of a diffence periodic saving and on update saving would make on the hosting server. |
In response to Pirion
|
|
Updating when they change is probably too intensive, as I suspect you update some of the variables quite frequently. Periodically may be best.
|
In response to Pirion
|
|
Every five to ten minutes is generally an industry standard for intensive RPGs or the like. Every round is pretty standard for puzzle/action/RTS games.
|
If it's one variable per column, then you can simply do:
SELECT * FROM player_mobs WHERE key = 'Stephen001';
Which will return you all the rows (mobs) that have a key of 'Stephen001'. SQL will do this oh so much faster than you can in SQL. The mapping also allows you do to neat things like check for unique names on new characters:
SELECT COUNT(*) AS existing_mobs FROM player_mobs WHERE name = 'SomeName';
If existing_mobs has a value that isn't 0, someone's already got that name.