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

Discussion in 'GameMaker Studio 2 Community Tech Support' started by deepfry3, Apr 25, 2017.

  1. deepfry3

    deepfry3 Member

    Joined:
    Apr 25, 2017
    Posts:
    8
    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 :)
     
  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    3,335
    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.
     
  3. Hyomoto

    Hyomoto Member

    Joined:
    Jul 7, 2016
    Posts:
    997
    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.
     
  4. deepfry3

    deepfry3 Member

    Joined:
    Apr 25, 2017
    Posts:
    8
    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.
     
  5. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,045
    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.
     
  6. deepfry3

    deepfry3 Member

    Joined:
    Apr 25, 2017
    Posts:
    8
    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.
     
  7. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,045
    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.
     
  8. Hyomoto

    Hyomoto Member

    Joined:
    Jul 7, 2016
    Posts:
    997
    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.
     
    Ethanicus likes this.
  9. deepfry3

    deepfry3 Member

    Joined:
    Apr 25, 2017
    Posts:
    8
    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.
     
  10. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,045
    I'll check this with the devs and update the manual accordingly. Cheers!
     
  11. deepfry3

    deepfry3 Member

    Joined:
    Apr 25, 2017
    Posts:
    8
    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)
     
  12. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,045
    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. :)
     
  13. NeutralD

    NeutralD Member

    Joined:
    Jun 21, 2016
    Posts:
    56
    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?
     
  14. Mike

    Mike Evil YoYo Games Employee Forum Staff Admin YYG Staff

    Joined:
    Apr 12, 2016
    Posts:
    2,288
    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.
     
  15. Marcus12321

    Marcus12321 Member

    Joined:
    Aug 29, 2018
    Posts:
    5
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice