Recently, with all the new users joining Zeta, we have well over 260Mb's of .sav files. I was wondering if there was anyway possible we could code some type of script, to delete inactive .sav files, for instance:
If a .sav file is un-accessed in 30 days, it will delete that .sav file. Everyone I have asked this question seems to have no idea which direction to point me, so I thought I'd take it to the experts.
RaeKwon
ID:175525
![]() Apr 10 2003, 12:30 pm
|
|
Lummox JR wrote:
RaeKwon wrote: F["timestamp"] << world.realtime
Then whenever you want to loop through to check on savefiles, which I suggest you actually only do once a month or so, do this: proc/PurgeOldFiles() Lummox JR Alright, I'll give it a try in a bit and let you know how it worked. RaeKwon |
I think you might want to try deleting old files manually before you implement this system. Unless each file is 2MB's each, its going to be a little unpleasent when you run PurgeOldFiles() for the first time.
|
DarkView wrote:
I think you might want to try deleting old files manually before you implement this system. Unless each file is 2MB's each, its going to be a little unpleasent when you run PurgeOldFiles() for the first time. Heh! That's for sure. I almost added more to the proc that would keep track of when PurgeOldFiles() was run last, and only do it every week or so, but then doing it daily shouldn't be bad after a month. But if he's got 260MB's of savefiles, then there's definitely a problem already: The files are storing the character icons, and possibly other extraneous information. Couldn't hurt to shore that up too. Lummox JR |
It's not hard to get 260 megs of savefiles when you're saving information for the number of "people" who play DBZeta.
|
You just inspired me to (attempt to) make a password style save system like in the old NES days. Naturally it will never allow people to see or enter the passwords, it will just save it too a .sav and load it when needed.
Hopefully it will work out so that the average save file is only a text string of 1kdjkgi3909asdfuio-oiuweroiuasdf932-asdoifuasfdfasdfX Now I just need to figure out how they worked it so well in Metroid... |
DarkView wrote:
You just inspired me to (attempt to) make a password style save system like in the old NES days. Naturally it will never allow people to see or enter the passwords, it will just save it too a .sav and load it when needed. To do that you basically just need a very very limited information set. In Metroid that amounts to a bunch of bit flags: Which items have and haven't been collected, which doors have been shot out for good, which bosses defeated. Also it needs to know what area Samus was last in; as I recall there are only 4 or 5 of those, and if 4 it can be done with 2 bits. Lummox JR |
What about things like how much ammo and health you have? Just something like how color bands on resistors work could do. Color 1=first number, Color 2=second number, Color 3=amount of zero's. Just as long as big numbers dont need to be very specific.
|
Garthor wrote:
It's not hard to get 260 megs of savefiles when you're saving information for the number of "people" who play DBZeta. It now exceeds 400 megs of space. o.0 RaeKwon |
RaeKwon wrote:
Garthor wrote: omg! |
To do that you basically just need a very very limited information set. In Metroid that amounts to a bunch of bit flags: Which items have and haven't been collected, which doors have been shot out for good, which bosses defeated. Also it needs to know what area Samus was last in; as I recall there are only 4 or 5 of those, and if 4 it can be done with 2 bits. You also want to add a checksum or players should have no problem comming up with garbage codes :). |
If you're just looking for a short term suggestion (and you have access to the host computer), just open up explorer, go to your saves directory, and choose View -> Details. Click on the Date Modified tab so it sorts by those, and delete all the ones whose modified date is 30 days or older.
Should only take a few seconds to find that one and select the rest before it... so this isn't a really lengthy or hard solution. Still, it'd be better to code this sort of thing into the game, like Lummox suggested. -AbyssDragon |
RaeKwon wrote:
It now exceeds 400 megs of space. o.0 You need to do some damage control. One of the reasons your savefiles are so huge is that--I recall from another post in which someone was using some hand-me-down code--you use custom icons. Now I love custom icons and would encourage you to, if anything, use more of them. But they have to be used carefully. The mistake you made was to create the icon and forget about it. It's easy enough to make, but the problem is clear when you introduce savefiles into the mix: The file gets saved with the icon in it, which is a lot more information than you really need; it's easier to re-create the icon from a set of colors when the character is loaded. During a save, the icon should be removed. mob/Write(savefile/F) mob mob Lummox JR |
This is a problem best addressed from the beginning, but I don't think it's too late to fix. You should probably add something to your save proc like this, in the root directory ("/") of the savefile:
F["timestamp"] << world.realtime
Then whenever you want to loop through to check on savefiles, which I suggest you actually only do once a month or so, do this:
Lummox JR