• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
cebugdev

how to handle armor change in 2D RPG

5 posts in this topic

Hi,

This is not my project but a friend of mine is asking how armor change such that of DIablo 2 or any other 2D RPG were handled in the game?
by armor change i meant, say for example you have a basic character and the character found a helm, an armor and a pair of boots.

how would this reflect to the visual sprite?

 

Does it need different sprites for different armor for all characters? how bout armor combinations like armor on its feet and upper torso plus helm?

I have idea on how to do this in 3D since 3D objects can be just attached to the mesh, but i have no idea on how this works in 2D.

 

Any tips will do,

 

THanks,

 

0

Share this post


Link to post
Share on other sites

A flat 2d game can get away with having a skeleton of sorts, and just drawing the piece of armor onto the person at the skeleton spot, or even not a skeleton but just marking each frame of animation, eg the helmet should be centered at 0,0 on frame 1 of the walk animation, 5,0 at frame 2, then you would just draw the default person, then draw the helmet after that, on top of the person.  (or if the helmet completely replaced the person's head, just draw the pieces.)

 

An isometric game like diablo..ugh, I don't know any good shortcuts, I think you'll be stuck needing to have the different pieces each depicted and animated from the basic angles.  (for example, arms with no armor swinging a weapon from North, south, east, west, arms with light armor and NSEW and arms with heavy armor NSEW, etc.)  On simple color changes, you don't need to do that, but yeah...I believe thats why early diablo basically had only a few armor types that actually changed your look graphically.

0

Share this post


Link to post
Share on other sites

The basic idea is that you can draw the equiped character in a series of steps. Conceptually, lets start with three imagined drawings: One of the character with base equipment, one of the character wearing upgraded boots, and one of the character wearing an upgraded helmet. The latter two are drawn over the first so that the helmet and boots line up correctly, then everything in those images that are not boots or helmet is wiped away. Now, from those three images you can draw a player who is wearing the base equipment only, is wearing the boots, is wearing the helmet, or is wearing both the boots and the helmet -- four combinations of equipment from three images. This savings might not seem like much now, but as there are more categories of equipment (helmets, boots, etc) and more kinds of equipment in each category (leather boots, steel boots, etc), the savings are compound. Specifically you will achieve number_of(helmets) * number_of(boots) * number_of(...) unique outcomes from just number_of(helmets) + number_of(boots) + number_of(...) input images. For example, with 5 kinds of 3 categories of equipment, you get 125 unique combinations from just 15 original pieces of art.

 

You do this for each frame of every animation, for each piece of equipment. With that, you can build up every animation with any combination of equipment that the player could possibly equip. Doing this by hand is very time consuming of course, but Diablo, even though it was 2D is not hand-drawn. In Diablo, all the sprites are just snapshots of a 3D model from an art program. Because of this, they were able to create the base animations and then render them all with each piece of equipment (equipment was also a 3D model in the art program).

 

Once you have all of these images, you can cut out or compress the unused portions of the image. and you also have to generate the draw order so that the players cape covers his chest-plate when he faces away from the camera, but is behind his chest-plate when he faces towards the camera. But those are just details of the basic principle.

 

All of that said, its almost notoriously-difficult to create overlapping isometric-view scenes with a lot of complexity just by using z-ordered 2D images. Because of this, many isometric games of today are, in whole or in part, actually rendered in 3D complete with z-buffer. Even Diablo does this to some extent, its just that they did it offline. Some are hybrid systems that pre-render the character wearing a particular collection of equipment, saving the images as 2D sprites, and then drawing those when in-game (usually, this is done when there are a lot of characters, or when running on low-powered platforms). The general term for this technique is 'imposter', its also used in full 3D games to draw things that are very far away. Partial or fully-3D systems also make advanced lighting and other effects more straight-forward, which is another reason those systems are more popular today than those based on 2D sprites.

Edited by Ravyne
0

Share this post


Link to post
Share on other sites

1. character are built of many parts, you can name it, head, body(body = body + leg + foot), left hand, right hand, left weapon, right weapon.

2. you must have a list of character state, it's about 40 state as i remember, to handle such many action like diablo.

here are example:

- idle, every kind of weapon have same form if idle

- walk, no weapon

- walk, 2-handed weapon(lance, staff...)

- walk, 1-handed weapon(sword, blade, ...)

- walk, double weapon(2 sword, 2 blade at once, difference to 2-handed)

- walk, bow weapon

- run, no weapon

- run, 2-handed weapon

- run, 1-handed weapon

- run, double weapon

- run, bow weapon

.... so on, many state

 

each state must have difference animation, assume that a state have 40 animation, and a character formed from 6part. then we cost 40x6=240sprite to build a character. the number of sprite grow very fast as variation of equipment grow.

you must find a way to manage that huge number of sprite, dont load every sprite at once

and you know that kind of system needs many sprite, so never use HD assests. it's cost 4MB of disk space, after optimized, to store a helmet. you know? helmet are small, 1 frame 6x6 pixel average.

 

3. when you turn character, move up -> move left... of course you must change the animation, but it's not only thing you must do.

you must re-arrange the parts. when character move up, the order of render are -> weapon < hand < head < body. so the weapon and hand would be hide under body. but when character move down, the order reversed. basically, you must have a table to represent the order when character turning.

- up -> 1, 2, 3, 4

- down -> 4,3,2,1

- left .....

- right ....

 

that's all my experience, nothing hard, but it's complex, and if you haste(like me), you will get a mess instead of a awesome game.

4. here is mine

http://www.youtube.com/watch?v=SSsM3yiEKbk

Edited by ngoaho91
0

Share this post


Link to post
Share on other sites

I'm working on something similar (2d isometric rpg, but with very simple pixel art) and planned to have a naked version of characters and various pieces of stuffs like armors and weapons to draw after the base sprite. I hope it works, also because it's not likely for a one man (or even for a small team) to produce all that amount of graphics.

0

Share this post


Link to post
Share on other sites

The Above Comments sound a little Complicate.  Although have not done this recently I have done The Sprites and added Different Clothing at run-time.


A flat 2d game can get away with having a skeleton of sorts, and just drawing the piece of armor onto the person at the skeleton spot, or even not a skeleton but just marking each frame of animation, eg the helmet should be centered at 0,0 on frame 1 of the walk animation, 5,0 at frame 2, then you would just draw the default person, then draw the helmet after that, on top of the person. (or if the helmet completely replaced the person's head, just draw the pieces.)

This is very close to what I did.  Here is where I differred and I hope I explain this correctly.

  • At Run-time I created a Blank Sprite Sheet with No Images for each Player Charactor (PC)
  • Next I Copied The Base Charactor Images ( Sprites ) on the Blank PC Sprite Sheet. Now I have a set of Sprites for each PC
  • Now I Selected What Clothing Options I Wanted Then overlayed those sprites onto The PC Sprite Sheets
  • I Continued This until my PC was ready to go adventuring.

Of Course each clothing / Armor / Weapon Sprite Sheet had to have the Same Animations as the Charactor Sprite.  I Saved the new Sprite Sheet with the Charactor's as the file name and would load that sprite sheet at run-time to use as my animations.  Thus controlling only 1 set of sprites for each charactor during the game.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0