giusgad / pets.nvim

Display pets in your editor 🐱

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support other pets

nc7s opened this issue · comments

Kittens are cute, but I like dogs more, so please (let us know how to) add support for other pets, including dogs.

README said the cats are from https://seethingswarm.itch.io/catset. I bought the dog pack and want to "donate" it. How should I process the assets for use here? Also, please consider adding a link for Sponsor or other donation methods to let people donate other packs.

And, can we specify our own pets at other locations? I checked media/cat, seems each "breed" needs animations for 8 actions, each needing 8 frames. Capable users can make their own and share.

First of all, thank you for your support! If you already bought the pack for one of your projects, it's best to buy it again to be correct to the artist (you don't need to if you don't want to, I can buy it and set it up it's no big deal). While if you bought the pack exclusively for this plugin, you can set it up as follows and then create a pr to have it merged.

I wrote this script to set up the assets, and it should be easy to adapt if the pack is from the same author. As you can see, it uses gifsicle to extract the frames and then uses the convert command from ImageMagick to convert and resize the frames. It is not necessary for the media to have 8 fps, nor have the exact same animations, but it would probably help if naming were consistent. When the media is ready, all is left is to define which animations can follow which and the movements for dynamic animations like walking. If you need help with any part of this process, feel free to ask!

About specifying your own pets: as I said you don't need exactly 8 fps, but if an animation has more or less than 8 the frames will still be displayed 8 times every second, so a 12 fps animation will look slower than it was intended. This is anyway a minor issue, and I think dynamic fps support can be implemented fairly easily. As for which animations are needed there aren't specific restrictions but if the naming differs from the cat's animations, the new names will have to be coded (this should be easy too).
The only restriction that needs to be observed is the need to have at least one style inside the “breed”, for example if you only have one dog color you should still put it in media/dog/black/.

I'm not sure about setting up a donation system, as I didn't really think it was necessary, but I'll look into it soon.

I'm pretty sure I didn't forget anything, but if you need any further clarification, do reach out! Thank you again :)

The purchase is exclusively for this project, so no worries (I'd definitely buy again if I were to use it in my own projects, they are really cute).

I adapted the script a bit and successfully produced frame sequences and loaded the dog (only one in the pack so far, but there are other packs), though he's not immediately usable. The cats have those actions:

  • crouch
  • die
  • idle
  • idle_blink
  • liedown
  • sit
  • sneak
  • walk

While the dog has:

  • bark
  • crouch
  • dash
  • die
  • fall
  • fright
  • growl
  • hurt
  • idle
  • idle_blink
  • jump
  • land
  • sit
  • wallgrab

Some of the dogs actions cats don't have, vice versa for liedown, sneak and walk. I imagine they were hardcoded, causing M.Animation:next_frame() to index into a nil value on the dog. I'll take a deeper look later on.

The issue you're having might be caused by M.Animation.set_next_action, cause there the next action is set based on the current one and some of the dog's animations aren't present in the table. Also, you've probably already done this but make sure to put the pet animations in a subfolder even with a single style dog/<dog_color>/{all the animation folders}.
If you want you can open a draft pr so that we can better work together in implementing the necessary code, but it's not necessary, proceed as you prefer :)

On another note, I would for now remove animations like wallgrab, hurt and land (the cat had them too) because it would require adding more advanced movements like climbing on walls. While it is possible, I'm still not sure whether I will do it or not, so I just removed the animations for the time being.

Thank you again for your time and help :)

I guess we could use some kind of action link table: for example, idle => [crouch, liedown, sit, walk], sit => [sneak, walk, liedown], so the code can filter out unavailable next actions, and choose one from the remaining. Of course, this needs some thought, maybe also more work (since there'll be more combinations than hand written paths).

Yeah I know the directory structure enough to put it in {kind}/{breed}/{action} ;)

I'll be happy to help making additional actions work. Personally, though, I don't want the hurt (and die) actions, because, ya know, why would they hurt and die in a place without danger?

That said, I'm somewhat limited in work condition right now, so things will be slow on my side for a while.

And thank you for bringing those cuties into the editor!

I guess we could use some kind of action link table: for example, idle => [crouch, liedown, sit, walk], sit => [sneak, walk, liedown], so the code can filter out unavailable next actions, and choose one from the remaining. Of course, this needs some thought, maybe also more work (since there'll be more combinations than hand written paths).

Yes the plugin is already using that kind of structure to determine the next action, I will work on implementing the filtering you mentioned, and I'll let you know when I'm done.

Personally, though, I don't want the hurt (and die) actions

The die action is only used for when you close the pets if you have the death_animation option enabled, but if you don't want to include it I'm fine with it, after all it's your decision since it's you who bought the pack. I will change the code to avoid trying to play the animation if it's not present.

Don't worry about reply time, this is a free time project for me too, there are no strict schedules here :)

Edit: @bnoctis as you might have seen there was a problem with the licensing of the cat assets pack and since the one you bought is from the same artist we will not be able to use it here. I am available to refund the money you spent on the pack, since this was entirely my mistake.

Oh I see the author's comments on itch.io. Technically no one could really "hide" assets, since they need be in some accessible form at some stage, so one could always extract them at their will, no matter in big title games or small works. And we already have license text in place in a legal perspective.

That said, I understand their worries. Being extractable in some way is sometimes wildly different from immediate free access. We could maybe commission them for a set of assets specifically licensed to this project, or we could find some free assets.

The commission is a great idea, but I don't really think it's financially feasible for me. I'm looking around the internet to search for something else, but I didn't really find anything useful until now. I was thinking that maybe I'll try contacting vscode-pets' dev to see if they have any advice since they have a lot of assets... If you happen to find anything interesting let me know, thank you!

vscode-pets uses this cat pack too. My wild guess is that they just bought and used it, like us. Still, their other assets might be a good inspiration (we could even just use them).

Update: their dog assets licensing, quote:

I guess this one is just what we need, I will try to get it and set it up as soon as I can in the next week. Thanks!

Edit: @bnoctis I added this, thank you a lot for your help and support :)

Great! I'm kinda busy right now but still notice those cuties. Gotta find some time to add more ;)

vscode-pets added foxes in tonybaloney/vscode-pets#343
these appear to be available from https://elthen.itch.io/2d-pixel-art-fox-sprites under a permissive license

@4e554c4c Sorry but I see that in the license is stated:

as long as you don't redistribute (i.e upload the assets to other sites)

It would've been fine if it was just a Creative Commons license, but this one has the above supplement. I really don't want to risk repeating my previous mistake 😅.

I will very soon add some slimes that I'm designing myself if you're interested in future pets :)
Thank you anyways for your suggestion!

Marc Duiker created the Clippy, Rocky, Zappy, rubber duck, snake, cockatiel, Ferris the crab, and Mod the dotnet bot media assets especially for the vscode-pets extension. So they would fall under the MIT license, but I'd appreciate you crediting him if you want to use them in this extension as well ;-)

This is great! Thank you so much for letting me know, I will for sure look into adding these and will be more than happy to credit the original author. Also, great work on your extension! Thanks a lot :)

@giusgad

@4e554c4c Sorry but I see that in the license is stated:

as long as you don't redistribute (i.e upload the assets to other sites)

I've read through this a bit more thoroughly, and this specifically applies to commercial projects; i.e. you may include the assets in a commercial project as long as you don't redistribute the assets.

The creative commons license does not allow restricting permissions, and I'm pretty sure that CC BY-NC is compatible with this project (as long as appropriate attribution and licensing information is given).

This appears to be the author's interpretation as well. If you see this comment: https://itch.io/post/6816785 the author mentions that they aim to be more permissive than CC BY-NC by allowing commercial projects, in few circumstances. Noncommercial projects, of course, can use the base CC BY-NC.

@4e554c4c My concerns were not about the fact that the assets were not allowed in commercial projects (mine is not), but about the redistribution of the assets to other sites and the project being open source. Even if I'm not reselling or giving away the assets as a standalone, I am still uploading them to GitHub, which is what the line on redistributing prohibits.
Maybe it was meant as not reselling the assets individually, which is what I would've thought, but in the case of the cats, this was not the case (take a look at #26 and #25 if you haven't already).
Therefore, I will not use them in the project for now, but if you want to use them for yourself I can help you set them up to work with the plugin locally.
Otherwise, if you want them to be added to the project, I will have to contact the author to ask for clarifications. I will not do it now because when I ask them I also want to be ready to pay for the assets, as donating is recommended.

@giusgad the foxes project is licensed CC BY-NC, which specifically allows redistribution