• 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!
  • 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 Tile Animations: Why is the frame number locked to powers of 2?

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.
 

xot

GMLscripter
GMC Elder
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:
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:

Baku

Member
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.
+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:
R

renex

Guest
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.
 
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.
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.
 

xot

GMLscripter
GMC Elder
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.
 

Mike

nobody important
GMC Elder
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.

I find it fascinating that this post from three years ago basically describes the entirely of GMS2's layer and tilemap functions.
Yeah.... been a wish for a looooong time. :)
 
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.
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:

xot

GMLscripter
GMC Elder
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.
You can paint tiles which can be replaced by instances or otherwise augmented at runtime. See: Dungeon Demo > oController_Lighting
 
Top