1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Question - IDE Tile Animations: Why is the frame number locked to powers of 2?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Pixelated_Pope, Nov 6, 2016.

  1. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    I mean, I can guess that it's some sort of crafty optimization, but is it really necessary? Couldn't it be possible to allow us to decide whether we want/need that optimization in our games? It just seems really inconvenient and will force me to design my animations to fit yoyo's requirements rather than let me design the animations as I see fit.

    Just my two cents.
     
    RichHopefulComposer, Rukiri and Juju like this.
  2. xot

    xot GMLscripter GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    114
    If you read Mike Dailly's tweets from about 2.5 years ago, you'll find your answer. I'm afraid I can't recall the details.
     
    Last edited: Nov 6, 2016
  3. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    As I use it more and more I find more and more frustrating things about it.
    First off, if the width or height of your sheet changes at all, all your animations are broken, even if the positions relative to the top left corner haven't changed. This seems unacceptable. If I need to alter my tile sheet drastically, of course my animations can't adapt without an extreme amount of work on GM's part, but if the relative position of those frames hasn't changed, why has my entire animation been destroyed? Hopefully this is just a bug, because it's infuriating.

    ESPECIALLY when compounded with the fact I can only do one tile at a time. I have 6 "groups" of tiles that all animate together. Yet I have to define each individual member of the group one at a time? So frustrating, especially when all that hard work is destroyed by the above issue.

    Tile animations are an exciting edition, but in their current state, I'd rather use the method described in my tutorial using sprite_assign().
     
    Last edited: Nov 6, 2016
  4. Baku

    Baku Member

    Joined:
    Jun 21, 2016
    Posts:
    11
    +1 to this. I was playing with auto tiles and brushes yesterday, changing the sprite dimensions also messes these things up. Suuuper annoying.
     
    Last edited: Nov 6, 2016
  5. renex

    renex Member

    Joined:
    Jun 23, 2016
    Posts:
    506
    I'd imagine it would be because of the same problem I ran into while making my own solution for this a couple months ago...

    Animations need to be in sync with each other, or you'll have to make a different set of vertex buffers for each sprite, and that's very wasteful. If all animations are powers of two, you can simply repeat the smaller animations to pad them up to the longer ones and that allows you to use a single list of vertex buffer objects to render everything.
     
  6. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    Probably true, but I shouldn't be cut off from the option. I have many 3 frame animations. Where's the nearest multiple of 3 that is a power of 2? Oh, that's right, there's no such thing as a multiple of 3 that is also a power of 2. So not all animations can be "padded". This forces me to change my animations from my desired way to fit the yoyo way.

    I understand that it's all about efficiency, but let me make that choice as a developer. Maybe my game is simple enough that the performance hit is negligible.
     
    RichHopefulComposer likes this.
  7. xot

    xot GMLscripter GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    114
    I found some good info and early talk about the new tile system, which you may find interesting, but nothing on the power-of-two thing — and man, I've looked. Maybe I read it on Skype. Anyway, if you want to know more about the system, read Mike's posts in these topics.

    http://gmc.yoyogames.com/index.php?showtopic=581287&p=4294015
    http://gmc.yoyogames.com/index.php?showtopic=583235&p=4608393

    After reading those, you may have some ideas about how to do a tile shader of your own. I made a basic one and it was dead simple. Maybe you can get the features you want that way.
     
    Blackened, ParodyKnaveBob and renex like this.
  8. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    Thanks, Xot. I'll give them a read.
     
  9. Juju

    Juju Member

    Joined:
    Jun 20, 2016
    Posts:
    412
    I vaguely recall something as well, but I couldn't say anything more than that. I remember some kind of implementation of Sonic tiles?

    I find it fascinating that this post from three years ago basically describes the entirely of GMS2's layer and tilemap functions.
     
    Last edited: Nov 6, 2016
    renex and Mike like this.
  10. Mike

    Mike nobody important GMC Elder

    Joined:
    Apr 12, 2016
    Posts:
    2,393
    Keeping things a power of 2 lets us align animations of different sizes, and help future proof the rendering of it. It means we can easily put all animations on a texture without having to worry about large sizes and having to find a common repeating number for 1000 different animation sizes.

    POW2 sizes are easy, and will let us render everything in a shader - if we want to, down the line.

    Also, lets not forget there is nothing now stopping you using a sprite on an asset layer to animate sections of your map if its an odd size, and you can still use an object if your animation needs logic to it. Tile animations are designed to be incredibly quick, and allow the whole map to animate if desired. But the new asset layer allows you to fine tune areas, or to place animations in larger objects.

    They are all tools to use, you don't need to be feel limited by the POW2 number, it's only one of the tools available to quickly animate your world.

    Yeah.... been a wish for a looooong time. :)
     
  11. renex

    renex Member

    Joined:
    Jun 23, 2016
    Posts:
    506
    I love when this happens!
     
  12. Pixelated_Pope

    Pixelated_Pope Member

    Joined:
    Jun 20, 2016
    Posts:
    787
    The only issue with that is that you can't "paint" with assets like you can with tiles. Otherwise that would be a fine alternative.
     
    Last edited: Nov 7, 2016
  13. xot

    xot GMLscripter GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    114
    You can paint tiles which can be replaced by instances or otherwise augmented at runtime. See: Dungeon Demo > oController_Lighting
     
  14. Mike

    Mike nobody important GMC Elder

    Joined:
    Apr 12, 2016
    Posts:
    2,393
    Hold down ALT with a sprite/object selected and you can.
     
    JeffJ likes this.

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