Physics and time scaling

For questions about using Classic.

Post » Fri Aug 20, 2010 8:35 pm

Hello,
I'm using the physics behavior in my game and I set up a time scaling effect. Unfortunately time scaling does not affect the physics behavior. When everything slows down then stop, some sprites keep falling at the same speed for instance.
I tried to reset the world gravity every tick with a multiple of timedelta. It worked but as I expected not the way I would have wanted it to :? . It did not slow down, the gravity simply disapeared.

How should I make the physics behavior respect my time scaling :?:
B
4
S
1
G
2
Posts: 30
Reputation: 910

Post » Sat Aug 21, 2010 1:05 am

You could try to tweak the world scale (both x and y at the same time) reverse relative to the time scale (the lower the timescale, the bigger the world scale)

To be honest I never really understood what world scale is for, but your objects move slower the higher these values. If you set just the x or just the y the coordinates ratio is also distorted. (sry, I can't explain this, just see for yourself)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Aug 21, 2010 4:44 am

World Scale makes everything go slower because it's increasing the size of the universe in which the physics are acting. Large objects further away appear to fall slower than small objects near to the viewer.

Pixels aren't an absolute unit of measurement - picture looking at the world through a screen door. The gaps in the screen are pixels. The further back you go, taking the screen with you, the more area is covered by each 'pixel' and thus the fewer pixels it will fall in a given timespan.
B
2
S
1
G
2
Posts: 35
Reputation: 870

Post » Sat Aug 21, 2010 1:59 pm

World Scale is not available in the event sheet editor. I cannot change these values at runtime :(

When my character dies, time slows down and then stops. It takes less than 1 second so when my character dies, I "Always (every tick)" set velocity to (0,0) and angular velocity to 0. It is not smooth but it will be ok until a timedelta based physics behavior.
B
4
S
1
G
2
Posts: 30
Reputation: 910

Post » Sun Aug 22, 2010 7:14 am

I just recently posted a thread here "Fix Your Timestep" which essentially illustrates this problem and even includes a comprehensive fix for it.

At this point, it's up to the developers.

Well, this is open source, I guess I could post a patch. Not something I'm able to dive into right now, unfortunately.
B
3
G
2
Posts: 31
Reputation: 737


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests