The Daily Click ::. Forums ::. Klik Coding Help ::. Save/load files into RAM?
 

Post Reply  Post Oekaki 
 

Posted By Message

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
9th September, 2015 at 09/09/2015 16:39:38 -

In MMF/CF, is it at all possible to save/load files into RAM instead of to the hard drive? When dealing with handling data - especially something like images - between multiple extensions, it seems really needless that I have to save things to a spot on the hard drive just to pass it from one object to another. Especially when saving/loading something like an image file results in a noticeable lag each time.

Is there anything like this? Like, an expression that you can put into the file pathname that will just keep it in memory instead of chucking it onto the hard drive?

I'm not really getting my hopes up, as I've never heard of such a thing, but then I keep finding new little details about MMF, so...

 
Go Moon!

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
10th September, 2015 at 10/09/2015 05:53:07 -

i don't know of any such thing. it'd be weird because the file loading expressions would need to be able to reference a filesystem within memory.
I don't think windows has that. that's more likely to be a linux thing.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
10th September, 2015 at 10/09/2015 05:55:27 -

maybe you should try the binary object or the binary quick load

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
13th September, 2015 at 13/09/2015 21:10:47 -

I'm pretty sure that's how the array object works.
When you add data to the array it doesn't save anything to the HDD straight away, only when you tell it to. So it must be saved in RAM before then?

I'm not sure if ive ever tested loading data before it's been saved to HDD though...

 
.

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
18th September, 2015 at 18/09/2015 16:02:04 -

You're asking if there is an extension to create a ram drive. The answer is no.

However what you described is part of the surface object. The surface object allows you to edit images in an image buffer and keep them in memory without ever saving them to the disk. Once an image is in the buffer you can obtain an "image reference" which is a handle to the image in memory which some other image extensions can then access. Unfortunately I don't know of any other extensions that support this besides the old overlay extension.

Perhaps you could build an object yourself that takes the image reference from a surface object and performs the image operations in memory for you? You might need to contact the creator of the surface object for help accessing the image buffer from the image reference.


Here is some more info from the Surface object documentation:

References are an advanced feature of the Surface that when used incorrectly can cause the application to crash. Essentially, a reference merely points to another image instead of having its own image data. This reference is described by a number (the memory location of the referenced image). The referenced image might be another image in the Surface Object or a completely external source, such as the image of an Active Picture Object. Once the source image is deleted, the reference is useless and should immediately be deleted as well. Any attempt to modify a deleted image through an old reference will probably result in a crash. Reference values can be used in several ways; for example they allow you to access images of different extensions such as Active Picture or transferring image across frames without saving them to the hard drive. You may add image references to the object's image list and operate on them like you would on any other image. You can also directly target a reference when performing a blit operation.

Edited by UrbanMonk

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
22nd September, 2015 at 22/09/2015 08:00:33 -

a ram drive? you could try a zip archiving object, providing it keeps it's data in memory instead of actively streaming, it might work...
assuming you can save a file directly into a zip archive, worth a try

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
7th October, 2015 at 07/10/2015 07:31:55 -

i figured it out
you could try installing ramdrive software and using the ramdrive in your code by having the player specify the drive name.
http://www.tekrevue.com/tip/create-10-gbs-ram-disk-windows/

i might do this for my mode7 engine. it's a bother for the players but a ram drive only needs to be made once per person for any number of games.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
7th October, 2015 at 07/10/2015 17:11:10 -

That's a terrible solution Airflow. Just use the players harddrive. It's not that big of a deal.

If you really must keep everything in ram go ahead and make a new extension. An extension is just a specially dll with a different extension so you can build it using Visual Studio and C++.

If you have a Fusion license you can download the SDK on the clickteam forums.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
9th October, 2015 at 09/10/2015 06:38:19 -

i way to lazy to learn c just for that one thing

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
9th October, 2015 at 09/10/2015 16:32:56 -

Well if you learned C/C++ you could do a lot more than just that.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
13th October, 2015 at 13/10/2015 01:35:19 -

hahaha, yeah true.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click