Sprites and gear adding weapons etc(Repainting/Customizing live sprites)

So, I have a sprite class I can paint my sprites make them animate move them with my arrow keys BUT now is when I want to create some serious character models for the player all in 2d, what/how logic is in creating and repaiting new images onto. For example If I have my main player sprite how do add say, add a sword to the sprites hand and when it does a movement such as swing the sword, the new sword that the player equips is able to follow the hand and move. Also how do I go about painting armor onto the current sprite or w.e I want to it(my games custom API I made is pretty much done, I just need to understand the logic for sprite in game customization). What is the industry standard of doing this? All help is appreciated.

As I understand it (And I could be dead wrong) such additions typically take the form of something painted over the basic sprite (A sprite on a sprite). In the case of a ‘weapon’, you would take the base animation making the motion you want for his weapon swings, then on a separate layer you would animate the weapon’s motions (Being careful to ensure that bits of said weapon disappear if they should move behind the character. Armor would be done in the same way, painted over for every type of different armor design.

Which, as you might imagine makes custom weapons and armor -very- difficult to get right if the custom armor has a different shape from the original sprite’s armor.

I believe that’s one of the primary driving forces behind things like FFT where only shields/weapons were given special artwork during animations. If you know where your sprite’s hands will be through the whole animation, putting a weapon in them is easy.

The only commercial game I can think of that allows complete customization (And uses sprites) is Terraria, and if you want it being played, the motions are simple enough (Always animated such that the weapon will be closest to the screen and swung across the same axis) that doing it doesn’t cause the problems I just mentioned.

Hm, yea I mean i’m just trying to grasp the whole concept of character customization etc, that sound’s about right. I just need some insight technical wise, like how to go about repainting specifically pixel by pixel.

I started making a 2D RPG once, but I never got too far. I did however manage to get equipment working. I used this site:
http://charas-project.net/charas2/index.php
to generate different parts. Each sprite then had a body, a face, clothes, hair, hats, e.t.c. Whenever a character’s equipment changed I would pre-render all the layers of the sprite to a BufferedImage. Each frame I only had to draw a single image, just like usual.

@Above interesting, so you would take all the frames and put it into a new Image? Also I see the term sprite used loosely, my game art I’d like to look like isn’t tiny characters made out of tiny pixels but more polished figures that you would see in a flash game and other 2d games. Does this apply to all types of sprite art.

Recap, so you’re saying create a layer of different images and pre-render and then use these separate images into one buffered image on the fly?

Yes, just create a BufferedImage, create a Graphics2D from it and draw all the layers in order on it. Then just draw the complete sprite as you normally would. You can obviously do this with your own sprites too, not just the ones from the site I posted.

So how do I get a reference point to add layers to exactly where I want like add armor over a character, also how do I deal with different frames of animation for the armor how it looks when the player is running? I mean so far I have a static sprite and it has a frame for one motion another etc. I mean is the most logical solution to have differnt axis like a point of where an arm moves x pixels up when running and goes back down etc?

So for my base player sprite am I supposed to code specific points of the sprite that are movable? I’m REALLY new to animation and 2d/ all graphics.

You can put a special pixel on each of the character and equipment sprites, such as a reserved alpha value, and make them line up like a socket and a jack. Draw the pixel in the appropriate place for each animation frame, then bake it in (you don’t want to hunt for these pixels at runtime). That’ll take care of different offsets, there’s really no getting around the fact that you have to custom-craft the equipment and characters to go together, especially with pixel art. You have to with 3d art too, but it can be a little more forgiving. It’s incredibly long, slow, and tedious work, and there’s a reason so many games have such a high budget for art assets.

Case in point about art budget:

World of Warcraft when they introduced a new feature (Transmogrification) there was an outcry from those playing for them to go back and produce special tiers of armor for the Death Knight class that would match with the ‘themes’ of the ones released in Vanilla WoW and the Burning Crusade expansion.

While they wanted to, the price for producing what amounts to… Six-to-Eight (I think) new sets of armor for the DK class would have cost about as much, art-budget wise, as their 4.3 patch (The one that Transmogrification was released in).

And that is for the more forgiving form of full armor customization.