Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 25, 2013, 10:35:26 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Gaps for games  (Read 1673 times)
Rohk
JkDefrag Hero
*****
Posts: 128


View Profile
« on: December 17, 2010, 02:50:59 pm »

Hi all,

I have been trying to make a script for my data disk, which consists mainly games.
The script should keep every game files together and the file movement should be at minimum when installing new games and afterwards running new defragment.

These are the procedures of the script:
-move all junk files away
-a gap for new games to be installed, (is it needed?)
-"a favourite game" which is sorted by file size, loading times should improve.
-Then my Steam folder and sorted by creation time.
-Then make a gap so next zone will always begin from the same position.
-And then the rest of the games which are also sorted by creation time.

This is the script which i have managed to do..

Code:
VolumeSelect
  Name("G:")
VolumeActions
 
  /* Make a gap for the junk files to be moved away. */
  MakeGap(VolumeUsed * 1 + VolumeFree * 0.1, DoNotVacate)

  /* Zone 1: Junk files, not games. */
  FileSelect
not ( DirectoryPath("G:\Games" )
)
  FileActions
    Defragment(fast)
    FastFill(WithShuffling)
MoveUpToZone()
  FileEnd

  /* Start from the beginning of the disk. */
  MakeGap(0)

  /* Zone 2: Place the MFT and some other special NTFS files. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending, MftSize * 0.1)
  FileEnd

  /* Zone 3: Directories and a gab for new files. */
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
    AddGap(RoundUp(ZoneEnd,VolumeSize * 0.01), DoNotVacate)
  FileEnd

  /* Zone 4: Favourite Game. */
  FileSelect
    DirectoryPath("G:\Games\Battlefield 2")
  FileActions
    SortBySize(Ascending)
  FileEnd

  /* Zone 5: Steam. */
  FileSelect
    DirectoryPath("G:\Games\Steam")
  FileActions
    SortByName(Ascending)
  FileEnd

  /* Start the next zone from 20% of disk. */
  MakeGap(VolumeSize * 0.2, DoNotVacate)
 
  /* Zone 6: Rest of the installed games. */
  FileSelect
    FullPath("G:\Games\*","*")
  FileActions
    SortByCreationDate(Ascending)
  FileEnd

VolumeEnd

So i have been trying to figure out how do i set the zones starting points always the same, so there wouldn't be full sorting every time i defrag. MakeGap(VolumeSize * 0.2, DoNotVacate) works but what happens if my steam folder exceeds the size of the determined gab?
Or is there easier way to achieve this?

The weekly version is the same without sorting, only defragmenting and moving new files/games up to zone.
Code:
VolumeSelect
  Name("G:")
VolumeActions
 
  /* Make a gap for the junk files to be moved away. */
  MakeGap(VolumeUsed * 1 + VolumeFree * 0.1, DoNotVacate)

  /* Zone 1: Junk files, not games. */
  FileSelect
not ( DirectoryPath("G:\Games" )
)
  FileActions
    Defragment(fast)
    FastFill(WithShuffling)
MoveUpToZone()
  FileEnd

  /* Start from the beginning of the disk. */
  MakeGap(0)

  /* Zone 2: Place the MFT and some other special NTFS files. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending, MftSize * 0.1)
  FileEnd

  /* Zone 3: Directories and a gab for new files. */
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
    AddGap(RoundUp(ZoneEnd,VolumeSize * 0.01), DoNotVacate)
  FileEnd

  /* Zone 4: Favourite Game. */
  FileSelect
    DirectoryPath("G:\Games\Battlefield 2")
  FileActions
    Defragment()
FastFill(WithShuffling)
    MoveUpToZone()
  FileEnd

  /* Zone 5: Steam. */
  FileSelect
    DirectoryPath("G:\Games\Steam")
  FileActions
    Defragment(Fast)
FastFill(WithShuffling)
    MoveUpToZone()
  FileEnd

  /* Start the next zone from 20% of disk. */
  MakeGap(VolumeSize * 0.2, DoNotVacate)
 
  /* Zone 6: Rest of the installed games. */
  FileSelect
    FullPath("G:\Games\*","*")
  FileActions
    Defragment(Fast)
FastFill(WithShuffling)
    MoveUpToZone()
  FileEnd

VolumeEnd

Please comment!  Shocked
Logged
Darlis
JkDefrag Hero
*****
Posts: 1709


View Profile WWW
« Reply #1 on: December 17, 2010, 03:26:43 pm »

You can place the junk files after everything else if you just move the first zone to the bottom of the script. Junk files will be automatically be moved away while processing other zones.

MakeGap(VolumeSize * 0.2, DoNotVacate) works but what happens if my steam folder exceeds the size of the determined gab?
The files from the next zone will then be placed directly after the steam files. Since those have have already been processed, MyDefrag does not move them again, even if they are in the middle of the next zone.

Note that if you try to sort something, a single file that changes it's size, or a newly created file can cause the whole zone to be sorted again. In case of games you should watch for save games, configuration files, logs, etc. and exclude them from the zone to make it "sort stable".
Logged

Need help creating a script? Try MyDefrag Script Creator.
Rohk
JkDefrag Hero
*****
Posts: 128


View Profile
« Reply #2 on: December 17, 2010, 05:05:49 pm »

You can place the junk files after everything else if you just move the first zone to the bottom of the script. Junk files will be automatically be moved away while processing other zones.
Yes, i did it that way at first, then i thought it would save some file movement by first moving the junk files away, but might be unnecessary.

Quote
The files from the next zone will then be placed directly after the steam files. Since those have have already been processed, MyDefrag does not move them again, even if they are in the middle of the next zone.
hmm.. so the second zone would then be moved further.

Quote
Note that if you try to sort something, a single file that changes it's size, or a newly created file can cause the whole zone to be sorted again. In case of games you should watch for save games, configuration files, logs, etc. and exclude them from the zone to make it "sort stable".
yep, i think this sorting is only good for the first time. After it i will use that weekly script.

Maybe i'll just add more "favourite game zones" and make the whole games folder as one zone so the steam wouldn't be separated and i could forget that weird gap i made..
Logged
smurphdude
JkDefrag Senior
****
Posts: 29


View Profile
« Reply #3 on: December 18, 2010, 08:21:34 am »

Hi, I been working on a similar technique to keep zones in stable positions for my general use system disk. What I came up with is a two script system - an Initial script that sets up the zones with standard gap sizes between then based on a percentage of freespace. This script also makes a 2nd log file which records the start position of each zone. Then for ongoing use I've got a Maintain script which refers to the 2nd log file and keep zones in the exact same position as long as the resulting gap is within a defined tolerance (again in my case upper and lower limits defined as a percentage of freespace). If it's outside of that tolerance the zone will be moved and the new start position recorded.

Take a look here..  http://www.mydefrag.com/forum/index.php?topic=4202.0.

For your scripts I would also suggest this order for FileActions - any files that are moved up to zone can then be used to fill gaps also.

Defragment(Fast)
MoveuptoZone
Fastfill.

Something to think about as well is maybe defining some zones by frequency of modification to that you'll have some zones that hardly ever change and others were all the action is. Should reduce the overall amount of shuffling especially if you are sorting some or all of the zones.

Maybe something like.

Zone1 - MFT + system files
Zone2 - Directories
Gap
Zone 3 - Favorite game excluding files modified in last 28 days.
Gap
Zone 4 - Favorite game files modified in last 28 days.
Gap
Zone 5- Steam
Gap
Zone 6 - Other games excluding files modified in last 28 days
Gap
Zone 7 - Other game files modified in last 28 days.
Gap
Zone 8 - Anything else on the disc (i.e. your junk)




« Last Edit: December 18, 2010, 08:29:20 am by smurphdude » Logged
Rohk
JkDefrag Hero
*****
Posts: 128


View Profile
« Reply #4 on: December 21, 2010, 01:19:59 pm »

Hey, thanks for the great tips and your method sounds very interesting indeed!

Here is what I have changed for the "monthly" version (more like first time script).
Code:
VolumeSelect
  Name("G:")
VolumeActions
 
  /* Zone 1: MFT and other special NTFS files. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending, MftSize * 0.1)
  FileEnd

  /* Zone 2: Directories and a gab small gap. */
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
AddGap(RoundUp(ZoneBegin,VolumeSize * 0.001))
  FileEnd

  /* Zone 3: Favourite Game. */
  FileSelect
    DirectoryPath("G:\Games\Battlefield 2")
  FileActions
    SortBySize(Ascending)
  FileEnd
 
  /* Make a gap for the junk files to be moved away. */
  MakeGap(VolumeUsed * 1 + VolumeFree * 0.1, DoNotVacate)

  /* Zone 4: Junk files, not games. */
  FileSelect
not ( DirectoryPath("G:\Games" )
)
  FileActions
Defragment(Fast)
MoveuptoZone()
Fastfill()
AddGap(0)
  FileEnd
 
  MakeGap(VolumeSize * 0.03, DoNotVacate)
 
  /* Zone 5: Steam. */
  FileSelect
    DirectoryPath("G:\Games\Steam")
  FileActions
    SortByCreationDate(Ascending)
  FileEnd

  /* Start the next zone from 25% of disk. */
  MakeGap(VolumeSize * 0.25, DoNotVacate)
 
  /* Zone 6: Rest of the installed games. */
  FileSelect
    FullPath("G:\Games\*","*")
  FileActions
    SortByCreationDate(Ascending)
  FileEnd

VolumeEnd
And for the weekly script I included more zones by creation date and last change.
Code:
VolumeSelect
  Name("G:")
VolumeActions

  /* Zone 1: MFT and other special NTFS files. */
  FileSelect
    SelectNtfsSystemFiles(yes)
  FileActions
    PlaceNtfsSystemFiles(Ascending, MftSize * 0.1)
  FileEnd

  /* Zone 2: Directories and a gab small gap. */
  FileSelect
    Directory(yes)
  FileActions
    SortByName(Ascending)
AddGap(RoundUp(ZoneBegin,VolumeSize * 0.001))
  FileEnd
 
  /* Zone 3: Favourite Game, and not files modified last 10 days. */
  FileSelect
    ( DirectoryPath("G:\Games\Battlefield 2")
)
and not ( LastChange(10 days ago,now)
)
  FileActions
    Defragment(Fast)
    FastFill()
  FileEnd
   
  /* Zone 4: Favourite Game, files changed in last 10 days. */
  FileSelect
    DirectoryPath("G:\Games\Battlefield 2")
  FileActions
    Defragment()
MoveUpToZone()
FastFill()
  FileEnd
 
  MakeGap(VolumeUsed * 1 + VolumeFree * 0.1, DoNotVacate)
 
  /* Zone 5: Junk files, not games. */
  FileSelect
not ( DirectoryPath("G:\Games" )
)
  FileActions
Defragment(Fast)
MoveuptoZone()
Fastfill()
AddGap(0)
  FileEnd
 
  MakeGap(VolumeSize * 0.03, DoNotVacate)
 
  /* ZONE 6: Steam, and not files created last 10 days. */
  FileSelect
    ( DirectoryPath("G:\Games\Steam")
)
and not ( CreationDate(10 days ago,now)
)
  FileActions
    Defragment(Fast)
MoveUpToZone()
FastFill()
  FileEnd
 
  /* ZONE 7: Steam, new files created last 10 days. */
  FileSelect
    DirectoryPath("G:\Games\Steam")
  FileActions
SortByCreationDate(Ascending)
  FileEnd
 
  MakeGap(VolumeSize * 0.25, DoNotVacate)
 
  /* Zone 8: Rest of the installed games, and not files created last 10 days. */
  FileSelect
    ( FullPath("G:\Games\*","*")
)
and not ( CreationDate(10 days ago,now)
)
  FileActions
    Defragment(Fast)
MoveUpToZone()
FastFill()
  FileEnd 

  /* Zone 9: Rest of the installed games, files created last 10 days. */
  FileSelect
    FullPath("G:\Games\*","*")
  FileActions
    SortByCreationDate(Ascending)
  FileEnd 

VolumeEnd
Haven't fully tested it yet but I hope the gaps of removed old games would be filled right.
Anyway I'm quite happy for it now. If there are some more tips and corrections, please comment!    Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!