User Tag List

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

Thread: Ideas for making a dynamic grid?

  1. #1
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Question Ideas for making a dynamic grid?

    I'm making a level editor and would really like the visual grid to be dynamic i.e being able to change cell size during runtime.
    The Dynamic Grid object would be ideal for this, but it isn't working and seems broken.
    So for now my grid is static, but do you guys have any ideas on making it dynamic?
    Extensions are fine(standard only) and the only rule is keeping the lines to 1 pixel width.
    Thanks!
    //EE

  2. #2
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tip, I'll check out the Surface Object!

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I would use scaled active object lines, unfortunately. One line for X and One line for Y created however many times you need. It isn't the most efficient method by any means, but far simpler than the surface object and actives let you use effects/transparency.

    https://www.dropbox.com/s/ewlxej8m0k...lines.mfa?dl=0 check the grid origin object's values. Make sure you uncheck fine detection on your gridlines so you aren't having mmf2 attempt to compare with a scaled object: it's disastrous.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a bit silly that normal arrays can't be resized. I can't imagine it being at all hard to implement, it likely just didn't occur to Clickteam when they were making Array.

    Perhaps you could add Array resize to the feature request section of the bugbox?

  5. #5
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    O_o

    The Array object is automatically resized when you write a cell above the limits defined in the properties.

  6. #6
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    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)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,132
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    you could always do something like this >_< it's pretty basic/inefficient, but I guess it depends on HOW dynamic you really need it to be.

    crude dynamic grid.mfa

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    O_o

    The Array object is automatically resized when you write a cell above the limits defined in the properties.
    I don't know how everyone got on this topic, but while what you say is true yves, you can't resize the array to any size LOWER than what it has been expanded to. I believe pixelthief pointed this out before: an array will still take up the same amount of memory regardless.

  8. #8
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    You're right.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Yves View Post
    O_o

    The Array object is automatically resized when you write a cell above the limits defined in the properties.
    I honestly didn't know this Yves! I just tried it and it works. Thanks for the valuable info.

    In reply to the OP, this functionality is all you should really need for a dynamically enlargable level grid. I can't imagine why you'd want to make the array smaller (other than you made a mistake), so really this is what you need:

    Level designer places a tile greater than level bounds -> don't need to do anything. Array will resize on its own

    LEVEL DESIGNER PLACES A TILE LESS THAN LEVEL BOUNDS -> You need to run a fastloop which scoots down your level values to make room. Have an xLevelOffset and yLevelOffset, which store a bias which converts from level coordinates to array coordinates. So for example, if your first tile is at (-5, -6), then your xLevelOffset would be 5, and your yLevelOffset would be 6, mapping (-5, -6) to (0,0) in the array.

  10. #10
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @casleziro: I had pondered doing that but hadn't tried it due to inefficency(need ~300 actives scaled to 1280px or 1120px with semi-transparency - on my oldish laptop ^^). Your example was very nice though and streamlined, but fps went down to 20-30 and it just wasn't worth the hassle. It's a shame though that the Dynamic Grid Object isn't functioning. It's perfect for level editors. My new idea is this; Since in any grid-based game the grid will be divisable by 8 I'll use a 2-colored quick backdrop for 8x8 and 16x16 cells like I did at first, then use scaled actives to mark screen borders only. That should cut the strain I believe.

    @DaveC: Thanks for the example! Though it would become a bit too inefficent when you increase the grid size.

    Why I want the grid dynamic to begin with is because I'm getting tired of making a separate level editor for every project I start, so I'm trying to make one which can work for several projects at once just by changing between saved configurations.

    @Everyone discussing arrays: I already have a great setup for minimal arrays using the associative array, I just wanted the graphical representation of the editor grid dynamic in cell size/count.

    EDIT: Well I'll be... obviously it wasn't the actives scaling and effects that caused the slowdown. just noticed a severe fps drop occurring without them! @_@

    EDIT no.2: Well I'll be again!! Got everything to work just fine! It was actually the debugger that caused the drop! After about a minute running, the app would jump to 40 fps and slowly crawl to ~25. Now it stays at solid 60 just because I unchecked "show debugger". Good mental note!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Grid Game Example - no grid object
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 1st June 2014, 08:35 PM
  2. Easy Grid Without Grid Object
    By Sparckman in forum Guides, Tutorials, Examples, Widgets
    Replies: 1
    Last Post: 23rd May 2014, 10:47 PM
  3. Making a dynamic chart?
    By StingRay in forum iOS Export Module Version 2.0
    Replies: 11
    Last Post: 17th September 2013, 04:11 PM
  4. Dynamic Grid Object
    By Retriever2 in forum Extension Development
    Replies: 17
    Last Post: 10th November 2009, 02:11 AM
  5. Making the grid (squares) invisible
    By RickyRombo in forum File Archive
    Replies: 3
    Last Post: 27th February 2009, 11: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
  •