Shindoh's Recent Forum Activity

  • Okay, I feel like I have some misunderstand, or am missing something about the concept behind Fixed Framerate and V-Sync, because something doesn't make sense here.

    When we set a Fixed Framerate, as I understand it now, we basically set the speed of the repetition of the processing & rendering cycles for the computer, which is why there is no lag.

    When we set V-Sync, it is possible to get lag, if the processing and rendering is much faster than the refreshrate of the screen. I don't understand this. That means V-Sync doesn't set the speed of the repetition of the processing cycles, but actually just let's it wait and only allow to display new images, when the screen is finished with the old one? Why doesn't it just work as fixed framerate, just set to the refreshrate of the screen then?

    Now let me define lag. Lag means executing an input, but having the related action on screen appear delayed, not on time with the input.

    Now if it is that way, I don;t understand another thing. If the lag is due to the speed difference, it should theoretically get worse with time. Let's say the refreshrate of the screen is 60Hz and the speed of the processing is 120FPS, twice as fast. So let's see, it'd go like this, or not? -> 1st Second- Screen(showing): 2 Frames; PC(has): 4 Frames; 2nd Second- Screen: 4 Frames; PC: 8 Frames; 3rd Second - Screen: 6 Frames; PC: 12 Frames.

    In other words, in this example in the beginning we have 2 frames difference, and on after 3 seconds, we have 6 frames lagging behind.

    Why doesn't anything here make sense to what I see?

    I just recently tried to read up on that again, to see what causes screen tearing. Which (interestingly enough), I understand how it happens, but it never happens, even if I make an experiment on my laptop. I know its' refreshrate is 60 Hz, but no matter what fixed framerate I put, it never tears. So I don't get it again.

    I feel like I missed something.

    Thank You for any help I could get clarifying this.

  • Thank You tulamide. Yeah, that makes perfect sense now, I didn't think about that. If I'd want to change something later on, I'd have to change it in every single event sheet again and again for the layouts. And of course the reduced amount of events. Indeed, with repeated groups it could get huge later on.

    It would be nice to include this thinking on the use of the event sheets and groups in the documentation. Maybe list it in optimisation tips or an area for "good working habits", or a reference on the page for event sheets and groups respectively.

  • But You see, that's where I feel there is not much more than a cosmetic difference.

    Let's say we have a separate event sheet for our animation system.

    Then for every new level (new layout), we include it into the new layout's event sheet. What we then see is a small line, saying "Inlcude Event Sheet: ..."

    Now, what if I just had all the code from the animation event sheet inside a group?

    Then what we would have is, instead of "Include Event Sheet: ...", a line saying the name of the group "Animation System", which we could expand.

    Now for every new level, we just copy the layout with it's event sheet, or include that layout's event sheet in the new layout, and delete all the parts not fitting the new level, and add the parts specific to that new level.

  • I remember seeing some people using seperate event sheets, and just including them in the current one for the layout.

    I was wondering if there was any benefit I can't see over having groups inside the event sheet?

    Thank You <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Thanks for the fast reply and letting me know, guys! <img src="smileys/smiley1.gif" border="0" align="middle" />

    I'm going to give it a try later.

    Although weird that it works, without seemingly giving the value to the variable in the other enemies, at least not visibly so in Debug Mode.

  • In my example we have several kinds of enemies, all in the enemy family.

    Now every enemy has the private variables for OriginalHeight and OriginalWidth.

    These variables are set to their respective height and width values of enemy objects and instances at the start of layout, once.

    Now in theory I thought, it will set the variables individually for every object in the enemy family. However what I can see in Debug Mode is that only one kind of enemy in the enemy family gets the values set. The other kinds of enemies have the variable, but don't set any value, it stays zero.

    My confusion comes from the fact, that despite this, one of the formulas I used, containing these variables values, still works for every enemy type.

    I basically set the position of the player in a certain case to: "enemy.X - enemy.OriginalWidth/2 - player.Width/2" and the same for Y and Height.

    Divided by 2 because their hotspots are in the middle. I want to position them exactly next to each other, and both sprites so to speak with their feet, the bottom of their sprite at the same Y position.

    The enemies purposefully for testing this have different sizes.

    So I don't understand why, although their variables basically have the value 0, the positioning of the player still works fine for the other enemies?

    Thank You in advance. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • The way I would do it:

    Grab Ledge:

    • When Sprite Position reaches near ledge during a jump, stop Jump Event.
    • Change Animation to LedgeGrab-Animation.

    (Align the frames of animation with their Hotspot so, that they will be perfectly aligned with the ledge/wall.)

    For the Pull it depends on how much animation You want to use.

    Depending on that I would program it differently to make the movement more smooth.

    The easiest way would be to have no extra Pull-Animation.

    Instead, to get up the ledge from the grab, You trigger a Jump.

    So You would be jumping up the ledge from Your grab.

    I think a lot of old 2D games used this method.

  • Could You describe in detail how Your event to do so looks right now?

  • Hey newt, thanks for Your quick reply!

    I think You misunderstood my problem. In fact the animation plays fine this way, although I see that Your code should actually be the right one when I think about it? lol; I mean it doesn't keep displaying the first frame of animation with my code, it plays normally and loops.

    Anyway, my problem was not with the display of the animation, but the correct movement in time, relative to the animations original fps. It was animated to be seen with 16fps.

    That means, the sprite should only move forward in X, when it changes frames to the next frame in its loop.

    Now the application itself is set to run with V-Sync.

    The animation itself in its "animators properties" area is set to run with 16fps.

    So, as long as the Thumbstick is held in the forward direction, the walking animation will be playing, it will play with it's own fps set in the animator and should be move forward in X, every time the frame changes.

  • As long as I press in one direction with the Thumbstick of a Controller:

    • The walking animation is played.
    • Every next frame of the animation the sprite should move += 10px.
    • I want to keep the game V-Synced.

    Right now, my code is:

    if Xbox360GamePad.LeftThumbstickX(1) > 0:

       Player.SetAnim(walk)

       if Player.OnAnimFrameChange():

          Player.X += 10

    The walk animation's own speed is set to 16fps in its own settings.

    But what happens now, the Sprite seems to move with the V-Sync speed, instead of the 16fps. Way too fast.

    What did I oversee here?

    Thanks in Advance!

  • Hey guys,

    If I remember right there are two Controller Plugins for Construct?

    The last time I checked, there was no way to check for how far a Thumbstick has been pressed (or rather tilted) into a +-X/+-Y direction, the same for the shoulder triggers.

    Did I miss something now, or back then?

    I know Game Maker has it's xInput plugin made by someone from the community, where You had full control over everything.

    Thanks in advance!

    EDIT:

    I just found an old post about it, the values for the Thumbsticks and Triggers are accessible in an expression (left_thumb_x) and (left_thumb_y) etc. with a value scale of -1 to 1 respectively for the Thumbsticks and a scale of 0 to 1 for the Triggers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Guys, I love You. And R0J0hound, exactly that! Thank You!

Shindoh's avatar

Shindoh

Member since 24 May, 2011

None one is following Shindoh yet!

Trophy Case

  • 13-Year Club

Progress

13/44
How to earn trophies