• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE Image Editor speed adjusts in-game speed?

deepfry3

Member
Hi!

I've noticed in Game Maker Studio 2, the speed selected in the animation preview within the image editor seems to effect the sprite's image speed within a game.
GMS2.PNG

Even when using 'image_speed' in GML, the value given seems to act as a multiplier of the speed defined in the image editor (image_speed = 1 actually results in 1 x speed defined in image editor), despite the help documents stating "a value of 1 will cycle one image per step".

Does anyone know if this is intentional? If so, I can get behind that, but it seems strange that the toggle for looping, not looping or ping-pong animation has no effect within the game. It would make my game a lot easier since I have a lot of opening/closing animations which just need to play, then play backwards.

Any thoughts?
Thanks :)
 

rIKmAN

Member
I came across this issue myself when my Spine animations were playing in slow motion in GMS2.
Took me about 15mins to work out what was going on (including testing the same code in GMS1, which was fine), but I agree it is a little strange and not explained very well in the manual.
 

Hyomoto

Member
No matter what you set that value to, it will have no impact on the in game sprite speed. If it is, it is most definitely a bug since that value isn't saved as part of the running game, it's only for the IDE. image_speed is the number of frames image_index will be advanced each step; to test simply:

Code:
show_debug_message( obj.image_index )
You'll see whatever you set image_speed to is how many frames are added each step. That value is absolute. What will affect how it appears is game speed. A value of 1 is significantly slower at 30 fps than 60 fps.
 

deepfry3

Member
No matter what you set that value to, it will have no impact on the in game sprite speed. If it is, it is most definitely a bug since that value isn't saved as part of the running game, it's only for the IDE. image_speed is the number of frames image_index will be advanced each step; to test simply:

Code:
show_debug_message( obj.image_index )
You'll see whatever you set image_speed to is how many frames are added each step. That value is absolute. What will affect how it appears is game speed. A value of 1 is significantly slower at 30 fps than 60 fps.
This is definitely how it always worked for me in any previous version of Game Maker, but in any project in Game Maker Studio 2, adjusting the frames per second in the Image Editor definitely affects its speed in the game.

I added the debug message for an instance's image_index every step. Here's what it looked like when the Image Editor FPS was set to 1:
fps = 1.PNG

And here's what it looked like when the Image Editor FPS was set to 100:
fps = 100.PNG

Definitely affects it. The only thing I changed was the value in the Image Editor. No code.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Yes the way it works has been changed for GameMaker Studio 2. image_speed is now a multiplier and will set the speed based on the value assigned in the image editor.
 

deepfry3

Member
Yes the way it works has been changed for GameMaker Studio 2. image_speed is now a multiplier and will set the speed based on the value assigned in the image editor.
Got it, thank you. If that is the case, it seems the GMS2 support documents have not been updated to reflect that.

Do you know if the loop/ping-pong/play-once button directly to the left of speed in the Image Editor is intended to have an effect on the Sprite in the game? If not, is there an easy way to toggle between those modes for game appearance?

Thank you for your help.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Got it, thank you. If that is the case, it seems the GMS2 support documents have not been updated to reflect that.
Yeah, just been checking that. Since it's me that actually writes the documentation I'll sort it out. For now, how it actually works is like this:

This image_speed variable determines the speed in which GameMaker Studio 2 will cycle through the sub-images for the current instance sprite, and how it is used will depend on how you have set up the frame speed in the Image Editor. If the Image Editor has set the animation speed for the sprite used to be calculated as Frames Per Game Frame, then the speed value given is a multiplier, with 1 being the default value, and setting it to 0.5 will half the animation speed, while setting it to 1.5 will double it. However, if the IDE has set the animation speed for the sprite used to be calculated as Frames Per Second, then the speed value given is a literal frames per second value, so setting this to 5, for example, will set the animation to loop 5 frames every second that the game runs. If the sprite used has no sub-images, this variable will have no effect.

Do you know if the loop/ping-pong/play-once button directly to the left of speed in the Image Editor is intended to have an effect on the Sprite in the game? If not, is there an easy way to toggle between those modes for game appearance?
No it has no effect at the moment. I have suggested that the loop/pingpong ability be added as a default feature for sprites, but it's not something high on the priority list, especially as it's not too difficult to make such a thing yourself.
 

Hyomoto

Member
Wow, you learn something new every day. Sorry about the bad info then. To be honest, that sounds like an awful change. The system is already kind of obtuse as it is, now it has another layer of abstraction to it? Ugly.
 

deepfry3

Member
Yeah, just been checking that. Since it's me that actually writes the documentation I'll sort it out. For now, how it actually works is like this:

This image_speed variable determines the speed in which GameMaker Studio 2 will cycle through the sub-images for the current instance sprite, and how it is used will depend on how you have set up the frame speed in the Image Editor. If the Image Editor has set the animation speed for the sprite used to be calculated as Frames Per Game Frame, then the speed value given is a multiplier, with 1 being the default value, and setting it to 0.5 will half the animation speed, while setting it to 1.5 will double it. However, if the IDE has set the animation speed for the sprite used to be calculated as Frames Per Second, then the speed value given is a literal frames per second value, so setting this to 5, for example, will set the animation to loop 5 frames every second that the game runs. If the sprite used has no sub-images, this variable will have no effect.


No it has no effect at the moment. I have suggested that the loop/pingpong ability be added as a default feature for sprites, but it's not something high on the priority list, especially as it's not too difficult to make such a thing yourself.
Thanks for your reply, it was very helpful! That new method does make it a little more confusing, but it also makes it a lot easier than before to implement whether animations should happen per the game's speed or per actual second.

For what it's worth though, image_speed seems to act as a multiplier for me while Frames per Second is selected in the Image Editor as well.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
For what it's worth though, image_speed seems to act as a multiplier for me while Frames per Second is selected in the Image Editor as well.
I'll check this with the devs and update the manual accordingly. Cheers!
 

deepfry3

Member
I'll check this with the devs and update the manual accordingly. Cheers!
Thanks for all of your help both on here and in the manual :)
In the future, what should we do if we find another error in the manual? (Really I've only just found this and a few minor spelling mistakes)
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
In the future, what should we do if we find another error in the manual? (Really I've only just found this and a few minor spelling mistakes)
File a bug! Just go to Help > File a Bug in GMS and go through the forms... It'll get to me and I'll fix it asap. :)
 
N

NeutralD

Guest
I'll check this with the devs and update the manual accordingly. Cheers!
Sorry for bumping the topic. So, when you choose "Frames per game frame" mode it will still be a multiplier, right? No built-in delta timing yet?
 

Mike

nobody important
GMC Elder
If you use frames per second, then animations will be auto-corrected based on game speed.

If you use "frames per game frame", there is no delta timing or auto-adjusting, you have to do this yourself.
 
M

Marcus12321

Guest
This frames per second is also based off of the Room Speed that has been set. Not actual time that has passed between frames. Basically behind the scenes, it is still doing Frames Per Game Frame, just doing a math calculation on your Frames Per Second setting. So, if you set the room speed to 99999 or something to do Delta Timing, the animation will not run at a correct speed. It will run as if your game were running at 99999 frames per second.
 
Top