TheInstance's Forum Posts

  • Box2d ! Thats awsome Ashley, and a very important step forward. Now i am attempted to start writing again.

  • Umpphhh,

    well i knew that already, and its exactly what i showed you in the first example.

    Oh well, we have a saying...

    " Wat baten kaars en bril als de uil niet zien wil ? "

    I can freely expect the same bug to be gone in the '8 directions" �-aligning ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My Gosh ! You cant read events. I have been to optimistic in trying to bring sense in all this.

    LMFAO you can not even read 5 events properly.

    Oh dude have a nice day. And go do something else. LMFAOO.

    You guys have no idea how to build something , if you cant even read 5 events.

  • No reaction Rich ? Hmmmz

  • Hmmm, after 50 times changing layouts, still no crash.

  • I can confirm that the animations still dont work as they should.

    The switching from one animation to another in events/actions is perfect now,

    but ...

    the animation do not always play after switching .. or should i say 'seldom'.

  • I should not have left it at that point.

    Its of course simple to counter that with a little animation.

  • Do you have the same thing for every thread ?

  • Very Personal Conclusion on all this:

    The "on bounce" condition is (i think) only recently added. patryk used it to solve this problem.

    And after all, its probably the right solution today.

    Although the "on bounce" condition is meant to over come the limitations with a ball behavior that only will bounce on solids.

    Now you can choose witch object its bouncing from. And you can have 2 balls in the layout, each bouncing from different objects. Witch is very nice.

    Do not understand me wrong, its a very useful condition.

    But after all it is not solving the general problem.

    Maybe, we need 2 Big Brother Loops. To solve this completely.

    ?

    1 thats V-synced, and acting as it does now.

    another 1 thats NOT v-synced, and keeps running trough the events to set flags for collision detections and triggers.

    This will also make triggers finally really work as triggers.

    Now i just hope that there is anyone understanding what i mean. Or anyone willing to ask questions and this way triggers me to explain till it is totally understandable, or accept that i am wrong.

  • You might think:

    All this V-sync mummble and mamble is not influencing my .caps.

    You might think again.

    Allow me to show you something, starting out with this .cap.

    Orginal it comes from this topic:

    You can download it from both places. Fire it up and watch.

    It will give a error about a sound not found, just click "ok" and it will run fine.

    When i ran this .cap for the first time. I noticed the Ball is bouncing a little weird. And in a closer look, you can see that the ball is intruding the blocks and paddle with a few pixels. Also, sometimes the ball is jumping out the layout in closed areas, mostly in corners.

    So i dived in the .cap. And i saw that patryk is using his own bouncing mechanism. And an event to bring the ball back in the layout when it escapes.

    So asked him (assuming he's male): Why you do that for ?

    And he answered me: If i dont do it this way, the sounds are not working.

    And i slammed my own forehead, leaving a M mark. My question was rather dumb.

    His solution to the problem is in fact elegant. Solution ? Ah yes, he worked around a problem.

    Allow me to step back on his steps, and reproduce the problem.

    download this.

    unzip, and fire it up. Leaving the folder structure intact.

    I modified his .cap this way.

    1/ i made all the objects that are supposed to collide with the ball "Solid" in the groups/attributes properties. I deleted all actions/events from the .cap used to bounce the ball. Now all bounces are made due the build in bounce of the ball behavior.

    2/ i added 2 sounds, since i dont have his original sound.

    Run all, and notice that the events do not pick up any collision detection.

    Not the collision detection to destroy the blocks.

    Not the collision detections that should trigger the direct sound into playing a sound.

    This is what he worked around.

    But.

    What is happening here ?

    On my laptop it only runs 60 ticks / second. It runs all the events in 1/900 of a second, and in the remaining time its waiting for a V-sync.

    Imagine the following situation.

    You are babysitting 2 kids. You sit in the couch. And both kids sit at the other side of the table. Playing monopoly. You are supposed to monitor the kids behavior. Meaning. When one hits another (collides) you are supposed to yell "STOP IT" and punish the kid who started.

    Now lets limit your eyes.

    Imagine there is only one light bulb in the room. And its kinda working bad. Meaning: it burns 1 second to not work for the next 5 seconds. Light 1 second, dark for 5 seconds.

    Thats is close to what happens with The Big brother Loop. While waiting for the V-pulse to happen, its blind to what happens in the events. BUT, the behaviors keep running and running, unattended.

    Just like the kids behavior. After all they are kids, they tempt to fight. But, when they start fighting in a moment that the light is out, you have not seen it, you missed one hitting the other, you missed a collision.

    To prove this,

    download this .cap .. and fire it up

    It is exactly the same .cap Only, in the application properties i disabled the V-sync.

    Do NOT Be Attempted To Do this For Your Games. It brings Other Bigger Problems.

    I dont know exactly what happens now. I do know that The Big Brother Loop now runs more times a second. But there is still some kind of V-sync, else i would have 10 balls on my screen, considering the speed this ball moves.

    But yes i do know that it runs at more ticks / second. And at my computer now like 2/3 th of the collision detections actual get detected. That can be more or less on your computer, depending on the speed of your gpu and screen.

    And i think i proved the connection between v-sync and the amount of ticks/second, and the connection between ticks/second and the cap working as expected or not working as expected.

    So keep this in mind, its important.

  • :::

  • Guess this story is a never ending story. Yup i have to add something to this topic.

    The follow .cap i stole from this topic. (i always misspell threat, so allow me to use 'topic' in stead )

    You can download it from there, or pick it from this link.

    Fire it up, and take a look at it.

    I am only interested in the event numbers 2, 3 and 4.

    Back then i saw the error in this. But i had no 'general' solution. With 'general' pointing to something that will work in all situations. I do now.

    Lets first analyze the problem.

    There are 3 objects in this project. Sprite, Sprite2 and Sprite3. Personal i do not like unnamed objects. But anywayz.

    All 3 objects are member of the group 'blue".

    So in events 2 .. 4. You see an attempt to set the gravity in the platform behavior for a certain object to zero, when the vectorY in its platform behavior is also zero.

    This looks ok j0h! Whats your problem now again !???

    Um, well, the syntax is right. And it does exactly what it is programmed to do.

    Namely, when the object sprite's VectorY = zero, it will set the gravity in ALL objects that are member of the family Blue to zero.

    And it does this in event 2 and 3 and 4, resulting in .. well i guess you can see that.

    Do not laughs ! I have done those kinda things myself. I am dead serious ! ( lol well ).

    Now lets upgrade this isolated little error to something 'general' to learn from.

    The condition in event number 2 is a (what i call) Flow Condition. It runs its Sub Events and Actions when the condition is true.

    But what we need here is a Pick Condition. In this case we need to take all the Blue objects, filter out those who's VectorY is not zero, and feed the left overs to the Sub Events and Actions.

    Yep, its a Picking Objects situation, why its on its place in this topic.

    We do have a small problem here though. The expression as used in the events in this .cap, can not be accessed using a Family.

    Thats is not a bug or so, thats rather a very normal thing. Imagine an object having 2 platform behaviors. And at same time being member of a family with 10 other objects, who have only 1 platform behavior attached. Now when accessing the expressions trough the family name, witch VectorY shall the system take ? The one of the first behavior or the one of the second behavior ?

    Anyway !

    We need a good Pick Condition to make this work.

    So lets convert *Flow* to *Pick*.

    Let me show you in steps "how to".

    Step 1.

    Make a private variable in the objects.

    Step2.

    Use the "for each object" system loop to walk trough the objects and set the private variable to the Expression. (in this case that would be to the VectorY in the platform behavior)

    It does not matter in what order the "for each" walks trough the objects, so do not worry about that.

    Step3.

    Now you can use the Pick Condition "Compare Private variable" to pick objects based on the stored expression.

    Problem solved ! : )

    You can see this work in this .cap

    Hope this was a help.

  • all gone, do not worry no more

  • patryk ?

    Can i use your .cap to illustrate a point that i would like to make in one of my other topics ?

    plz ?