time-scaling and time-delta for INDIVIDUAL objects?

This forum is currently in read-only mode.
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hi everyone,

    I'm the guy that originally requested a built in slow-motion variable for controlling the time-scale of the application. I'm thrilled with the timedelta control that Ashley implimented.. BUT I still wish there was an easy way to simply designate the time-delta PER object... or at least whether any particular object is effected by the difference in time delta.

    For instance, lets say I want the player to have a power to slow time, so all the game slows down but he does not... and maybe certian other characters do not as well.

    Is there currently an easy way to do this? Will I somehow have to manually controll and keep track of all the speeds of all of the animations(very many in this case), velocities and so forth for every character I want to "protect" from the timescale effect?

    thanks,

    Mike

  • Have you tried event groups?

  • Unless they have super-powers I'm unaware of (which is possible with the wonderful program which is construct) event groups wont offer me any help here...

    Another thing I want to do is totally pause time with time-scale set to zero and pop up a custom menu system WITH ANIMATED SPRITES. How can I keep sprites animated while time-scale is set to zero. And Whats the diference between time-scale and time-delta?

    Pardon my ignorance.

    thanks,

    Mike

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • making your game use timedelta'ed values just means it uses "frame skipping" when the game lags, and allows your game to be played with v-sync or unlimited frame rates while retaining the same relative gameplay speed. Timescale just controls the timedelta value (and a couple of other things), so it makes it possible slow the game speed down without changing the frame rate (ie. high frame rate slow motion)

    timescale affects animation of sprites, so i think you should ask for the feature:

    Override Timedelta for Animations" Checkbox

    but i think animations use milliseconds for timing, which timescale affects....

    [quote:16xhlxuo]UT I still wish there was an easy way to simply designate the time-delta PER object... or at least whether any particular object is effected by the difference in time delta.

    if you don't code your objects with timedelta, then they aren't affected by it.

    If you are using behaviors, they maybe we should ask for the feature to disable/enable timedelta use for individual objects/instances behaviors (at runtime?), if possible.

    so all the game slows down but he does not... and maybe certian other characters do not as well.

    There's no easy way to do this. You can try coding your own timescaling system where speeds of time effected objects are controlled through movement expressions which are influenced by "mytimevalue", if you want the whole game to be timedelta'd. As for "easy"... specialized things like this require some hands on eventing.

  • You could probably do this with just a variable for each object affected and use custom movements

    eg: (semi-pseudocode)

    Set .X to .X + ((sin(PlayerAngle) * MovementOffset) * timedelta) * CustomTimeVariable

    Set .Y to .Y + ((cos(PlayerAngle) * MovementOffset) * timedelta) * CustomTimeVariable

    ..or something like that, I haven't actually coded in a long time

    CustomTimeVariable would obviously be a value similar to timescale, 1 would be normal speed, 0.5 would be half speed, 2 is double etc

    However this is all theoretical and I've never tried it, but if I did, that is where I would start

    Or if that doesn't work, maybe:

    Set .X to .X + (sin(PlayerAngle) * (MovementOffset * CustomTimeVariable)) * timedelta

    That might work better, but I'm actually really crap at maths so I could be wrong with all those brackets :S

    The point is, use a custom variable instead of timescale and see the results

    Anyway good luck

  • right... unfortunately this means keeping track of countless "original animation speeds", and lots of coding custom movements for everything.

    I hope it might be possible to somehow "exempt" specified objects form the effects of time-scale. That would rock!

  • Could you possibly multiply the speeds at the rate you need? So simply set speeds to speed*(1-timescale)? Then you wouldn't have to code everything. Haven't tried it tho, so I don't know if it would work.

  • but if i set timescale to zero for a total time freeze or a pause menu, multiplying by any number is still zero, no?

  • If i remember correctly, the way i did it qith my ORL, i have created a family in to which i putetd every object i wanted to pause, and than condition with variable where 0 = move and 1 = stop. But there might be better way.

  • It's relatively easy if you code your own custom movements and animations and avoid the built in behaviors. You just need to multiply timedelta by your own value as somebody else described. It'd be difficult to make objects timescale independently - it would have to be coded individually per behavior, and what would happen to custom movements based off timedelta as well? How would you control their individual timescale? Which scale should the every event use? The simplest way is just to make your own system. It's not that hard

  • thanks for the clarification, Ashly. And thanks for the awesome authoring software!

    Unfortunately, does this mean theres no easy way to make a custom menu that pauses the game, but is animated? (without custom coding all movements and therefore not being able to use all the wonderful built-in ones)?

  • You could disable all behavior when pausing, then enable them after. Disabling stops them moving the object.

  • You could disable all behavior when pausing, then enable them after. Disabling stops them moving the object.

    That was my proposition too ><' in ORL it worked very well.

  • yeah, easiest way would be with families, if you dont want 'countless' vars to keep track of. if you're familiar with c++, making a custom behavior to do this would be nice and easy

  • thanks everyone for your input. I also discovered how wonderfully the "modal layout" layout object works for poping up animated menus. I love this feature and how it can be "transparent" and therefore not look like an awkward rectangle.

    By setting it to transparent I was able to create the illusion of animated sprites on screen WHILE the game is slowed down or paused.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)