User Tag List

Results 1 to 4 of 4

Thread: Global extension and disk-write

  1. #1
    No Products Registered

    Join Date
    Jun 2007
    Location
    Croatia
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Global extension and disk-write

    I am creating an extension for my game that contains lots of variables and game info and does some extensive calculations on the data.

    The game has two main frames that switch a lot during the game (approx 3 times a minute) and those two frames read the data from the extension and write to it (to RAM, not to disk).

    Since I have read that our extensions can't be global (in help file: OEPREFS_GLOBAL - "this option has no effect on extension objects"), there was only one solution...

    That is to share the data by saving the file to disk at the end of the frame and then load it at the beginning of another frame.

    This is working as it is supposed to work, but the problem is that the file saved is about 50 kb, so everytime frames switch, 100 kb is written and read from the disk. If that happens 3 times a minute that means that disk is reading and writing too often. Since I want to spare the disk unneccessary r/w operations, is there a way to make the data global throughout those two frames?

    Porting all data to some of the existing arrays/storage objects is not an option because there are about 3000 different integers to save (and around 200 floats)... I don't think that would be a smart idea.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DJFuego's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    1,411
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Global extension and disk-write

    I wouldn't worry about it. If it was something a little more taxing then yeah but even read/writing 50k a few seconds is not going to brick your harddisk. Just make sure it's not writing the data somewhere a user that doesn't have full admin can't write to.

    I have found that some tird party companies have written rather High profile software insists that it writes files to c:\temp or not work if they can't create a desktop icon.



    If you already have a dodgy hard disk, buy a replacement. The frequent writes are what hard disks eat for breakfast. This will not slow your game down noticably.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Global extension and disk-write

    Hey, you do know you can use global data and access it in multiple instances of the extension and across frames?

    Just declare it outside of any scope and you should be fine

  4. #4
    No Products Registered

    Join Date
    Jun 2007
    Location
    Croatia
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Global extension and disk-write

    Well then, I guess it's ok this way...

    @Jam :: didn't know that... I thought that even if declared outside of the scope, objects declared in extension still belong to the extension which is recreated upon new frame... I guess I was wrong...

    Gonna try that.

    Thanks, guys...

Similar Threads

  1. Write own extension for Android exporter
    By qenio in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 26th June 2014, 01:23 PM
  2. Can't write to array from global string
    By Filip in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 6th September 2013, 07:36 AM
  3. Disk Space
    By johnwheeler in forum Install Creator and Patch Maker
    Replies: 1
    Last Post: 24th February 2011, 09:27 PM
  4. suggested extension/add - saving all global stuff
    By integrality in forum Extension Development
    Replies: 11
    Last Post: 8th July 2006, 11:30 AM
  5. Disk Cost?
    By Azu in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 5th July 2006, 11:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •