For Optimisation sake, is it better to have one world proc with a for loop for every client. Or make every client call their own proc.
Further notes: the proc spawns roughly every 5 minutes
This is an auto save feature just to clarify
ID:151466
Oct 30 2010, 2:47 am
|
|
From an efficiency viewpoint, one "loop controller" is only significantly more efficient when the loop occurs very often (as in once per tick). But a loop controller is, in most cases (shameful generalisation), a much better design choice as well, allowing you to have a lot more, well, control over the loop. It's better to have one loop than a personal loop for each player. I believe the best option, however, is this:
Loduwijk wrote: Even better would be to save based on actions in-game. Save at logout, at levels gained, and at anything else you decide is important - which could be every time an item is received/discarded, every time you gain experience, and more. How much is up to you and what the game can handle, but the more the merrier as long as it doesn't get in the way. |
In response to Toadfish
|
|
Agreed. Not only would significant events still be stored efficiently, these would ideally occur at different times per player, and therefore would cause less issues towards the server at one single time, though for a simple Save procedure that shouldn't be much of an issue.
|
In response to CauTi0N
|
|
l
|
In response to Loduwijk
|
|
Thanks for all feedback. I prefer the latter, however saving at logout doesnt seem as trustworthy.. i read a post one day about how the client is not open long enough to complete the procedure... but saving per attribute gained is best for me.
|
In response to Rapmaster
|
|
If you are using server-side savefiles, saving when a client logs out (that would be client/Del(), not mob/Logout()) has no issues, aside from the server crashing.
|
In response to Garthor
|
|
Garthor wrote:
If you are using server-side savefiles, saving when a client logs out (that would be client/Del(), not mob/Logout()) has no issues, aside from the server crashing. Which can be fixed (for the most part) with event intervals like stated before. |
If you have a lot of players and saving has a lot of overhead such that having everyone all save simultaneously causes problems, you could go the latter route and let every client handle it themselves instead of the world, and make it so that the clients don't save at the same time; just throw in a bit of a randomization to when they save so that the saves are all staggered around at different times.
Even better would be to save based on actions in-game. Save at logout, at levels gained, and at anything else you decide is important - which could be every time an item is received/discarded, every time you gain experience, and more. How much is up to you and what the game can handle, but the more the merrier as long as it doesn't get in the way.