is it worth updating position every x ms?

0 favourites
  • 8 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Yo,

    Do you guys think it is worth it having different objects positions being updated every x milliseconds? Did it gave any of you better performance?

  • It can, and does in instances where you have LOADS of objects updating position - particularly container objects (or shadow caster).

    It can also reduce the fluidity of motion though, and make it "feel" janky even though it's not janky. Also be aware that there is a minimum time for a tick to process (I think it's 0.16 seconds) so setting your timer to less than that means it's running the same as "every tick".

    ~Sol

  • It can, and does in instances where you have LOADS of objects updating position - particularly container objects (or shadow caster).

    It can also reduce the fluidity of motion though, and make it "feel" janky even though it's not janky. Also be aware that there is a minimum time for a tick to process (I think it's 0.16 seconds) so setting your timer to less than that means it's running the same as "every tick".

    ~Sol

    Thanks. Yeah, I do notice a stutter, either way thought. I have set every x s between 79ms and 120ms originally. I did ask about position, but actually it was a general question, cause I use that to check distance between player and object and turn physics on and off as well as opacity. Maybe there is a better way. Or maybe some of it isn't even necessary?

  • setting position by x and y coordinates with system expression seems a bit pricey to me. why not use just some movement behaviours to do it? (custom or bullet), i think they're more optimized for performance then setting x and y every z miliseconds.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • setting position by x and y coordinates with system expression seems a bit pricey to me. why not use just some movement behaviours to do it? (custom or bullet), i think they're more optimized for performance then setting x and y every z miliseconds.

    Heya, I do use pin if I want object to follow. Now, I really should have be more precised, because I am mostly turning physics on and off as well as set opacity, both depending on the distance from the player, every x ms, however I am not sure if that's necessary ( although my levels have floors, so I'm checking z position of the player based on other events, from which I turn on or of tiles physics).

  • so you use pin to make an object follow yours but when it gets on some distance it changes it's physics on and off ?

    why not just leave physics on for it? or is the physics for player?

    if you can't do it any other way - check every 200ms, that's about 5x a second, seemed to work best for me in my game when i did rotation (360 frames, each 0.2sec instead of each tick for 1°) worked like a charm and saved a lot of processing

  • so you use pin to make an object follow yours but when it gets on some distance it changes it's physics on and off ?

    why not just leave physics on for it? or is the physics for player?

    if you can't do it any other way - check every 200ms, that's about 5x a second, seemed to work best for me in my game when i did rotation (360 frames, each 0.2sec instead of each tick for 1°) worked like a charm and saved a lot of processing

    Cool. That gives me a good idea of how to use it. Thanks.

    I ave loads of objects that change opacity depending on the distance as well as objects that change their physics depending on players virtual z position.

  • Cool. That gives me a good idea of how to use it. Thanks.

    I ave loads of objects that change opacity depending on the distance as well as objects that change their physics depending on players virtual z position.

    Opacity can easily be changed to Every 0.1 - 0.2 seconds, you won't notice much difference. Movement/position can be a little bit jumpy if you set it too low. I'm not sure if it would use less performance or not, but you could lerp between postions if you set the poisition as low as every 0.2 seconds. I did that in my multiplayer game for other players since I'm just recieveng their position evey 0.2 seconds, but on your scale with many objects I'm not sure it would be very efficient. Worth a try maybe?

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