Page 1 of 2

Composite sprites

Posted: Thu Aug 11, 2016 5:01 am
by laperen
I'm working on a game where the player controls a robot.
The robot consists of interchangable parts. in this case the head, body, legs, right arm, left arm. Here's the results so far:

Image
on the left is in-game, and on the right is the spritesheet with the robot in pieces.

Currently reading values off a csv to get the proper heights, widths, and offset the individual sprites should be in to create the robot.

next hurdle will be animating the composite sprite, although that is more art heavy than scripting heavy

Re: Composite sprites

Posted: Thu Aug 11, 2016 8:13 am
by Germanunkol
Nice - how are you generating the art? Manual pixel painting? That would be a ton of work when it gets to animating. I think I'd use blender and render the parts from different angles instead - that way animation would be much quicker to set up, and adding new parts would also be quite easy.
Looks good so far - looking forward to seeing the animation!

I'm not too find of the background grass (I guess it might just be a placeholder?). It doesn't make the robot stand out enough - maybe lower the contrast on the grass a bit?

Re: Composite sprites

Posted: Thu Aug 11, 2016 1:20 pm
by laperen
Yes the grass is a placeholder. It was for when I was using a non-composite sprite placeholder and I was just doing a preliminary test with this composite sprite

I am generating the art manually, although when I say animation its probably not as elaborate as it sounds. As some examples of my previous stuff and how I will continue with this one, this is the placeholder I was using before:
Image
rows are the facing directions and columns are the frames of the animation. 1 is stationary, 2-5 are walking.

And something else in gif form to show it would move like
Image
not too many frames for anything. walking is 4 frames, attacking maybe 2-4, etc etc.

Re: Composite sprites

Posted: Sat Aug 13, 2016 8:26 am
by Germanunkol
Okay, sounds reasonable. I'd be way too lazy to draw all of these by hand, but hey, it looks good the way you do it, nice style! :)

Re: Composite sprites

Posted: Sat Aug 13, 2016 4:05 pm
by laperen
WOW! what a ride these 3 days have been. Celebrated far too prematurely when I opened this thread

Been working on sorting the sprites properly. Mainly which arm should be infront and which should be behind based on the "rotation". In the end my solution was to swap the back frames of one arm with the front frames of the other in script, changing the right left separation to a front back one.

Also changed the way I composited the sprites, with a "ball and socket" style positioning. This makes the system more flexible, allowing the arm ball to follow the body socket. Also allowing for a larger variety of designs I can put in.

My animator script was a little wonky too, had to sort that out
Image
visually nothing much has changed, but now my project is finally ready to receive interchangeable "parts" and their animations. And yep, still crappy placeholder grass as ground

But before that, working on game side stuff with saving/loading, and UI for inventory(draggable icons)

Re: Composite sprites

Posted: Sat Aug 13, 2016 5:47 pm
by MadByte
Good job, your art looks clean and solid - i like it ! :)

Re: Composite sprites

Posted: Sat Aug 13, 2016 7:08 pm
by bobbyjones
For animation have you thought about skeletal animation? Something like spine could work.
http://esotericsoftware.com

Re: Composite sprites

Posted: Sun Aug 14, 2016 3:22 am
by laperen
MadByte wrote:Good job, your art looks clean and solid - i like it ! :)
thank you
bobbyjones wrote:For animation have you thought about skeletal animation? Something like spine could work.
http://esotericsoftware.com
That looks like a wonderful tool, but looks like it requires relatively high res images. Pixel art is a very different beast. Besides, the skeletal animation seems to only be good for side view or sideways motion, not for front or isometric views which I have as well.

Re: Composite sprites

Posted: Sun Aug 14, 2016 11:48 am
by bobbyjones
Skeletal animation can work with any resolution. You are just making a skeleton and putting parts on it. You end up animating the skeleton rather than the parts themselves which allows you to switch parts whenever you want. It's exactly what you will end up doing. And for other views you will need different pictures for each part and you will then need to transition between animations. Skeletal animation can be used for any perspective(idk if it's the right term) you would just animate the skeletons differently.

Re: Composite sprites

Posted: Sat Dec 03, 2016 2:22 am
by rosshadden
Skeletal animation definitely seems like what you (and me) want. The only problem is that spine is the only one with a working (not to mention first-class, made by themselves) runtime for love2d. But it's incredibly expensive, has a restrictive license that is terrible for hobbiests and game jams, and just generally seems to be the evil Microsoft/Apple of this space.

There are other solutions, such as dragonbones. It's free (though not open source...) and actually has just about the same feature set as spine, including amazing mesh deformations. It does not have a Linux client, but there is a great tool called coa_tools (https://github.com/ndee85/coa_tools) that let's you use the illustrious Blender.

However there is currently no dragonbones runtime for love2d. So either we need to make one, or implement a runtime for the format used by coa_tools directly.