Graphics Max Sprite Frames

kburkhart84

Firehammer Games
The most I've done is 32 frames at 256x256 in a single sprite. As far as I know, there is no real limitation on this as far as the software is concerned. I think you will run into issues faster with VRAM and performance before you will run into some kind of limit with frames per sprite.

That said, if you have a specific reason for asking(like something you are planning or wanting to do), maybe we can figure out the best way to go about that.
 

Pyrosix

Member
Well for the game im creating we have an animator that likes to make really detailed animations. He made a test reel that was 500 frames long and it crashed GMS when i tried to import the png sequence. So we downgraded to around 70 frames but it still bogs down pretty hard.

Edit: they are 1920x1080 sprites
 
Last edited:

kburkhart84

Firehammer Games
Those are pretty big sprites...it seems more like it should be a movie instead of a sprite animation. I'd expect you to have performance issues even if you do get the thing imported. I'd expect any other game engine to have similar issues. It seems you have most certainly crossed that line I'm referring to, where performance isn't going to be good enough even if you do get the thing imported.

Is this a single animation you are trying to import? Normally you would have split up sprites for different animations instead of putting them all together. Also, how are these things being created by the artist?
 

Pyrosix

Member
They're all individual pngs that i've imported into a single sprite. for example, one sprite for a twinkling background that has 70 frames of animation. Gamemaker doesn't seem to have any way to import mp4s so we just broke the animation he created down into individual pngs
 

kburkhart84

Firehammer Games
I don't know very many games that go that overboard with background animations. It's more common to use individual sprites for the animated elements(like the twinkling stars). And I wouldn't fault the game engine on this one, as I don't know of any other engine that could handle this massive data with ease either.

If you really wanted to do it like video, there are extensions that can handle it, though I don't think any are free. GMS2 doesn't handle video natively. I'm thinking you are just going to have to rethink the way you this, either animating smaller pieces and overlaying them on a static background, or just doing many less frames.

Think about it like this. If I understand it correctly, GMS2 isnt' doing anything fancy as far as compressing image data for the GPU. So it is working with 32 bytes per pixel(RGBA 8 bytes each). That's almost 8MB per frame at 1920*1080. Which is over half a GB, just for that one background. I'm sure that's why GMS is lagging on you at that point. That 500 frame animation you were looking at is going to be just under 4GB. That's more RAM than a 32 bit PC can even use. Modern PCs have 8, 16, or more still, but see how much memory that is using compared to total memory? Then you also have the GPU's memory to be concerned with. If you aren't on a gaming GPU you aren't likely to have more than a few GB RAM on the GPU so even if you did get the game to compile you would be constantly swapping textures to the GPU. Your typical high-end 3d game doesn't try to do what you are trying to do on a 2d game basically.
 

Khao

Member
That just sounds extremely inefficient and I can guarante that even a modern AAA game would never do something like that.

Half of game development is understanding your resources and working with them to do what you want. Is what you want impossible? In this day and age, usually no, but it's not gonna be as straightforward as you think. You need to find workarounds, take shortcuts, and do all sorts of tricks when drawing things on the screen that look more complex than they really are.

500 frames at 1080p is utterly absurd and there's no way you should be even considering doing that. Sounds dissapointing? It doesn't have to be! Just find another way. How is the background animated, exactly? Do they need to be individual frames? Can you use a static image and then separate all components into more simple, individual animations? Do you really need the full resolution? Do you really need the full framerate? Can the animations be shorter? Do they even need to be animations? Like, you mention you have 70 frames just for a twinkling background. Is there anything in those 70 frames that couldn't be done identically by using particles? If the whole background moves, can't you apply whatever effect was applied to it in real-time rather?

A lot of times you don't even have to make compromises, you just have to be clever.
 
Top