TheInstance's Forum Posts

  • You dont sound as asking for help, more as stating facts. But if you list up problems with Construct i have this urge to put in my 2 cents.

    If you need help with this, then upload a .cap.

    Now i have to assume, and picture myself a way trough how i think your events look like.

    So i assume you made a copy of the characters sprite, erased some outer things as "the tip of the head", and this new sprite you use as sensor, in pixel detection mode. I sure can imagine this construction going stuck. Try to figure out a bounding that does the same, if needed 2 separate simple objects, and use the bounding collision method.

    I have no idea how you drive the sensor, how you snap the character to the sensor, and how you align your animations. Plz trow in a .cap.

    One thing about animations though. I noticed that since the last release, Animations stop playing when you auto-align angles from a angle-sub-animation with more frames to an angle-sub-animation containing only 1 frame. Just go to the Animator, and right click the lonely frames to copy and past. So you have at least 2 frames in each animation. When its a non moving animation, just 2 the same frames, of cours. And all problems with animations not playing are gone.

    And about your last point.

    The "8 directions" behavior can be set on "ignore keys', if thats what you use to drive the sensor.

    Ashley brought "slow-motion" into construct. I have not played with it myself yet. So i have no idea if its possible to slo-mo parts of things. But then again ....

    What you describe should not be a problem. If you bring a nice flow into your events.

    If you let the keys alter variables, and move, fire, sit, stand, according those variables. Then you only need 1 global variable that represents the state your games is in.

    Then if you organize all your events in nice event trees,

    All you have to is open a tree with checking the global " FloW variable".

    Like ...

    key 'fire' pressed

    _______ set the flow to fire

    'flow'' set to fire ?

    _______ is the thing allowed to fire, yes or no

    'flow' not equal to "fire"

    _______do all the moving stuff

    'flow' equal to 'fire"

    _______do all the fire stuff, and when done set 'flow' back to moving

    Its easy to drive a complicated game on only 2 "flow" variables.

    Greetings : ) ( to stay on topic )

  • ,,

  • You can using the tracking hided in the turret behavior.

    Give it a low rotation speed. And it will slowly rotate towards its target.

    Or fast with a hight rotation speed, as you wish.

    Snap its position to your object, and snap the objects angle to the turret angel.

    A small .cap to illustrate.

    download/file.php?id=100

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What do you guys mean ? Set two objects to the same angle ? Thats easy. So i guess i am not with you. Plz explain ?

  • Dude you still in that mess ? Or did you found the problem? Honestly, wish i could point you to something.

    Sometimes see another ones mess, lol , relativates your own.

    A week ago, i had some kind of virus. Well i think it was a virus. I can not really know. Since, well...

    It ate ALL my files not in use on the C: drive and on the D:drive.

    Lucky not on my E: drive holding all the backups for my important docs.

    But i had to redo my whole system, my vista was half gone too. Plus apply that slow ass vista SP2 update.

    I did not even install 1/10th of all my precious programs back.

    But live is beautiful.

  • Plus, as far as i know, the people targeted by construct are the creative people. Those that hate to code, but love to make sprites.

    Hahaha, now that leaves me out.

    But yes, at the end, there will be more need for code snippets, then for a sprite library.

  • Now what j0h ?

    Are you saying that loops are useless ?

    No sir !!!

    Loops have there place in constructing. I would not want to miss them.

    Here is an example of good use of a loop.

    There is not a more simple way to create those instances of an object, then using a nice Loop.

  • wah

  • This ...

    is the correct way to do what we wanted to do with the loop at start of this topic.

    This time using The Big Brother loop !!!

  • mm

  • Now back to where i started.

    The loop. First allow me to illustrate The Big Brother Loop waiting on a V-Pulse.

    Download this, and fire it up.

    1 object. 3 events.

    Event nr 2 moves the object 10 to the right.

    Event nr 3 moves the object also 10 to the right.

    Event nr 4 moves the object 20 to the left.

    If you run this. The object is not moving at all. Thats because the Big Brother loop waits at the end of every tick for the video to complete a frame.

    And the video will not be updated in the middle of 1 tick.

    The 2 events moving the object to the right happen inside 1 tick. Since the video will refresh only After a complete Tick.

    We only see the result of a complete tick !!!

    Remember, and accept this. Dont be a Rebel by trowing the V-sync in the application properties to "unlimited". That is asking for big display artifacts.

    And the loop ? Well the same thing is happening here.

    The loop happens INSIDE 1 tick. WE WILL ONLY SEE THE RESULT OF A LOOP CONSTRUCTION. because, the video dont get refreshed at the rate the loop is running.

    The video gets refreshed only once every Tick. And the loop completely happens inside 1 Tick.

    So now ? How do we make objects move by loop constructions in a way that we actual see the objects move ? Well make use of The Big Brother loop. Since this Loop is already V-synced by design.

  • OK now.

    Lets say an average computer will be able to display 80 frames / second.

    Or 80FPS.

    But The Big Brother Loop is able to run like 2000 Ticks / second, also depending on the speed of your hardware.

    Thats more then 200 times faster !!

    If we give The Big Brother Loop the freedom to run uncaged, it will possible encounter 2 problems.

    1/

    On beam based monitors (not LCD's), it will happen that the events are in a different Tick on different places on the screen.

    Since it will pass the beam in speed several times, on top of the screen we will be in tick1, in the middle we will be in tick 2, on bottom we will be in tick 3.

    This will show as flicker. As horizontal moving objects to move in 2 pieces. As 1001 artifacts. As vertical moving objects to be twice on the screen.

    2/

    It will choke the GPU. Since it offers the GPU new material while the GPU is still rendering the last image. The GPU will not accept, and will do this in a kinda random way. Because some images take more time to render then others. Result: shaky movements.

    The only solution we have with todays devices is to CAGE The Big Brother Loop so it will be exactly as fast as the Frame Rate for your computer.

    We know when every device in the computer is ready to accept a new image/frame when those devices generate a Vertical Sync. A vertical sync is no more then a electric pulse identified by its form so we can read it as " The pulse that says this is the end of 1 image".

    There are other electric pulses that say "this is the end of a line". They have a different form. That between the lines.

    So, in reality ...

    The Big Brother Loop completes 1 Tick, then waits patiently till it gets a V-pulse. When the V-pulse happens, it starts over at the top of events to complete its 2dn Tick. At the end of the 2nd Tick, it will wait again for the next V-pulse.

    This process of waiting to get in step (in sync) with the displaying device we call V-Sync.

    And you can forget all i said, if you see it as Video-Sync.

    As The Big Brother Loop waiting for the Video to display a complete frame.

    THIS MEANS ALSO THAT THE SCREEN GETS REFRESHED EVERY TICK. BUT NEVER IN THE MIDDLE OF A TICK.

  • I stole that description from "the Net".

    Its well explained, not 100% correct, because its messing up a bit between the places monitor and gpu take in this story.

    But it will do.

    Yet, lets simplify some.

    First lets say V-sync stands for Video sync.

    Lets forget which one exactly limits the amount of images/second we can show.

    De monitor that needs time to build the image by image.

    And/or the Gpu who needs time to render the image that will be presented on the monitor.

    Also image by image.

    Lets also forget that due those limitations in the amount of images that we can present / second,

    we do something completely weird,

    namely: we are displaying a continue movement (a movement by behavior by example) trough a non continue device !

    Just accept that, depending on your total hardware & devices, we can only show a certain images, also called frames, /second.

  • V-Sync = Vertical Sync

    A CRT monitor draws the screen one line at a time, from top to bottom.

    When it reaches the bottom, it pauses for a moment, while the electron gun is pointed up to the top again.

    If you have v-sync enabled, then that is the only time at which a new frame may be presented to the monitor. Then the monitor gets the whole frame, and can render it in peace, knowing that the GPU won't give it a new frame until it's done.

    With it disabled, the GPU can literally overwrite the frame data while the monitor is drawing it. So you can easily end up with the top half of the screen showing a different (older) frame than the bottom half. That can lead to tearing, and v-sync avoids that.

    Of course, v-sync forces the GPU to stop and wait, so it limits your framerate. (It never gets higher than the screen's refresh rate, and if it dips below, then it has to skip a screen refresh, and wait for the next one before it can get to present the frame it's working on. Then you get a framerate of half the screen's refresh rate. And if that's not enough, then a quarter.)

    The actual feature still makes sense on LCD's, but the name is derived from how CRT monitors work.

  • Download this, and fire it up.

    It has only 1 objects.

    And 1 event, moving the object by its own X + 1

    Run it, and watch the object keep moving by 1 pixel to the right, each tick.

    But ? we moved it only 1 pixel ? in 1 event ?

    Well construct runs top down. And then starts over again at the top.

    Meaning: there is a Loop already. This is the loop that keeps construct running and running.

    There is not one moment in making a game that you can forget/ not take in account this loop.

    So to set it in the spotlights that it deserves, i have to give it a big bombastic name. To make you see the importance.

    I call it: (deep commercial voice) The Big Brother Loop !!!

    The entity representing The Big Brother Loop to execute all events just once:

    we call a "Tick"

    Now do not imagine The Big Brother loop as a wild running animal that runs as fast as it can trough the events from top to down, to start this process as fast as it can over and over again.

    The Big Brother loop is very patient. Well it has to !.

    Because it is caged by the V-sync. The second actor in this story.