How can I add proper animations to my game?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
RzExfeL
Prole
Posts: 6
Joined: Tue May 30, 2023 2:57 pm

How can I add proper animations to my game?

Post by RzExfeL »

Hi. I am making a new game and gui elements are almost done. I want to get to animating but I encountered a problem. I was thinking about exporting my animations as ogv videos but apperantly they cannot be transparent. Meaning that all of my animations has to have a black background, which I do not want. How can I import transparent videos or is there a different way of importing animations that I do not know?
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: How can I add proper animations to my game?

Post by GVovkiv »

Images sequence?
Then you could try one of this libs, that can do that for you:
https://github.com/love2d-community/awe ... #animation
https://github.com/kikito/anim8 - better for spritesheet animations.
https://github.com/davisdude/Walt - better if you don't want/can't deal with spritesheets and load frames in different manner.
RzExfeL
Prole
Posts: 6
Joined: Tue May 30, 2023 2:57 pm

Re: How can I add proper animations to my game?

Post by RzExfeL »

GVovkiv wrote: Sat Jun 03, 2023 5:30 pm Images sequence?
Then you could try one of this libs, that can do that for you:
https://github.com/love2d-community/awe ... #animation
https://github.com/kikito/anim8 - better for spritesheet animations.
https://github.com/davisdude/Walt - better if you don't want/can't deal with spritesheets and load frames in different manner.
I do not want spritesheet animations since my animations are going to be really complex and as much as I know spritesheets don't allow complex animations. As for the Walt link you have given me, I couldn't get it to my game it just gave a bunch of errors. And sorry if I am missing something obvius I am not really familiar with them.
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: How can I add proper animations to my game?

Post by GVovkiv »

RzExfeL wrote: Sat Jun 03, 2023 7:51 pm I do not want spritesheet animations since my animations are going to be really complex and as much as I know spritesheets don't allow complex animations. As for the Walt link you have given me, I couldn't get it to my game it just gave a bunch of errors. And sorry if I am missing something obvius I am not really familiar with them.
What exactly "complex" animations mean here?
Your game use frame-to-frame animations for some objects? Like, character which can have different states that need different animations. For example, running animation, standing, walking, attacking, etc?
Then using spritesheets/every frame in different file/etc shouldn't be problem, so anim8 or Walt should be enough.

Until then, i'm not sure why would you want use video for animations (at least, if it's not in-game movies, where you could benefit with saved space of video formats), especially with transparency (considering, that videos not really was meant to have alpha channel because why?) when, usually, done with some spritesheets or sequence of image files. In some cases might be used gifs or even custom formats, but, yet again, what exactly you trying to achieve?
RzExfeL
Prole
Posts: 6
Joined: Tue May 30, 2023 2:57 pm

Re: How can I add proper animations to my game?

Post by RzExfeL »

GVovkiv wrote: Sat Jun 03, 2023 8:03 pm
RzExfeL wrote: Sat Jun 03, 2023 7:51 pm I do not want spritesheet animations since my animations are going to be really complex and as much as I know spritesheets don't allow complex animations. As for the Walt link you have given me, I couldn't get it to my game it just gave a bunch of errors. And sorry if I am missing something obvius I am not really familiar with them.
What exactly "complex" animations mean here?
Your game use frame-to-frame animations for some objects? Like, character which can have different states that need different animations. For example, running animation, standing, walking, attacking, etc?
Then using spritesheets/every frame in different file/etc shouldn't be problem, so anim8 or Walt should be enough.

Until then, i'm not sure why would you want use video for animations (at least, if it's not in-game movies, where you could benefit with saved space of video formats), especially with transparency (considering, that videos not really was meant to have alpha channel because why?) when, usually, done with some spritesheets or sequence of image files. In some cases might be used gifs or even custom formats, but, yet again, what exactly you trying to achieve?
I already exported some of my animations as ogv files thinking that would be right. I tried to integrate walt but it didn't work. I am going to try to do spritesheet but I am not a fan of it. That is why I chose videos at first.
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Re: How can I add proper animations to my game?

Post by BrotSagtMist »

I dont know why but everything flinches inside of me if i read this playing as a video.
I dont get why everyone is using spritesheets, thats just adding extra work.
just play it picture by picture.
obey
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: How can I add proper animations to my game?

Post by GVovkiv »

RzExfeL wrote: Sat Jun 03, 2023 7:51 pm I already exported some of my animations as ogv files thinking that would be right. I tried to integrate walt but it didn't work. I am going to try to do spritesheet but I am not a fan of it. That is why I chose videos at first.
Then export every frame of animation as separate file? Like, why you can't re-export to images sequence and using Walt (or other animations libs) import them? I still don't understand why you trying to use video format for that.
And tell us what exactly "walt throws errors" means so we can try to fix it.
Last edited by GVovkiv on Sun Jun 04, 2023 8:50 am, edited 1 time in total.
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: How can I add proper animations to my game?

Post by GVovkiv »

BrotSagtMist wrote: Sat Jun 03, 2023 10:38 pm I dont get why everyone is using spritesheets, thats just adding extra work.
Personally, i like using spritesheets approach only because with that, i can easy avoid clusterfuck of assets.
For example, i could put all running animations of certain character (e.g, left side, right side) in single file and place it in "/assets/character/running.png" and if in future i will add more animations, i will put new one in that file and i'm done.
Without them, i would need do something like:

Code: Select all

/assets/chacter/running/left/1...5.png
/assets/chacter/running/right/1...5.png
Also exporting all of this would be nightmare, since i have 1 single source file where i store all running animations for character, and i can simply export everything as single spritesheet, while with non-spritesheet approach i need to somehow manually (or by some scripting, if program where i draw my sprites and animations, have it) export every animation in it's folder.

It's just much clearer for me to have single folder for something (like character sprites, or maybe some level decoration) and store every unique animation in separate spritesheets then deal with folder after subfolder to string them.
User avatar
BrotSagtMist
Party member
Posts: 604
Joined: Fri Aug 06, 2021 10:30 pm

Re: How can I add proper animations to my game?

Post by BrotSagtMist »

But the extra step of cutting it down is such a showstopper.

Currently my method is one folder per character, i scan the contents and then import everything.
The naming scheme is r01.png (right movement, first frame) etc.
And this is why i scan: Each file may be accompanied by additional files that add effects, if there is a d05.mp3 this will play when this frame is played adding for example footsteps with pinpoint timing.
obey
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: How can I add proper animations to my game?

Post by GVovkiv »

BrotSagtMist wrote: Sun Jun 04, 2023 1:38 pm But the extra step of cutting it down is such a showstopper.
Not big issue, honestly.
In return you got more clear file structure, less subfolders, less files.
It's big win in my book, since i have troubles with remembering stuff, so less subfolders and files - better for me.
I would rather have several "CharacterRunning.png", "CharacterMoving.png", "CharacterAttacks.png" spritesheets in "Character" subfolder, then "Character/Running/r01...100.png", "Character/Moving/r01...100.png", "Character/Attacks/r01...100.png". It's make searching for specific animation or sprite easier for me, then digging all of that crap. Especially bigger file collections.

(And, honestly, spritesheets works better when you use them visually (like in engines). For example, in Godot, i can create spritesheet resourse, specify there anything that i need, save and load it on animation/sprite node. I can even easily export it to different project.)
The naming scheme is r01.png (right movement, first frame) etc.
And this is why i scan: Each file may be accompanied by additional files that add effects, if there is a d05.mp3 this will play when this frame is played adding for example footsteps with pinpoint timing.
I also like to store images, sounds, scripts in separate folders, so it would not work for me.
There should be 1 source for triggering stuff (like sound for specific frame) and it should be script. Otherwise, i can unironically accidentally copy file in wrong folder (for example, with your method, i can copy file "d03.mp3" from one animation folder to 2nd, where exist animation with needed amount of frames) and wonder for 30 minutes "why this sound plays?".
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests