ID:154172
 
I haven't done a lot in the way of games with persistent player saving, so I haven't much used the general save-an-entire-mob functions available in DM; all my saving has involved a very limited number of fields, so rather than just going through and marking all my variables except for 2-4 as temporary I've just been saving to specific fields using the bracket notation for savefiles. Are there any advantages to writing an entire mob vs. writing individual variables in terms of speed or space usage? Naturally just writing a mob would take a lot less code space to accomplish, but it seems to also demand a lot more attention to proper variable usage as the way references are handled seems prone to cause inefficiencies and bugs for the unwary (such as the infamous SpyRollbackBug that struck MLAAS).
Forgive the bump, but... anyone have any input on this?
It all depends on the game. In an RPG you probably would do a full save. However in games like Lode Wars you only need to save around 2 (rank and money).
In response to Exadv1
That's not the question. To be more precise, I'm talking about the use in terms of doing large-scale saving. Now, if you want to save most of a mob's data, you could either just write the whole mob, or you could still do it field by field and handle it all yourself. I'm asking if there's any pros or cons; more specifically still, I want to know if there are any significant efficiency advantages to writing the mob (or whatever else you're saving, for that matter) directly, because otherwise I'd just as soon manage the saving myself.
In response to Leftley
Leftley wrote:
That's not the question. To be more precise, I'm talking about the use in terms of doing large-scale saving. Now, if you want to save most of a mob's data, you could either just write the whole mob, or you could still do it field by field and handle it all yourself. I'm asking if there's any pros or cons; more specifically still, I want to know if there are any significant efficiency advantages to writing the mob (or whatever else you're saving, for that matter) directly, because otherwise I'd just as soon manage the saving myself.

Well, having the saving manual ensures that you have complete and utter control over the saving process. Unfortunately, it means that, if you ever decide to add a new variable or remove/rename an old one, you'll have to go back in and modify your save routine to compensate.

The automatic control doesn't have such a problem, but you should remember to fit variables into the appropriate standard, const, static, or tmp categories. (The rollback bug could have been avoided by declaring that turf var as tmp.)

I like doing automatic saving a lot, yes, but in any case when a specific reference is involved in any of your objects, make the variable tmp and be sure to make that part of the loading process manual. After all, remember that you can override and supplement atom/Read() and atom/Write().