time-scaling and time-delta for INDIVIDUAL objects?

New releases and general discussions.

Post » Wed Jul 15, 2009 12:18 pm

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
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Wed Jul 15, 2009 12:49 pm

Have you tried event groups?
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed Jul 15, 2009 1:32 pm

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
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Wed Jul 15, 2009 2:22 pm

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: [size=150:16xhlxuo]Override Timedelta for Animations" Checkbox[/size:16xhlxuo] 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.[/quote:16xhlxuo]

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.

[quote="Holymonkey":16xhlxuo]so all the game slows down but he does not... and maybe certian other characters do not as well.[/quote:16xhlxuo] 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.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jul 15, 2009 2:25 pm

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
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Wed Jul 15, 2009 2:55 pm

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!
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Wed Jul 15, 2009 4:14 pm

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.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Wed Jul 15, 2009 4:17 pm

but if i set timescale to zero for a total time freeze or a pause menu, multiplying by any number is still zero, no?
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Wed Jul 15, 2009 4:59 pm

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.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Wed Jul 15, 2009 5:10 pm

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 ;)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest