How to make scope sprites:


Doug the Head
05-23-2003, 10:13 AM
This is my first ever comprehensive tutorial, so let me know if don't explain anything well enough or leave something out.



Tools for necessary sprite-making:
-SprView (http://www.worldcraft.cz/soubory/sprview.zip) (This is used to view sprites. Go figure)
-Sprite Wizard (http://collective.valve-erc.com/data/docs/1047496381-02062100/files/sprwiz.zip) (This is the easiest tool for compiling sprites)

Tools that would be good for sprite making:
-Adobe Photoshop (http://www.adobe.com/products/photoshop/main.html) (most popular graphic design program)
-Paint Shop Pro (http://www.jasc.com) (used by many instead of PhotoShop)
-The Gimp (http://www.gimp.net/) (freeware program for those that can't get ahold of Photoshop or PSP)

Basics of Sprite-making:

A sprite is a two-dimensional file that consists of one or more bitmap images played in a sequence. They make everything in Half-Life from smoke and fire, to your heads-up display, to muzzle flashes.

All of the bitmap files in a sprite must have a size that is a multiple of 8 (e.g. 56x128). This is just a little quirk with Half-Life. All .bmp's must also be in 8-bit format (meaning they can use a maximum of 256 colors), also reffered to as indexed color. The pallete, or color table, is the term used to describe the colors used by the .bmp file. In addition, all the .bmp's used in a single sprite must use the same pallete.

There are four different types of sprites, each is defined by the way the sprite is compiled.
1 - Normal: The sprite appears in-game with no effects applied to it. exactly as you drew it.
2 - Alphatest: The first 255 colors in the pallete appear normally in-game. The last color in the pallete defines which part of the sprite is transparent in-game (i.e. If pure blue was the last color in the pallete, all the pure blue in the sprite would appear transparent in-game. Be careful, if some of the blue in the sprite is slightly off from pure blue, it will appear in-game)
3 - Indexalpha: Everything that is white in the sprite is transparent, and everything black is opaque. Anything grey will be anywhere in-between, as defined by how close it is to white or black. When compiled in indexalpha mode, your .bmp files must use a grayscale pallete.
4 - Additive: uses all 256 colors of the pallete and blends them together (this is the most common type of sprite)

If you create a sprite from more than one .bmp, it will play them in order from first to last. This is called an animated sprite, and is used for smoke, fire, etc.

I don't really know what else to say, since just about everything about compiling is self-explanitory with Sprite Wizard, so here is a tutorial on how to make scope sprite for dod, since they use a very strange format.

How to make DoD sniper scope sprites:

Export the .bmp sequence using sprview

Then open all four .bmp's with photoshop/paint shop pro

Put all four images into one picture so that them make the four quadrants of a square

Stretch the image out to 800x600 (or 1024x768, whatever floats your boat)

Edit the scope as you wish (white is transparent, black is opaque, grey is semi-opaque and gets closer to transparent the closer you get to white). It makes the scope look better if you blur all the lines except for the crosshairs, so it doesnt look jagged.

Resize the image back down to 512x512

Cut the image into 256x256 parts.

Make sure the .bmp's are in indexed color mode, and the pallete is greyscale. This step is very important

Save your 256x256 .bmp files.

Use sprwizard to comile the sprite with the four pieces in the following order: top-left, top-right, bottom-right, bottom-left

Compile the sprite in Index-alpha mode. This is important for the sprite to work.

Save the sprite as one of the following (depending on which scope you want to replace) in your dod\sprites directory:
scope_spring.spr
scope_enfield.spr
scope_k43.spr (actually replaces the k98 scope, but it has retained it's name from the beta 1.x period)


That should be all.

Wren
05-23-2003, 01:03 PM
Thanks. I was wondering how to do it myself, actualy.

Ska Wars
05-23-2003, 01:10 PM
Cheers Doug, this will come in handy.

Ska

Corporal Rossi
05-23-2003, 01:26 PM
Too bad i can't understand this lol, I think i need some background in making sprites, then I can't wait to use this baby.

Captain John Miller
05-23-2003, 04:31 PM
/stickied in the mean time, if you wanna edit it abit Doug and include the basics of sprite making then i think more wil be gained from it.
CJM

Doug the Head
05-23-2003, 09:12 PM
I would greatly appreciate it if a mod changed the thread title to better fit the new topic.

=DD=Wolf Kahler
05-23-2003, 09:41 PM
Dude! Thank you so much. I was hoping for something like this. :)

Genie
05-27-2003, 05:30 PM
Woulda helped is this was posted BEFORE I made my scope pack
:rolleyes:

Had to figure it all out myself.

=DD=Wolf Kahler
06-01-2003, 12:38 AM
Perhaps someone could explain what the scope_*_soft.spr files are for?

Doug the Head
06-01-2003, 12:58 AM
As far as I can tell, they don't do anything...

=DD=Wolf Kahler
06-01-2003, 02:29 PM
Danke. Just checking if I was alone in assuming that. You never know, though.

06-19-2003, 04:44 PM
thanks alot for this! now i can use the scope from the allied sniper rifle on all the other ones! you are my hero!

06-24-2003, 03:21 PM
nice post but your sprview link has lost itself, you know of anywhere else i can get this needed app? thanks man

BloodBurp
06-24-2003, 10:12 PM
First of all I wanna thank Doug the Head for this very informative post but if any of you were like me and you tried to follow the tutorial along you got lost somewhere along the line especially when using Photoshop. Well at least I did, if you didn’t that’s awesome, but if you’re like me then more than likely you were pulling out your hair, or the dog’s or the cat’s or whatever…

Anyway, this little addendum to this post will hopefully fill the gaps that Doug left out since I think he took for granted that most people are familiar with Photoshop so hopefully my sharing what I did would hopefully help someone else out…so without further ado here goes.
(Actually after re-reading this I myself am guilty of assuming that people are familiar with the basics of Photoshop so I’m sorry about that but I guess some of you may have to break out the manual if you need to follow along. Also as you may have guessed by now this tutorial is for Photoshop since I don’t know how to use any other program so sorry about that as well).

Now everything in Doug’s tutorial started out great until I first got here:

“Cut the image into 256x256 parts.”

Whoa! Easier said than done, first I muddled around a lot with the different selection tools in Photoshop but to no avail, since my selections would never come out exactly 256 by 256. After doing some research, I found out that Photoimage was what I needed.

So here’s what I did to cut the image into 4 quadrants each exactly 256 by 256. After resizing your desired image to 512 by 512 jump to Photoimage (by clicking that very last tab at the bottom of your tools palette). Now that you’re in Photoimage, go under the Slices Tab > Divide Slice, this will lead to a pop up box. Make sure the “Divide Horizontally Into” and “Divide Vertically Into” boxes are checked. Make sure the numeric value next to each of the first radio button is set to “1” and the value next to the second radio button is set to “256” Therefore each heading should say:

1 slices down, evenly spaced
256 pixels per slice

Once this is done hit OK

Great now you will 1 vertical and horizontal line on your 512 by 512 image, splitting it into 4 quadrants.
Now go back to Photoshop and here you will see that the image here is also split into quarters. You can close Photoimage now.
You’re now back in Photoshop.
The next thing you do is make sure under the View tab, that Snap is checked and then under Snap To> Slices is Checked.

Then using the Rectangle selection tool select each quadrant individually (because of the Snap To Slices option ibeings checked your bounding box will “snap” to the slice lines if the get close enough, pretty cool right? I though so too) and then copy and paste each one into a new image. From here you have your four images, each exactly 256 by 256! However we’re not quite done yet…

Doug’s tutorial then tells you:

Make sure the .bmp's are in indexed color mode, and the pallete is greyscale. This step is very important

To do this you will have to go through all of the following steps with each of your four images individually (of course if you are familiar with using Photoshop action commands you’re set, if not don’t worry about it).
First flatten one image (remember work on only one at a time to avoid any mistakes), this can be done by going into Layers>Flatten Image.
After this we need to convert the image into Indexed Mode (since more than likely when you created your new image it was in RBG mode) and set the palette to grayscale. To do this go to Image>Mode>Indexed Color. Under the pop up Indexed Color box, from the drop down list next to Palette choose Custom and this will open up another pop up box called Color Table. From the drop down list next to Table choose Grayscale, then hit OK. This will bring you back to the Indexed Color pop up box and then hit OK again. And voila you are done with converting one of your image to indexed color and setting the palette to grayscale. Now repeat for the other three images and you are done… Unless…Keep reading folks…

For some reason, my Grayscale color table went from black as the first color to white as the last color. Because of this when I compiled my sprite the entire scope looked white in-game and pretty much looked like crap. I’m guessing this happened because as the sprite compiler will tell you, the sprite will be the color of the VERY LAST color in the table which in my case was white and after reading at least one post on the forums this is what happened to another person as well. Remember I’m not an expert at this (I’ve only been messing with this since last night) but if for some reason your Grayscale goes from white as the first color and then black as the last in the table you’re in luck and you don’t have any extra steps to do. Now if you are unfortunate like me then you somehow need to flip the entire table so white colors come first in the table followed by the darker colors.

This is how I did it and it involves a few steps, again I’m not an expert with Photoshop so if anyone else knows an easier way then please by all means let me and everyone else know how. Thanks.

Until then this is what I did. First I opened up one of the original .bmp that I exported using sprview (make sure it is from a scope sprite that you know works) then going into Image>mode>color table. When the color table opens you will notice that the white is very first and then black is the very last color! This is exactly what you want. You will see that there is an option to save the color table. Do so and name it correct_grayscale or something like that and place it into an easily accessible folder. Close the original .bmp file so you don’t confuse it with the ones you made.
Now go back to your image that you are/were trying to change into indexed mode with a grayscale palette and use these steps.
Image>Indexed, this will open up the Indexed Color pop up box. Under the drop down list next to Palette choose Custom, Load option and just choose the correct_grayscale file that you just saved and you will notice that the correct grayscale table is loaded. Hit OK, OK and you are done. Of course you will have to repeat for the next three images.

Next save each images as .bmp files in the order that Doug instructed (I think if you did all the above steps properly then Photoshop will correctly prompt you to save them as a .bmp file)
From here follow the rest of Doug’s tutorial using sprwizard and you will be done.

Sorry if I over-explained or didn’t explain stuff enough. This is also my first attempt at anything like this so…don't judge my writing to harshly.
If you have any questions I’ll try to answer but as I keep mentioning I AM NOT AN EXPERT at this but hopefully Doug or someone else will be able to.

Hope this helps.
Peace.

Doug the Head
06-28-2003, 05:09 PM
Thanks for that BloodBurp. Like I said, it was my first ever tutorial, so i wasnt sure what to put in and what to leave out.

07-25-2003, 05:41 PM
Links are dead, also could someone show me to a place where i can learn to change the team icons above the head ? And anyone know the type/name of the files the icons are?

KillaKilla
01-18-2004, 04:06 PM
Where are the origonal DOD scope sprites?

BillyNair
03-31-2004, 08:15 PM
Now that steam is out and things are in a different place, I can not find any of the SPRs. Back in the day I made a few scope sprites, and want to use them again. I play sniper so rarely that I didnt realize how bad the defaults are, especialy the axis'.

I went in and did a search for the sprites but returned nothing. Then I did a search for any SPRs (*.spr) in all the /steam folder and only returned the ones from custom maps. Then I did a search in my entire computer ( C:\ and D:\ ), and found my old sprites, but none that I was seing in game. Then I tried to just drop the sprites in the empty sprite folder, and dum tada dummmmmmmm!! they worked in game.

Now, I know how to update the sprites, if I have them already, but say I see a sprite I have not seen before?

Where do we find sprites that are used in game on the steam system. Or say: My computer is stolen and I need to start from scratch, how do I find the current sprites to use as templates?

Doug the Head
04-21-2004, 01:04 PM
teh defaults are inside of the DoD cache file, so I can't really help you there. I've been on hiatus from dod editing since my school blocked the Half-Life ports over a year ago. I might get back into it this summer, but for now I don't know how to access the defaults in Steam.

coltpython
05-11-2004, 03:20 PM
I belive that they are compiled on teh Valve\Steam\SteamApps\day of defeat gcf

BillyNair
05-14-2004, 02:35 PM
Originally posted by Trp. Jed
Everything is now stored in the GCF file. To get the sprites, you'll need to extract them with GCF Scape:

http://countermap.counter-strike.net/Nemesis/index.php?c=76

Once you've got them out, you place the files in your DoD folder using the same layout as they were in the GCF (same folders, structure, etc) and then DoD will uses this files instead of the ones in the GCF.

You don't need to put them back into the GCF and you don't need to extract all of the GCF.

- Jed Thanks JED

BillyNair
06-25-2004, 02:31 AM
Originally posted by Doug the Head
Stretch the image out to 800x600 (or 1024x768, whatever floats your boat)

... words ... words .. words...

Resize the image back down to 512x512.[/i] OH MY GOODNESS. That never even crossed my mind :confused: hahha, ty

I have been making scope sprites since they were 12 different SPRs back in beta 1.2, and when they switched to the WAY easier to manage 4-in-1 format I was very happy, except I had a hard time getting the outer circle to curve properly (that slight "j" curve rather than 1/2 pi ) so I stretched my old sprites to match the new curves and just kept that file and re did the crosshairs hopping they wouldn't look too odd when I was done.

I was comming in here to see if anyone posted the distortion ratio you needed to get a perfect circle and decided to actualy READ the post.
thanks doug, see, you CAN teach an old dog new tricks.

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.