Nested loops, grids and secluded cells

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Thank you, thank you! This is brilliant Schrodinger! Want me to credit you by another name when my game's done sometime? :)

    Extra note: It seems if you keep clicking "TEST" all blocks will eventually turn green?

    Edited once, last by hellii (June 24, 2016 at 7:54 PM).

  • Ah thanks man, very kind, I'm glad it helped,
    schrodinger is ok, or Lizard King, pick the one that suits best your taste
    (or both, or none if that's more suitable for your project XD - whatever you prefer is fine!)

    The example wasn't designed for multiple testing in the same "game", and would need some tweaking for that (not many, actually, just resetting some flags and values)
    also, for a design limitation of previous system, which checked for "divisions inside same groups", the engine was forced to work outside of a "main" loop,
    thus it takes (number of groups) frames to complete checking,
    which is quick if groups are only 3-4, but could become noticeable with more groups.
    Now I think you could have that all inside a general loop, allowing for instant-check inside a single frame.
    (unless you're planning to export for mobile, in which case the multi-frame architecture could prove to be benefical for the game being solidly exported!)

    Let me know if you need help for one or both these modifications, shouldn't be a very long task

    a selection of my Fusion examples can be found Please login to see this link.

  • So you're saying the applications for mobile phones actually run multiple frames as opposed to HTML5 applications where it can only run one general loop per frame.

    This actually fits with the experience I've had, where some things ran differently on HTML5 compared to on Android, where I deleted some cells in the same loop, which worked on every platform except for in HTML5.

    Ultimately, I think I will have ~10 groups max at a time. I will only check divisions of groups once a path from start to finish has been made. This can happen multiple times per level, as people attempt to find the solution for grouping the tiles correctly.

    I'm stuck on how to limit this check, but you mention I'll have to make it run the full check on one complete loop (1 frame)?

  • Hello,
    I was saying splitting operations in multiple frames was "benefical" for mobile,
    because it's been experienced that excessive number of operations (there's no exact figure, but should be around the hundreds of iterations)
    performed in looping / excessive loops, proved to freeze those fragile systems quite easily
    as if they break whenever the application gets halted on the same frame for too long (because of a loop doing too many things, or too many loops)

    They work the same, but mobiles are much weaker and need some extra attention,
    splitting the checking in multiple frames would prove to be a good way to keep the application solid also in those runtimes.

    As for HTML5 behaving differently, there are unfortunately a number of inconsistencies between windows runtime and exporters,
    so it's always better thoroughfully testing during the whole creation process to avoid bad surprises / having hard times tracking back what has gone wrong!

    I was saying if you wanted to perform the operation in a whole loop when having many groups,
    to avoid the player "noticing" the check being performed
    (10 groups = 1/6th of a second at 60FPS, is noticeable but can definitely be no issue!)
    but I was strictly talking of Windows - surely would be a bad idea if you plan exporting on Android X)

    a selection of my Fusion examples can be found Please login to see this link.

  • So I've actually encountered the problem of doing too much stuff in one frame... A loop I have that checks every object of a specific group seems to run for very long. How can I split up a "for every object" loop into 2 frames instead of one, so everything will run smoother overall?

  • if you need to spit in two frames you could use a flag

    an idea could be spreading a value in your objects,
    and then flagging only half of them:

    start of frame
    >>> spread value 0 in (yourobject.my_ID)

    run this event once
    + my_ID of yourobject < numberof yourobjects / 2
    >>> set flag 0 (yourobject) ON


    then, constantly switch the flag and fire the loop only for ones with flag ON (or OFF):


    always >>>
    toggle flag 0 of yourobject

    flag 0 ON
    >>> start loop foreach of yourobject

    a selection of my Fusion examples can be found Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!