Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Diablo II "perspective" effect
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Amrazek
Squire

40 Posts

Posted - Mar 23 2003 :  11:50:45 AM  Show Profile  Reply with Quote

In the game Diablo II, there's an option for "Direct3D". Selecting it adds nicer lights and things, but the thing that interests me most is the way tall objects 'move'. It's quite difficult to explain, but I'm going to do my best.

This particular effect will make tall objects seem... More 3D (but remember these are 2D). For example, if I walk past a tall spire that partially blocks my view, the tower will move at a rate different that the floor I'm running on. At the same time, it still seems to be in the same place. Effectively, I'm able to look 'around' the object! This is a very nice effect that I've always wondered about. Anybody know a way(s) to do it?

Another thing I wondered about is the characters themselves... Items have magical properties, and some of these properties give a special effect. Example1: A 'Sword of Flame' will appear red, and will continue to do so until you change a weapon. Example2: An 'ethereal' weapon appears translucent, no matter how you view it and from any angle. My question about this is how do they get all the items to appear so? There are thousands of items and a large number of special effects for them, and then there are frames for special 'moves' (up to 30 different ones, + the normal ones) and frames for being hit. If you think about it, there are probably 16 or so directions a character can be in, and approximately 35 animations (each having about 5 frames, if they run them backwards, too). Then there are at least 50 different ways each weapon can look, and there are 100s of 'base' weapons. That means there are 16 * 35 * 50 * ~100 = 5000 * 560 frames (VB gets an overflow error multiplying those). That's a lot of frames. But, now we take into account that there are seven characters. Oh, and I've forgotten about the hundreds of monsters, too! And then there are the shields!

Obviously, Blizzard must have come up with some other way of doing this. My very best idea so far is to 'flag' each pixel with a weapon on it, and use some kind of effect algorithm for each pixel. That way you could change the flagged pixels to other colors, which could possibly create D2's effect.

Any other ideas?

P.S. Sorry if I'm long-winded, but I have this undying desire to know...

-Amrazek

AT
Squire

18 Posts

Posted - Mar 23 2003 :  1:54:32 PM  Show Profile  Reply with Quote
http://www.mwgames.com/voodoovb/phpBB2/viewtopic.php?t=144

The coloured weapons just have different palettes - transparent weapons are normal weapons which have been blended. Effect algorithms ?? No - they are just drawn down that way.
And there are only a few types of weapons, shields, etc (one sword sprite will be used for several different types of sword for example) - plus sprites will be reused, not a whole set of unique animations for each special attack.
If you can find a way to extract the weapon sprites from diablo you could have a look.

Go to Top of Page

Amrazek
Squire

40 Posts

Posted - Mar 24 2003 :  6:15:20 PM  Show Profile  Reply with Quote
I don't understand how you'd apply the pallette then, if you don't know which pixels they are. I would think it would affect the entire image, no?

And the perspective post is interesting. I'll have to look in to that more.
Go to Top of Page

AT
Squire

18 Posts

Posted - Mar 24 2003 :  8:58:37 PM  Show Profile  Reply with Quote
Think of DooM - one player sprite, four player colours. When I say palette i'm just talking about the way in which the colours are changed, not about altering the actual display colour palette.
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - Mar 24 2003 :  9:08:55 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
If diablo 2 is using 3D hardware accleration, then the tiles are probably just mapped to billboards. And to change colors, you can simply use DirectX for lighting or alter vertex colors manually.
Go to Top of Page

Peter
Administrator

Canada
67 Posts

Posted - Mar 25 2003 :  5:57:58 PM  Show Profile  Visit Peter's Homepage  Reply with Quote
Yeah, but D2 also works without hardware acceleration using plain old DirectDraw.

Blizzard probably came up with some sort of clever scheme, they're tricky like that =)

Talos Studios - VoodooVB - VB Gamer

Go to Top of Page

Amrazek
Squire

40 Posts

Posted - Mar 25 2003 :  6:06:01 PM  Show Profile  Reply with Quote
I'll post an example:

Notice the red sword. In this case, it's a magical falchion. If I had been wearing a normal falchion, the sword would be white but look the same, and the character itself would not change. The same goes for an 'ethereal' item -- the sword would be a light gray and be translucent, but the character itself would be unchanged. The different magical attributes affect the color of the weapon -- the same goes for shields, helms, and armor. Since I believe the character itself is all one sprite, wouldn't changing the palette affect the character, too?

Download Attachment: Example1.jpg
13.81 KB


Edited by - Amrazek on Mar 25 2003 6:11:14 PM
Go to Top of Page

AT
Squire

18 Posts

Posted - Mar 25 2003 :  8:00:28 PM  Show Profile  Reply with Quote
The character is not one sprite - a basic character is drawn down and then things like helmets and shields are drawn over them as seperate objects.
My best guess - the items are stored as 8-bit bitmaps, and diablo will have several sets of palette information. Take one palette and add one image and you have the all the data you need to blt your item down - in the colours of whatever palette used. - to see what I mean :
http://www.hyperfictions.com/palette1.jpg

Edited by - AT on Mar 25 2003 8:02:40 PM
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - Mar 25 2003 :  8:54:12 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
I know this is off topic, but that's a really cool ship
Go to Top of Page

Mr. Palette
Neophyte

4 Posts

Posted - Mar 26 2003 :  1:58:23 PM  Show Profile  Reply with Quote
I read something about index palettes in the DirectX7 SDK. They contain values that refrence another palette's color table. I couldn't get it to work in my program though.
Go to Top of Page

Peter
Administrator

Canada
67 Posts

Posted - Mar 26 2003 :  2:53:57 PM  Show Profile  Visit Peter's Homepage  Reply with Quote
Heheh, its the dreaded Blade Bug =)

Yeah, like Andrew said, the characters are not made up of one sprite, instead the sprite is 'layered'

For example, they will draw the basic model for the character /wout armour and weapons. Then they will have different armour animations without the character that can be drawn on top of it. They will also have sword animations without the character that can be drawn with it. It has to be done carefully, but the end result will look seemless.


Talos Studios - VoodooVB - VB Gamer

Go to Top of Page

Amrazek
Squire

40 Posts

Posted - Mar 26 2003 :  5:29:53 PM  Show Profile  Reply with Quote
Pretty clever. I would think it would be a lot of work to carefully place each item, but once you had it done for the basic items you could shift the palettes and get many, many different-looking items. It all makes sense, now. I was considering an RPG after my RTS (in isometric style) to further refine my engine to the kinds of tasks it may be put to use for, so these interesting effects are certainly good to dwell upon.
Go to Top of Page

AT
Squire

18 Posts

Posted - Mar 26 2003 :  5:58:08 PM  Show Profile  Reply with Quote
Actually the work is not too bad - graphics are created with groups or layers (3d or 2d) around the same set of images which can then be processed by a game-tool designed to cut off the empty edges of the image and create a set of values for position used by the game.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.16 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.