Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Sprites and gear adding weapons etc(Repainting/Customizing live sprites)  (Read 3797 times)
0 Members and 1 Guest are viewing this topic.
Offline JayTech

Junior Member


Medals: 1



« Posted 2012-01-30 23:37:28 »

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.
Offline UprightPath
« Reply #1 - Posted 2012-01-31 00:14:01 »

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.

Offline JayTech

Junior Member


Medals: 1



« Reply #2 - Posted 2012-01-31 01:27:23 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline theagentd
« Reply #3 - Posted 2012-01-31 06:10:34 »

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.

Myomyomyo.
Offline JayTech

Junior Member


Medals: 1



« Reply #4 - Posted 2012-01-31 08:33:33 »

@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?
Offline theagentd
« Reply #5 - Posted 2012-01-31 08:36:50 »

@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.

Myomyomyo.
Offline JayTech

Junior Member


Medals: 1



« Reply #6 - Posted 2012-01-31 08:46:55 »

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.

Offline sproingie
« Reply #7 - Posted 2012-01-31 17:56:31 »

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.

Offline UprightPath
« Reply #8 - Posted 2012-01-31 23:09:41 »

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.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (55 views)
2014-04-15 18:08:23

BurntPizza (53 views)
2014-04-15 03:46:01

UprightPath (66 views)
2014-04-14 17:39:50

UprightPath (49 views)
2014-04-14 17:35:47

Porlus (66 views)
2014-04-14 15:48:38

tom_mai78101 (90 views)
2014-04-10 04:04:31

BurntPizza (151 views)
2014-04-08 23:06:04

tom_mai78101 (247 views)
2014-04-05 13:34:39

trollwarrior1 (204 views)
2014-04-04 12:06:45

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!