Physics values and time scaling request

This forum is currently in read-only mode.
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • I know I've mentioned this before, but I've ran into a situation where it would be good to have it fixed.

    Would it be possible to make the physics values in pixels per second? Because the player in my game uses physics right, but I want to apply that super speed thing that i made in that example a while ago, except that since physics values are inconsistant with pixels per second, it all goes wrong.

    Physics example: (not entirely real syntax)

    Set X Velocity to (cos(Player.Angle) * 200) * (1 / timescale)

    will not have the same effect as:

    custom example:

    Set X to Player.X + (cos(Player.Angle) * (200 * timedelta)) * (1 / timescale)

    will work fine

    Anyway, I'm pretty sure it's the physics value inconsistancy that's causing this problem because all the non-physics things on my player such as, rotation speed, jumping, all work fine with the super speed thingy.

    Although hopefully I'm wrong and it works fine and i'm just doing something wrong

    (also how do i post attachments? )

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh sorry, I forgot to mention that you only see the differences between the two if you are switching between a really low timescale (eg: 0.001) and normal timescale.

    I would upload an example but i dunno how to attach files in the forum like the devs do, that and I'm at college where there is rather high net restrictions

  • Physics should still respond to time scaling - I remember testing it - it should change speed appropriately. But you're right, it would be useful to have velocities working in pixels per second, but the maths behind it is a bit tricky (I'm not sure how to represent forces in terms of pixels...).

    You can upload files to the upload forum - us admins have omnipotent attachment powers

  • I've uploaded a little example in the uploads, you're right though, the physics objects DO slow down properly with timescaling

    But what i'm doing is speeding the player up the same ratio that timescaling slows everything down, making the player appear to be moving normal speed when if fact they're going really fast.

    Basically it's like:

    Left is down -- Set PLayer.X to .X + ((200 * timedelta) * (1 / timescale))

    The (1 / timescale) makes it so if the timescale is, for example, 0.5, meaning half speed, the player moves at 2 times faster than he normally would, making it look like normal speed but only on the player, everything else affected by timedelta will slow down.

    Anyway, the problem is, if i'm using physics values to do such a thing, the physics objects behaves differently to what the object would if i just made a custom movement for it, i THINK it's because the physics values aren't in pixels per second, but it could be some other factors too

    A similar problem happens with my super speed example, if motion blur is on, holding forward whilst slowing time down, makes the player jump around a bit, and if you're making him go like, 1000000 times faster, it's er quite interesting

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