Author Topic: RamDrive for FSOpen  (Read 1431 times)

0 Members and 1 Guest are viewing this topic.

Offline phreak

  • Gun Phreak
  • 211
  • -1
I don't know if any instructions have been posted on doing this, but here's what i've done from about 30 minutes of experimentation.  I don't have Vista, so the procedure is probably different.  As usual, I take no responsibility for you ****ing up your own system.

Overview
------------

A RamDrive is basically a hard drive that is stored in main memory.  It is extremely fast compared to mechanical media like hard drives, it's drawbacks being that a RamDrive can't be as large as a normal hard-drive, and the data is volatile (lost after shutdown).

In order to do this, you will also need a tool that creates NTFS Junction Points.  These are similar to soft-links in your favorite unix flavor.  It basically creates a file that tells the OS where to look for the file.  This is transparent to the application program (Freespace2 in our case), so there are no code changes involved.

further reading
RamDrive
NTFS Junction Point
Symbolic Link

Tools
-------

You will need the following things to make this work.

1) Lots of main memory, this may require the use of a 64-bit OS, especially if you have more than 3GB.
2) A RamDisk driver for Windows.  I am using RRamDisk, as it is 64bit capable.  A link will be provided at the end of this section.
3) A Utility to create NTFS Junction Points.  I am using a utility called JunctionLinkMagic.  A link will be provided at the end of this section.
4) The partition that FS2 is installed on must be NTFS version 5 or later.  Not an issue if you're running XP.

RRamDisk Driver (RAR format)
JunctionLinkMagic (Self-extracting EXE)

Procedure
-------------

Setting up the Ramdisk
  • Download the ramdisk driver to a folder of your choice and extract the contents.  I would suggest NOT using C:\temp.  I used C:\RRamDisk
  • Go to Start->Settings->Control Panel->Add New Hardware
  • Cancel out of the Add new hardware wizard.  It timed out for me and I had to select "Yes I have already connected the new hardware"
  • A screen should appear asking you what type of hardware you need to install.  Scroll down to the bottom and select "Add a new hardware device"
  • Select "Install the hardware that I manually select from a list"
  • Select "Show All Devices" at the top of the next page.
  • Click on "Have Disk".  Navigate to the directory to where you installed the RRamDisk files.
  • Select RRamDisk.inf, click on OK.
  • In the directory where you installed RRamDisk, open up "ramdisk.exe".  Select the Disk size you want to make your ramdrive, and the drive letter you wish to use.  The highest drive size is 3GB, make sure you have enough memory to hold the ramdisk in addition to whatever else you run.  I recommend allocating 25% to your ramdisk.  The default drive letter is R:, make sure nothing else is not using R:
  • You should be able to write files to R: now

Setting up the Junction Points
  • As a reference, my freespace2 is installed to D:\Freespace2\Freespace2
  • Since I have a 3GB RamDrive (8GB of ram 4tw), I was able to load the MediaVP pack and the Retail VPs into main memory (total about 2.0GB).
  • I created a storage folder for the mediavps and retailvps in their own subdirectory in D:\Freespace2\ramdrive.  This is "safe" storage for the media and retail VPs because the Ramdrive clears itself whenever the power is turned off.
  • Create two empty directories in your main Freespace2 folder named "mediavps" and "retailvps"
  • Create two empty directories in R: named "mediavps" and "retailvps"
  • Open up JunctionLinkMagic and select "create"
  • In the host pane (the left side), select the folder in the Freespace2 directory that you wish to link from (eg \Freespace2\mediavps)
  • In the target pane (the right side), select the folder in the ramdisk that you wish to link to (R:\mediavps)
  • Copy the archived files to the ramdisk.  In my case it was D:\Freespace2\ramdisk\mediavps -> R:\mediavps.
  • For the retail VPs, i created their own "mod" folder and added them to the mod command line using -mod mediavps,retailvps.  There are no VPs in my base \Freespace2 directory

You should now be able to run freespace2.  The beauty of this is that windows sees D:\Freespace2\Freespace2\mediavps as it's own directory, but the files are actually located on R:\mediavps.  I can imagine a procedure like this may work for other games.  Loading times were off the charts, probably 1 second to boot the game, 10-15 seconds to load a mission. no ingame stutters.

To be safe, you should never delete the junction point directories using the windows shell, and use the JunctionPointMagic utility.  The junction points persist on the hard drive after reboot, if you try to access them you get the generic "this path is not available message".  If you copy the directories back from the archive to the ramdrive the links are automatically restored as long as the path names are the same.

sample pictures
Junction Point
My FS2 directory
Mediavps on D:
Mediavps on R:

Caveats
----------

You can only create junction points for directories, so you can not load up single files (individual VPs) on your ramdisk.
« Last Edit: March 18, 2008, 08:44:51 pm by phreak »
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker
    • My old squad sub-domain
I understand the how, but i don't understand why? If (obviously) the drives purged at powerdown. What would i use it for?
Your friendly Orestes tactical controller
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
because it's a *bit* faster.  Once you get things setup initially, recopying the files over to the ram drive doesn't take too long (~10sec for 2GB).  You can probably be able to manage multiple games if you have a single "archive" directory with shell scripts to swap the games in and out.

and i can ;)
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk