• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Can I update physics objects at room_speed?

S

Sp4m

Guest
In my heart of hearts, I want to use GMS physics in my top-down racer, but I'm using a mechanic that continuously augments room_speed to slow things down, and I found that the motion of physics objects were not bound by room_speed.

(I know binding game motion to room_speed is hacky, but it works WAY better than tracking/augmenting motion variables for all objects in-game).

This is the only reason I can't get physics into my physics game.

It will take me a bit of time to refactor my game for experimenting, so I wanted to ask experienced developers first.

Can I just use "physics_world_update_speed(room_speed)" to slow down the processing of physics objects in accordance with the room speed? Do I need to combine it with: "physics_world_update_iterations(1)" to force the physics system to slow down as well?

https://docs.yoyogames.com/source/d...physics world/physics_world_update_speed.html

https://docs.yoyogames.com/source/d...cs world/physics_world_update_iterations.html
 

andev

Member
Can I just use "physics_world_update_speed(room_speed)" to slow down the processing of physics objects in accordance with the room speed?
Yes, but make sure you set the room speed first because:
Code:
Note: you cannot currently set this to any less than room speed, but future updates may change this.

Do I need to combine it with: "physics_world_update_iterations(1)" to force the physics system to slow down as well?
No, iterations is the "quality" of the collision so leave that as is.
 
S

Sp4m

Guest
Update: This didn't quite work as I'd hoped, but I can work around it.
I was hoping that I could delay the processing of physics object motion by reducing the frequency that this value was computed, but it seems like physics objects are tied to a wholly separate clock (I thought that would be accessible via physics_world_update_speed, but it seems not).

In other words, I was hoping to reduce room speed by 50%, and reduce the motion and animation speed of objects in the game accordingly. In reality, physics objects just carry on at their previously defined speed, despite their now slower animations.

I think I'll be able to get my desired effect by physically slowing the object via physics_apply_local_impulse, along with some other non-physics variables (like image_speed).

... Unless anyone knows a way that I CAN use room_speed to slow the motion of physics objects?
(I know it's a poor practice, but it totally works *great* in my non-physics game)
 
Top