Y
yuki
Guest
Okay so although i've gotten pretty far in my game, im still roughly in the alpha stages, meaning right now may be the optimal point in setting up delta time. I have a few enemies and a player but most of them use the same style to move. I recently downloaded this to check out how it works
https://marketplace.yoyogames.com/assets/1149/steady-delta-time
and i get the gist of what he's doing and what not. But there are some questions before i make the leap in converting my game into delta time. My game is built around the room speed of 60 (the ideal fps)
So i know that Alarms and other built in features are not going to work, luckily i have very minimal alarms to begin with. As for the Sprites, what ive been doing so far is duplicating my frames to get precise animations sometimes it racks in around 40 frames. does that mean Image_speed wont work anymore?
in the example he wrote
i noticed that he put the imagepersecond variable to 10 for animations with non duplicated sprites so when i put in my sprites to test it didnt work. Instead I put 60 and that pretty much set it to the correct animation.
Another thing i wanted to ask is how would i convert the custom gravity and speed engine to work with delta timing because i cant seem to figure it out. Would i multiply everything by 60*delta time?
the reason why i say * by 60 for everything is because when i created a custom timer called time
i had to do this for the desired effect of subtracting by 1 "per step"
I also noticed that the alternate synchronization method keeps the game at a solid 60 fps, if i check this on does that mean i won't have to do Delta timing?
https://marketplace.yoyogames.com/assets/1149/steady-delta-time
and i get the gist of what he's doing and what not. But there are some questions before i make the leap in converting my game into delta time. My game is built around the room speed of 60 (the ideal fps)
So i know that Alarms and other built in features are not going to work, luckily i have very minimal alarms to begin with. As for the Sprites, what ive been doing so far is duplicating my frames to get precise animations sometimes it racks in around 40 frames. does that mean Image_speed wont work anymore?
in the example he wrote
Code:
image_speed = imagesPerSecond * global.dt_steady;
Another thing i wanted to ask is how would i convert the custom gravity and speed engine to work with delta timing because i cant seem to figure it out. Would i multiply everything by 60*delta time?
Code:
////Step Event
//Set up gravity
if !place_meeting(x,y+1,Wall)
{
if pause=false
{
//Vspeed + the gravity
vsp+=grav
}
}
///Update Y
cy += vsp;
vspNew = floor(cy);
repeat(abs(vspNew))
{
if (!place_meeting(x, y + sign(vspNew), Wall))
y += sign(vspNew)
else
{
vsp = 0;
break;
}
}
///Pressed Jump Key
if (place_meeting(x, y+1, Wall))
{
if (keyboard_check_pressed(vk_up))
{
vsp=-5.5
sprite_index=jump;image_index=0
}
}
the reason why i say * by 60 for everything is because when i created a custom timer called time
Code:
time-=round(60*global.dt_steady)
I also noticed that the alternate synchronization method keeps the game at a solid 60 fps, if i check this on does that mean i won't have to do Delta timing?
Last edited by a moderator: