Rhindon's Forum Posts

  • This was quite helpful. I was JUST about to post a question about this very topic. Thanks all!

  • *CHUCKLES* This is one topic that I wish there was a comparison/side-by-side chart showing how ticks/FPS and dt and screen refresh works and differ.

    whiteheat - In theory, I definitely understand now, especially when it comes to making sure objects do what they ought to WHEN they should. In practice, I'm not there yet. Just the other night I got my test/learning program (not an actual game I'm building) implemented with dt so that it runs as before, but without tick dependency. I think the the obvious next step is learning to THINK in dt and not confuse it with ticks/FPS.

    Ashley - "dt is literally only the time in seconds since the last tick"...THAT clears that bit up nicely. Thank you.

    Whenever the "n*dt" gets brought up, one thing I keep forgetting is that dt is typically (always? ...I believe always) a fraction, which is why it usually adds up to 1 every second. (My apologies, it just helps if I can try to explain the same thing told to me in my own words to check that I understood accurately.)

    So, with the Every Tick --> Set sprite X to Self.X+1, if the tick/FPS is 30, the sprite will only move 30 pixels. Or 60 if the tick/FPS is 60. Thus the dependency. But, as I believe you just stated, dt correlates with the screen refresh - that is, an update to the present images on the screen as they should be at any given time.

    Heh, I know I may be complicating this more than need be, but this is the odd way my brain filters information. Thank you, as well, for bearing with me.

    How'd I do...again? LOL

  • Kyatric - I think I'm clear on #1 and #3. Back to #2...

    Maybe my confusion on the "60*dt" is that I'm thinking this is a GENERAL thing when it's really just a reference to an element for movement in pixels (well, per the example) regardless of FPS. (This is an example of me having trouble even clarifying what exactly my confusion IS.)

    So I'm thinking... If "60*dt" moves a sprite 60 pixels per second, if we changed it to "30*dt", then...30 pixels?

    Okay...let's see if I can't work this out and answer my own question.

    Just to make things simple ("simple"...coming from me? Yeah right)...let's say we've got an absurdly slow computer running at 5 ticks/FPS. (Can you say "GIANT paperweight"?)

    C2 runs through all the Events...we have one tick...and so on...

    RUN TIME: dt 0

    Tick 1: dt .21 (Total dt .21)

    Tick 2: dt .19 (Total dt .40)

    Tick 3: dt .20 (Total dt .60)

    Tick 4: dt .22 (Total dt .82)

    Tick 5: dt .18 (Total dt 1)

    ------------------------------

    TOTAL dt: 1 second

    Now, every tick, we multiply that by 60.

    Tick 1: 60 * .21 = 12.6

    Tick 2: 60 * .19 = 11.4

    Tick 3: 60 * .20 = 12.0

    Tick 4: 60 * .22 = 13.2

    Tick 5: 60 * .18 = 10.8

    ------------------------------

    TOTAL: 60 (kind of a "duh")

    So! *a light suddenly starts to grow brighter this very moment* Every TICK - whenever C2 makes it's pass over the Events...THEN!...it checks to see how much time in a SINGLE SECOND has passed, and passes THAT VALUE to the action to tell it to move the sprite that many pixels. Soooo, basically, we're passing a value that is a FRACTION of the total of 60 pixels we want it to MOVE after one second. So even if the FPS were slower (say, the near-frozen 2 FPS), while the individual dt would be a larger amount, in of itself, after ONE SECOND, the SAME number of pixels total would still be passed - that is, 60. For at 2 FPS, each individual dt would be roughly .50, HOWEVER, 60 * .50 dt * 2 FPS STILL adds up to 60 (yay for math!).

    I think the #1 point I need to REMEMBER is that dt is "the amount of time passed BETWEEN ticks/FPS DURING a SINGLE SECOND".

    Thank you for bearing with me here. Initially, I just didn't get why the whole "60*dt" was so important. It was JUST a way around slower framerates to still present a 60 FPS flow...

    That's pretty much it, yeah? LOL

  • These questions stem from the scirra.com/tutorials/67/delta-time-and-framerate-independence/page-1 that I read. I understood the information in general, but I had a few questions regarding the nature of dt that didn't quite seem to be answered.

    1) A tick is what, exactly, compared to FPS? I get the impression they're the same thing, but I wasn't sure...

    2) Why the "60*dt"? I'm assuming that's to accommodate for 60 FPS even if it's closer to 30 ticks on slower computers? How would you translate "60*dt" in layman terms?

    3) With timescaling, you're basically manipulating the realtime value of dt, correct? So a slow-mo would be telling C2 that the dt is 1 when the real value is 2...something like that.

    I do understand that dt is the amount of time in seconds passed since the last tick (usually, if not ALWAYS, a fraction of a second).

    I also understand that dt is better than counting ticks as ticks can greatly fluctuate on slower computers, whereas dt can still keep track of the amount of time passed without hardly any interruption.

  • Richard Stennett - Will code actions that are told to run On Loading Finished ever run again? Or is that the only time they will be processed for the duration of program?

    For instances, at the start I want a random number to be generated and stored to a variable, but I don't want that action to occur repeatedly every tick - just at the start-up. Is that how On Loading Finished works?

  • Ashley - Ah, I see. That'll have to wait until later. Documentation is one thing I know I don't know a thing about... But thank you, at least that filters out some of the confusion for when I'm ready to implement controller schemes.

  • Ashley - Is there a quick-list of what USB controllers C2 supports and on which browsers?

  • blackhornet

    THANK YOU! That pretty much solved the present dilema... I'm just glad I already had figured out how to insert sub-events (that indented black line with the arrow showing where the event is being sidled into). I think I had something similar in mind at ONE point while trouble-shooting, but yeah, I believe this is the solution I'm ultimately looking for (until nested-boolean comes around).

    I appreciate your feedback. :)

  • I'm trying to set up certain animations to take place when individual and multiple buttons are pressed. When a single button is pressed, one animation will occur. But when that same button plus another is pressed together, a different animation will happen. What I want to do is test for different instances of conditions for the same possible event. It would go something like this:

    ==============

    | CONDITION 1

    | [AND]

    | CONDITION 2

    |

    | [OR]

    |

    | CONDITION 1

    | [AND]

    | CONDITION 3

    --------------

    | --> EVENT 1

    ==============

    I'm basically wondering if it's possible - in some way - to set up a combination of Boolean conditions to result in the same event.

    I've try setting up groups - something I apparently need to learn more about and how they function - but that hasn't yet solved my current problem.

    My THINKING would result in something like this:

    ==================

    | CONDITION 1

    | GROUP

    | - CONDITION 1.1

    | - CONDITION 1.2

    ------------------

    | --> EVENT 1

    ==================

    Does that make sense?

  • GeometriX

    Thank you. Actually, I managed to figure something very similar out (if not identical in run time/execution). This is what I have so far:

    KEYBOARD | W is down

    --> Player | Set animation to "IdleToJump" (play from beginning

    --> System | Wait 0.15 seconds

    --> PlayerBox | Simulate Platform pressing Jump

    -------------------------------------------------------------------

    PlayerBox | Platform is Jumping

    --> Player | Set animation to frame 6 [of the "IdleToJump" animation]

    --> System | Wait 0.15 seconds

    -------------------------------------------------------------------

    PlayerBox | Platform On landed

    --> System | Wait 0.15 seconds

    --> Player | Set animation to "Idle" (play from beginning)

    Even disabling System | Wait 0.15 seconds under Platform On landed

    OKAY! That's what I got as far as all of that goes. It seems to work well for the MOST part.

    But a new "problem" arose. I want to be able to hold the W button is down, I want my Player to jump repeatedly until I let off the W. But in doing this, instead of staying on frame 6 of my jumping animation, it recycles between frames every 0.15 seconds. I wanted it to end on frame 6 until the collision with a platform sprite.

    If I set it to KEYBOARD | W is pressed, then everything runs as it SHOULD, ending on frame 6 of the jump animation, but holding the W down won't make the Player continually jump until I let off the key. I'm not sure if I need to group conditions together or have separate conditions with their own events to respond with...

    It occurs to me that the endless jumping may not be viable in a game (this is just me learning the works and trying to figure stuff out), but I'd like to understand what I am perhaps overlooking or could try otherwise. ... Does that all make sense?

  • I'm afraid I'm only partly understanding your question, too. (Not that I'm knowledgeable enough to actually help you out with your problem.)

    If I may suggest, though... Try listing exactly what you want to happen in a step-by-step list. For example:

    1. This is the current status

    2. Something begins to happen

    3. Upon a specific event...

    4. ...this result should occur (except I don't know how to get that event to work)

    I hope that help you to convey your question better so others can help you. :) Keep gamin'! You'll get it worked out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a jump animation I want to employ, but the actual jumping action takes place before the animation is ready for it. The animation has my character crouching down for a few frames before he is ready to leap into the air. However, upon keypress, he's already in the air. I found the System/Time/Wait event, but that only delayed when the animation started...my character got launched then decided, "Oh, wait, I'm suppose to jump now." Heh, any help, please? :)

  • I would be interested in learning if this is possible, too.

    retrodude : Are you trying to mimic the SNES console feature?

  • XBox 360 controllers should work with the Gamepad object.

    Thank you, Ashley. Is there a running list of which USB controllers (by brand or console type) that work beside the XBox 360?

  • So when the time comes that I implement a USB controller for my game, don't test using Chrome? I assume IE and FF browsers are okay?

    Thank you for the info. :)