User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Questions about arrays

  1. #1
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Questions about arrays

    OK here is what I am trying to do.

    Im creating an engine atm and working on grid pathfinding which is going quite well. For saving my paths etc, Im using an array which saves the path for each active that will be moving.
    All my actives are given an ID. The ID is always set to 0, unless the objects are to move (which I will spread value 1)
    That way my movement fastloop will only be triggered a few times rather than for all actives.

    When I find a path between each active and the destination, the path is saved in my array. I can determine which path is associated to which active by using the ID of the active as the Y index of the array. (this part is all sorted).

    Now this is where it gets tricky.
    What I want to happen is when one of my actives reaches its destination, it's ID will be reset to 0 and its path is deleted from the array. Then the spread value will kick in again, and obviously some of the actives will be given a different ID so the path associated with that active will now need to be moved to their current ID in the array.

    The idea is that the array will only keep the paths of moving objects and delete that path from memory once the destination is reached.

    So my questions:

    1. Out of all the array objects, which one is FASTEST at loading/saving data to it. Speed is essential as there may be a lot of data being written to the array at any given time.

    2. Which of the array objects will allow me to delete a row in the middle of it, and shift all remaining rows below it up a position so I don't leave gaps?

    Hope this all makes sense.

    Thanks in advance

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Questions about arrays

    1. I don't know. Speed comparison for accessing data (time taken for 40k operations in hundredths of seconds - lower is better):
    Active Object's Alterable String = 15
    String Object = 16
    Data Store 2 = 19
    MagicDeque = 22
    Global String = 28
    Dynamic Array = 31
    GlobalStoreX = 33
    Array = 39
    AssArray = 44
    NamedVar = 50
    String Parser 2 = 59
    Static Text = 356
    List = 506
    ListView = 1106
    Combo Box = 1197
    INI = 3892

    2. MagicDeque, I believe.
    .:::.Joshtek.:::.

  3. #3
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    Thanks for the reply.

    Looks like magic deque is the way for me to go, although it looks quite complicated.

    Has anyone had much experience using it or got any tutorial/examples on deleting and inserting rows, saving/loading etc?

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    If you use one of the "keyed" data store objects, eg assarray, then you can store the path using the object's fixed value instead of a spread value.

    It could take a bit more work that way though.

  5. #5
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    dynasoft: sounds interesting, how would i do that? so each fixed value could be an 'index' in the array?? And i can simply delete it once the object is destroyed??

    Im basically after whatever will be the fastest and efficient way whatever it is

  6. #6
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    Yeah, something like that. Though I believe you need to store more than one value or string per object, so it might not be that easy.

  7. #7
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    so does anyone have any examples or tutorials on any of the array objects?? I can't figure out magic deque or associative array.


  8. #8
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    anyone??

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator

    Join Date
    Jul 2006
    Posts
    1,018
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    Learning by doing is the best way.

  10. #10
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Questions about arrays

    it certainly is but examples are so much easier.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. ini's or arrays
    By Bigfoot in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 15th November 2011, 10:24 PM
  2. Arrays?
    By legocacher in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd April 2010, 02:49 PM
  3. Arrays
    By Angelfox in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 18th January 2009, 12:40 AM
  4. Arrays
    By delusan in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 20th August 2007, 03:58 PM
  5. Arrays
    By Nick in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th June 2007, 06:53 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
  •