0 Favourites

Pin vs Every Tick

  • For my Custom Mouse, what is faster?

    (I am going to need to Pin or Move_To several objects at once)

  • It really is exactly the same.

    Whatever floats your boat ;)

  • Neither. Use whichever is most convenient.

  • Ok :)

    I am sorry to ask so many questions.. but it is 5 AM and i am OBSESSED with working at my game !

  • I'm interested in this as well.

    I'm working on a "pseudo" iso 8way platformer with "jumpable" things and a z attribute for mobs that jump or fly.

    All my mobs (player and enemy) consist of:

    • an invisible collision/movement sprite
    • a shadow sprite
    • a player sprite for animations
    • an effect sprite (emoticons for sleep, anger, talking etc.)
    • (optional) a health bar sprite

    When the player jumps, I increase his z-value, unpin him, move the animation sprite up to his z-value and repin him. Meanwhile I shrunk the shadow sprite while he's in the air.

    Worked perfect until I started smashing the buttons/keys and had him move around while jumping. Then there where moments, when his animation sprite and his shadow and collision sprite lost their relative positions because while unpinned, other movement events changed the position of the collision sprite but didn't update the position of the animation sprite.

    This could not happen if I maintain all sprite positions based on "every tick", the position of the collision sprite and sprite variables like z. Is it better to replace the existing PIN behavior with events that update the position every tick? I thought that with more mobs on screen PIN might be better performance wise...

  • Ive heard Every Tick is kinda useless, since Construc2 runs from Up to Down every tick So its more a "function" to run several things in the right order with sub events etc.

  • It's pretty much "Always"

  • Yeah :) That was a good way to put it

  • I'm not sure I get what you mean.

    Useless as in "shouldn't be used"? Allways do x, then y, then z is more or less what I thought it would do. That's why I had concerns about the performance when doing all those actions for "5*number of mobs" sprites + lots of other things "every allways" <img src="smileys/smiley2.gif" border="0" align="middle" /> compared to a pin behavior.

  • In your case is better to set the position of the shadow every tick. If your levels are flat you just need to set the X position of the shadow to the X of the characters (Y is constant).

    And don't worry about performance with 'every tick', it's as light as most other events. The main thing you need to care in terms of event sheet performance is loops.

  • ModalCore, your case sounds like one where performance is irrelevant. As this thread shows, people often ask "which is faster, A or B?" and the answer is usually "neither, you will not be able to measure any difference in framerate at all whichever you use, so just use whichever works or whichever is easiest to set up". You could spend hours tuning all your events and not get any performance benefit. Everything which matters is in the manual entry Performance Tips, anything not in there is pretty much negligable!

  • People... 'every tick' is THE most useful event... Don't get confused and start not using it!

  • Lmao sqiddster :D

  • I use "pin" behaviour in my game (jigsaw puzzle) to move automatically 24 shadows behind 24 sprites (drag & drop "moving together" effect without any X/Y management).

    The real benefit for me is to keep body line code and "on every tick" sub code for game's logic and conditionnal behaviours. If the pin effect is constant, no need to overload body code and "on every tick events" more than needed !.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • If the pin effect is constant, no need to overload body code and "on every tick events" more than needed !.

    In my case, the shadow is pinned to a character that can move 8 ways and jump (like "Double Dragon", "Streets of Rage", "TNMT" etc.)

    When the player (or any other mob) jumps, I used to unpin the shadow, move the mob up a bit, shrink the shadow and repin it. Worked fine until I tried jumping and changing the direction mid-jump (I'm not sure whether I'll deactivate this) and the shadow got out of sync.

    This is why I created a shadow function that moves the shadow of each mob according to the mobs X/Y (collission sprite) as well as Z value (animated sprite). By seperating shadow calculation and jump function I can implement in-jump movements easier (double jump, interceptions and collisions, in-jump attacks) but bloat my code a bit more.

    I'm running out of events soon and don't have the allowance (of my better half) to spend money on this pet project of mine. She said I should build something like Bejewled or a BubbleShooter...

    Maybe I'll start an IndiGoGo Project or something to gather the money for some better artworks, sprites and a license to keep going.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
65 15,838
philx's avatar
philx
Unread hot topic
0 Favourites
[Behavior] Pin+
56 7,094
Crow in the Snow's avatar
Crow in the Snow
Unread hot topic
44 6,528
TideKitLawsuit's avatar
TideKitLawsuit