User Tag List

Results 1 to 8 of 8

Thread: Array vs. Counter vs. Object values

  1. #1
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    111
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Array vs. Counter vs. Object values

    Hi guys--

    I'm not sure if HWA would affect this at all, but just in case, I'm posting in the HWA forum. I've been using counters and object values for awhile now, and besides being incredibly disorganized, I suspect it's memory-inefficient as well.

    My question is this: is writing and reading to an array (not saving to an external file, but just for in-game values) slower than using counters or object values to recall stored values? If so, is it a negligible difference? Or should I make the switch in my existing game?

    Thanks!

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

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

    Re: Array vs. Counter vs. Object values

    I can't imagine there being much difference at all, so your call.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Array vs. Counter vs. Object values

    Actually, using an Array is better than using lots of Counters.
    Counters eat more RAM and CPU because they're stand alone objects - each value has its own object, with all the settings like width, height, position etc.
    The difference should not be noticeable though.
    You might want to use a different object than Array, though.
    For example the Named Variable Object, which comes with the bonus packs. You can assign a value to a string identifier - Arrays use number indexes which might be too confusing.

  4. #4
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    111
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Array vs. Counter vs. Object values

    Thanks for the advice! Is there only a limited number of variables available in the Named Variable Object, or infinite?

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Array vs. Counter vs. Object values

    As much as your computer can handle, I guess (Let's just say infinite).

  6. #6
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    111
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Array vs. Counter vs. Object values

    Ha, yes, yes it can.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Array vs. Counter vs. Object values

    I actually stick to Ini++ rather than the named variable object, even in cases where I don't actually load or save the data from and to files. I think NVO have some design mistakes that Ini++ does better.

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    UrbanMonk's Avatar
    Join Date
    May 2008
    Location
    Southern U.S.A.
    Posts
    847
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Array vs. Counter vs. Object values

    I'm with you on that Nifflas.

    I have 3 ini++'s in my current project, and I only save one of them.

Similar Threads

  1. Summing the values of an array
    By fawfulfan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 18th July 2012, 07:14 PM
  2. Add values to Array without setting X and Y
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th March 2012, 11:58 PM
  3. Simple INI Example - Save and Load Counter Values
    By Stephen in forum File Archive
    Replies: 0
    Last Post: 22nd April 2009, 12:23 AM
  4. [Request] Counter with alterable values
    By Joeyotrevor in forum Extension Development
    Replies: 6
    Last Post: 15th June 2008, 07:45 PM
  5. Counter Values
    By Stephen38 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 9th February 2008, 09:51 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
  •