• 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!

The Physics world and Delta timing

Nux

GameMaker Staff
GameMaker Dev.
Hiya,
I've been trying to make the physics world work within my game for about an hour now and I just... can't... do it! I have all the physics working at normal speed but when the player lags, the physics world slows down (which I know it should because of a lack of delta timing; it makes sense).

I know how to use delta timing, and that isn't the problem .. The problem is: how would I speed up the physics world on low FPS'?

I've tried using:
Code:
physics_world_update_speed(120*global.delta);
(120 is my game speed/room_speed) (global.delta is the variable from which the result of delta timing is stored)

However, it seems to make absolutely no difference; the physics world still slows down while the game world stays at a constant speed.

I'm not exactly savvy with the physics world quite yet.
Am I doing something wrong?

EDIT: I've found that setting my room_speed to the fps fixes the problem, but this is a bad idea.
If anyone knows how to fix this without altering the room_speed, that'd be great! QvQ

EDIT #2: I've decided to opt for:
Code:
if ( fps < global.framerate_limit )
    room_speed = fps;
else
    room_speed = global.framerate_limit;
Can someone who is more knowledgeable in how game maker functions below the bonnet tell me if this is a good/bad thing to do? Thank you!
 
Last edited:

Nux

GameMaker Staff
GameMaker Dev.
Bumping to see if I can get some input regarding changing room_speed dynamically. Is it good/bad?
 

Mornedil

Member
I'm also bumping this, as I'm surprised nobody has replied yet.. I've been watching this thread from day 1 because I'm wondering the same thing.
 

Nux

GameMaker Staff
GameMaker Dev.
@Zerb Games , I assume yes; what I had found was the gameSpeed/room_speed does need to be limited using an FPS limiter since the physics world is dependent on the room speed.

Another solution would be to constantly pause and unpause the physics world, but that doesn't sound very efficient.
 
Top