is a event sheet continuously looping?

0 favourites
  • 8 posts
From the Asset Store
6 looping tracks to use in your games and projects. These tracks are in the style of the 1960s detective movie genre.
  • thanks

    Dan

  • Well:

    The system will read your non trigger events from top to bottom (includes counts the same way too), once per tick (a tick triggers basically before each redraw), trigger events on the other hand can happen at anytime, even multiple times between two ticks.

    So events are not continuously looped, only at certain times, but in a very frequent way (most displays refresh 60 times per seconds, thus implying 60 ticks per seconds)

    Hope that awnser your question.

  • Aphrodite , may I ask what happens with the loops? When for example we have something like this:

    -everytick ----> set Sprite X to self.X + 30 * dt

    -Repeat 100 times ----> add 1 to variable Y

    -etc

    The Repeat event how much does it "last" when C2 reads the Event Sheet? I know that without the repeat 100 times, C2 will add 1 at every every tick, but with the loop condition what is happening under the hood? Does the program "halt" until the CPU adds the 100 values and then it continues to the next event?

    I am a bit confused with the looping logic in programming

    danno55 , sorry for highjacking your topic, but I thing there is some relevance into this.

  • Loops run in 1 tick.

    So something like "Repeat 1000 times" or "For "x" from 0 to 1000" will happen in 1 tick.

  • shinkan , ok, but will they happen incrementally, or it will just go from 0 to 1000 at once? And if they do happen incrementally, isn't this adding more calculation time between each tick? I mean, surely a repeat 1000 times event should demand 1000 more calculations than just a single every tick event (both having the same actions). I hope I am not as stupid as I feel right now 8/

    Thanks

  • shinkan , ok, but will they happen incrementally, or it will just go from 0 to 1000 at once? And if they do happen incrementally, isn't this adding more calculation time between each tick? I mean, surely a repeat 1000 times event should demand 1000 more calculations than just a single every tick event (both having the same actions). I hope I am not as stupid as I feel right now 8/

    Thanks

    It will repeat indeed, a repeat 1000 times does 1000 the same thing, however C2 have some "cache calculations" to reduce the amount of identical calculations sometimes, also, you should only use loops when they are useful (using a loop to add 1 to a variable with a repeat 1000 times is not useful, adding 1000 is more direct, however if you want to create between 1 and 20 objects and placing them one after another, then create them within a loop like "repeat X times" where X varies from 1 to 20 is useful), in most cases, if you dont know if a loop is a good solution, it probably is not, when it is useful however, it is kind of visible.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Aphrodite , thank you for the clarification. It's the concept behind some actions that confuses me. Since I am not a programer and I am introduced to programming concepts within Construct, I feel that sometimes the logic is very clear ("do x get y"), however the lack of foundational knowledge (in programing) other times make the logic behind conditions and procedures feel somewhat obscure. I can't really put in in words, it's more like a feeling, some steps seem to be way steeper than others. Perhaps this is something that someone that has a background in programming doesn't experience as vividly as I do.

    Enough psychoanalysis for one post though, thanks again for the information ;o)

  • Aphrodite , thank you for the clarification. It's the concept behind some actions that confuses me. Since I am not a programer and I am introduced to programming concepts within Construct, I feel that sometimes the logic is very clear ("do x get y"), however the lack of foundational knowledge (in programing) other times make the logic behind conditions and procedures feel somewhat obscure. I can't really put in in words, it's more like a feeling, some steps seem to be way steeper than others. Perhaps this is something that someone that has a background in programming doesn't experience as vividly as I do.

    Enough psychoanalysis for one post though, thanks again for the information ;o)

    A quick exemple: I did a land generation concept based on arrays and tiledbackgrounds (was before the tilemap), and basically the land would generate in 4 times:

    First populating the array

    then correct some values in it

    then apply some filtering

    then create the objects

    The way it was done, it took 4 ticks to do it

    believe me, those 4 ticks were long (60 seconds for all of them combined), so you cann see the execution is stopped

    Afaik the only heavy calculation C2 does that will not stop the game (aka: done in parralel) is the pathfinding algorythm.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)