Godot Version
4.2.2
So essentialy I have a problem with AnimatedSprite2D. I want to create a FNaF based game (I rendered every animation and frame in blender before) and I’ve run in some issues. When I try to run the game, even though the AnimatedSprite2D is turned off hidden and none animation is playing, the game only displays the godot logo and doesn’t load and straight up crashes after a while. I’ve checked and this is the node that makes the problem. Have anyone any idea what to use (what node) or how to solve this problem. The frames are 2gb in size and all of that 2gb were placed into seperate animations in animatedsprite2d.
Two gigabytes?! I hope that’s for all of them and not each individual frame…
In either case, you almost definitely want to optimize your images - Run them through basically any PNG optimizer and make sure they’re not bigger dimensions than you’d expect someone to be playing the game at.
Hi. Thanks for responding. 2 gb of data is the total size of frames. I was thinking of optimizing the images but I didn’t want to really do it because the game graphics are 100% based on these frames, so I want them good quality. Every frame is 1920x1080 as well at the game viewport (1920x1080). Essentially what I did is I divided the animations in like 10 different SpriteFrames and loaded them in my code. It worked but is still draining 4 gb of ram.
The thing about PNG optimization is that most of it is lossless - most things encode PNG data really poorly, and so you can optimize it without it looking visually worse.
1 Like
I definitely think you need to think of a different approach than animations with 2 gigabytes of unoptimized/high quality 1920x1080 frames. No games does that, not even triple A games, and there’s a reason for that.
You could use a video player instead of an AnimatedSprite2D. And in blender, generate a video instead of individual frames. I even think you could get away with a 1920x1080 video, but I’d recommend you lower that resolution. If it’s an indie game, nobody will expect you to have a fullHD high quality game, people will be fine with something with decent quality.
Or you could use the same workflow that any 3D game dev uses, just export the 3D models into Godot and animate them on 3D. Probably add some sort of retro shader if you want a FNAF look.
https://godotshaders.com/?s=retro
Thanks, I’ll try to optimize it then.
I was thinking about it. But I’ll try to optimize all of these frames and if the game takes up to 3 gb of RAM i think I’ll stick with my frames. The 3d models cant go into the count because of high quality 3d rendering with very advanced lightning and shaders, thus I didn’t want to go into the engine with 3d.