for devs: custom sprites?

Diablo 1 HD, codename Belzebub - General forum.
User avatar
radicool
Posts: 155
Joined: 28 Feb, 2014 8:05

Post by radicool »

If you (or some one else) can make high details animations, just do it and send to us.
:-)
First for all it's impossible to add high resolution textures at this time. This is still Diablo 1.
Is there a limitation to the texture resolution of the sprites? I've gone through a lot of trouble to decipher how Diablo 1 graphics work. Opening the Diablo 1 MPQ with a list file, I figured that each character has it's sprites contained an either a .cel or .cl2 file. The character classes have their sprites in a .cl2 file.

These .cl2 files appear to be a database so to speak of frames as a pose to a sprite sheet like they used in Diablo 2. This would explain why I could not find a Diablo 1 sprite sheet anywhere!

I determined each frame was composed of 64 pixels squared (64x64) pixels. Quite a small resolution. That explains why the characters appear blurred (probably also due to compression).

My Question: Is 64x64 pixels the limit for the characters? Does the Diablo engine allow for larger texture resolutions such as 128x128 or even 256x256? (aware that larger resolutions will affect FPS and consume more storage space)
BrightLord

Post by BrightLord »

Belzebub allows huge sprites. But If you render warrior to 512 x 512 pixel animation. It will just be damn HUGE compared to other objects on map. If I ever wanted to change sprites for characters it would be by implementing 3d renderer just for models. Diablo 1 way of doing things with animations is too ancient to be worth working with.
Andrettin
Posts: 28
Joined: 12 Apr, 2014 11:56

Post by Andrettin »

nexuscz wrote:
Noktis wrote:
There is no need to make hd textures for models nor any .
First for all it's impossible to add high resolution textures at this time. This is still Diablo 1.
It's hard to believe the blur on warrior model is because of engine limitation only. Some textures looks detailed.
There are not textures and models. I mean, surely models and textures were used to create the sprites, but what's in Diablo is all 2D art.
User avatar
radicool
Posts: 155
Joined: 28 Feb, 2014 8:05

Post by radicool »

But If you render warrior to 512 x 512 pixel animation. It will just be damn HUGE compared to other objects on map.
Well I think a 512x512 texture is overkill for Diablo however I'll use that as an example. I think the current sprites use a 64x64 resolution. Say a new Warrior is created in 512x512 resolution, can't it just be downsized to fit the appropraite scale of the warrior in game? I know details aren't as visible when zoomed out, however I believe the sprite may benefit from more clarity and less blur given it was redone with less compression and a higher resolution. Not to mention these details can be viewed when the player zooms in as Belzebub does offer zooming functionality. Moreover new sprites could offer more frames and thus smoother animations.

Perhaps this resizing thing sounds like a lot of work on the coding side. Maybe theres no point in upsizing resolutions?
If I ever wanted to change sprites for characters it would be by implementing 3d renderer just for models. Diablo 1 way of doing things with animations is too ancient to be worth working with.
The idea of updating the sprites was to let the community (Nexuscz and whoever else) help improve the mod, letting them get involved and you guys work on your thing. Of course this is your mod and theres no obligation to accept our work or help. I'm not a programmer, but I was thinking (hopeing, haha) not too much work would be involved if you guys only replaced the existing sprites (given we had provided a fully functional sprite in the correct format, etc). Whereas a 3d model conversion would require a lot of work and I'm sure your not keen and have more important things to work on.
BrightLord

Post by BrightLord »

That is alot of work to do it considering you have to render hunderds of animations in right format. Just imagine that if you do something wrong setting up scale, rotation and light, final effect will be bad. :(
Andrettin
Posts: 28
Joined: 12 Apr, 2014 11:56

Post by Andrettin »

BrightLord wrote:That is alot of work to do it considering you have to render hunderds of animations in right format. Just imagine that if you do something wrong setting up scale, rotation and light, final effect will be bad. :(
Yes, it is an immense amount of work. I agree that it would probably make more sense to allow the use of models (as in that way, rotation, light and scale can be changed in a much easier manner). Nevertheless, if people do want to create the graphics, it is not impossible, only a lot of work (and a lot of repetitive work at that).

About the light, rotation and etc., Belix made the following comment, regarding how he made the Bard:
Getting the image to look Diablo-y will be one of the interesting challenges, and the methods you can use to achieve this may vary greatly depending on the modeling software you use, but for Blender I found most textures fit the Diablo color palette much easier with their contrast reduced to 70-90%. At first I tried rendering 96x96 images directly (most Diablo player animation frames are this size), but that made pixels far too shifty and sharp. I achieved the final pixelized look you see above by rendering the images out at 256x256 with anti-aliasing on, then batch scaling them down to 128x128 (weapon swing animations use this size) and, for most frames which ultimately become 96x96, cropping those down to that size from the downscaled 128x128 renders.

If your modeling software leaves you editing rendered frames because you can't get the desired result directly, I highly suggest you use batch image processing software like IrfanView or ImageMagick (even both in unison for the different features, as I did) before you realize you'll be editing thousands of frames over and over by hand otherwise. Both have documentation available about the command line parameters and operations available to them; of significant mention is IrfanView's ability to batch convert images to a specified palette file, which is VERY useful for Diablo. Open up a Diablo frame exported with The Dark with IrfanView, then export its palette somewhere to be imported through the batch operations. Better yet, I'm going to attach the IrfanView palette I used to this post, because it is a special one I made specifically to remove the possibility of new character graphics accidentally using colors in the first half of the palette that change depending on which dungeon you're in. Just don't use neon pink anywhere (like that'd look nice in Diablo, hah!). It could save you a massive headache later.

Another important thing is the camera, light and shadow angles. This was really difficult to approximate without distance and rotation information from the original models, and took hours of tweaking to get near, and may further vary between different 3D programs. But I found Orthographic camera seemed to offer closer results than Perspective, and a camera at Y 22, Z 23.5 with a downwards rotation of 60 degrees is pretty close and what I used in the images above.

Light and shadows were even trickier. Diablo's models appear to be both self or ambiently illuminated, yet also shaded. My approximation of this is messy, so you might be able to find a better way. For lighting, I used 8 'sun' lights, one shining in from every 45 degrees, that were soft (0.2 intensity) to help simulate ambient lighting, one main light that shines in from overhead to offer the white shininess effect with an angle of -27 X and -12 Y. The shadow light that projects the character shadow onto the ground is a seperate object and uses the exact same angle. But that alone didn't quite do it – I further had to set every material to have an Emissive value of 0.4. This complex setup yielded the closest result to Diablo's mysterious character lighting, so I stuck with it.

And be careful with the color white. Pure white marks transparency for Diablo's rendering. The only thing that should be pure white is the plane your shadows are rendered on. You must take special care that anything else that uses white color (e.g. weapons or spell effects) are slightly dim. Diablo has a number of shades of white you can use for this, I believe the highest is F6F6F6, but you probably won't have such fine control over that in a 3D program. Like me, you may have to continuously export your work and check white areas pixel by pixel for their color once converted to Diablo's palette to make sure your object is dim enough not to hit full white (FFFFFF) anywhere.

Some thoughts on the side: The Warrior and Rogue have a blood pool that forms beneath them when they die, however, the Sorcerer and Monk do not. I never noticed this until I examined the animations closer. You can probably get away without adding this effect to your death animations, but it seems that it was intended to be on all characters. And don't forget you only need a death animation for Light Armor, because it is assumed all items are dropped upon death, so Diablo is presumably programmed to use only the Light Armor death animation, even if you die on floor 16 where your gear doesn't drop you still see the Light Armor death animation play.

Unless you're really good with animations, it may be difficult to avoid a little clipping outside the animation frames as your character topples over dead. The original Warrior's foot actually clips out of the bottom border of his death animation in 2-3 angles, so I wouldn't worry about that too much if you can't avoid it.
Post Reply

Who is online

Users browsing this forum: No registered users and 81 guests