Archived

This topic is now archived and is closed to further replies.

Sprites

This topic is 5485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ugk, haven''t you heard of an online dictionary or a search engine?

Far be it from me to chastise for asking a question without giving the answer though. A sprite is a term used for the little 2d pictures used in games. For example, if you had a spaceship, the picture of the spaceship would be a sprite. You might also have sprites for the various weapons, enemies, etc.

Basically any premade picture that is pasted onto the screen is a sprite (as opposed to something rendered dynamically using lots of math or fractals or something)

Correct me if I missed something or made a mistake fellow readers.

Share this post


Link to post
Share on other sites
a sprite referrs to any object on the screen that is animated. it can be hand drawn or it can be pre-rendered objects or it can be full out 3d. no matter what dimension is, the only criteria is that it is animated and usually counts as an ''object'' rather than a simple tile or whatever, what kindof sprites are you interested in making?

Share this post


Link to post
Share on other sites
Well, I want both my background (land where u walk) and my characters to be 3d. And u could rotate both around, so I guess both of those would be sprites. And do u know if it''s easier to make cel-shaded images than realistic looking ones?

Share this post


Link to post
Share on other sites
yaroslavd, obviously you have not done much game work before. Maybe you have done some graphics work before? I am not trying to insult you, but if you don''t know the difference between 3d and sprites, you shouldn''t be here now. You should begin by working on a modification to an existing game. Try something like Unreal Tournament, Quake, or Rainbow Six. Make some skins and then move up to modeling and level building. This will help you to understand how games work much more than reading a book at this point. There are plenty of tutorials on the internet to get you started. Once you have learned about all of that stuff, then you can pick up a book on Visual Basic or C++. Read and work through the book and then you can get a good book on game programming like "Tricks of the Windows Game Programming Gurus" by Andre LaMothe. This is how I started and I believe it is the best way to learn. Give yourself about two years to learn all of this stuff, because that''s how long it is going to take to make simple 2d games.

Share this post


Link to post
Share on other sites
Oh, and by the way, the 3d objects would not be sprites. The term sprite refers to a 2d bitmap image that is placed on the screen. It can be rotated or translated, but only in two dimensions. Once you add a third dimension, everything becomes a wire mesh. Three dimensions take much more math and processing power than two dimensions. Of course, you could always get something like 3d Game Studio if you want to make quick and simple games.

Share this post


Link to post
Share on other sites
Thanx, Swacky. U r right, I''m kind of new to game programming. I mean, I can and HAVE made 2d games (tank wars), but I am almost clueless about 3d programming. I know C++ (but not Win32, if u could recommend a CHEAP book, I''d appreciate it), Java, and Pascal (lol, useless). So, in a word, it''s not that I don''t know how to make games, it''s just that I''m new to the whole 3d thing.

Share this post


Link to post
Share on other sites
Well, I would like to help you, but I don''t know anything about 3d programming. I have done some 2d stuff about as complicated as an NES game, but that''s it. I''m still learning too, but you could do it in OpenGL. I hear it is easier than DirectX. You could visit the NeHe site (link on gd.net''s homepage). They seem to have some pretty good tutorials. As far as rendering, I would say that toon shading would only be a pain in the butt. If I were you, I would aim for something on the Quake 1 / Doom technology level. These games get really complex really quick. So be sure to plan it ALL out on paper before you start lol.

Share this post


Link to post
Share on other sites
hey guys, this might be a bit off topic but since swacky brought it up I thought u might be able to help. how do u rotate and translate a 2d sprite animation? I understand how to do it in direct3d. do u use a 2d matrix or is there a draw function in directdraw? ive looked in directx help and also searched for an article and cant find anything. Im trying to make a helicopter sprite rotate forward and backward in the direction it moves and dont want to have to make a whole bunch of sprites to do this. if u guys could help it would be much appreciated. thanks

Share this post


Link to post
Share on other sites
Mr. Bungle, You probably won''t want to do that because rotating an image takes MUCH more processing power than translating one. It may work depending on what kind of machine you are designing it for and how large your helicopter bitmap is though.


Excerpt from Tricks of the Windows Game Programming Gurus (Tell me if it works or not):

Direct draw supports both rotation and scaling. The HAL only supports rotation. Bitmap rotation is about 10-100 times slower than scaling. To perform rotation on a bitmap, your hardware must support it (very rare in 1999), and then set up a DDBLTFX structure.


DDBLTFX ddbltfx; //this holds our data

//initialize the structure
DDRAW_INIT_STRUCT(ddbltfx);

//set rotation angle (each unit is 1/100 of a degree of rotation)
ddbltfx.dwRotationAngle = angle;

//blit to destination surface
if (FAILED(lpddsback ->Blt(&dest_rect, lpdds_image, &source_rect, (DDBLT_WAIT | DDBLT_KEYSRC | DDBLT_ROTATIONANGLE), &ddbltfx)))
return(0);

Share this post


Link to post
Share on other sites
Swacky, I tried implementing that code but it doesnt seem to want to work. Everything compiled but it wont display the sprite. I took a look at that book and found the code for the DDRAW_INIT_STRUCT marco, and also read something about checking hardware compatability with GetCaps(), so im gonna try that to see if its my graphics card. Its probably going to end up to be too slow of a function, but it would be nice to know how to use it anyway.


Share this post


Link to post
Share on other sites
Why do you say that it doesn''t support transparency? Maybe they changed it in DX8? This is DX7 code I believe. I can''t think of how else they would do blitting without that? I''m pretty sure the book doesn''t use any direct 3d libraries anywhere.

Share this post


Link to post
Share on other sites
well, in the dx7 sdk help it states that there are rotation and translation functions in the ddbltfx structure, however the rotation only works for certain hardware and is not widely supported. It also mentions some flags such as DBLTFX_ROTATE90, but I cant get those to work either and they are supposed to work for all hardware. However, my sprite displays when I use those flags its just not affected in anyway. I think id be better off just adding prerendered rotated sprites, itd probably run faster. Im not advanced enough to write my own rotation code yet. Thanks again for your guys'' help.

Share this post


Link to post
Share on other sites
I have Poser3, Bryce4, and Lightwave 7 (I think) and I''m wanting to turn my 2d drawings into 3d cartoon-like mods, but I need to know how to create an unfolded space so I can properly apply the bit map textures.

For you people who know how to use wireframe mesh, what is the easiest way to make textures for a poser 3 character without going over the predefined space of the model''s suface area?

Share this post


Link to post
Share on other sites
quote:
Original post by skjinedmjeet
As far as I know, DirectDraw does NOT support rotation and scaling. I don''t think it even supports transparency... You have to use Direct3D for that...


Yes, it is not supported by Direct Draw. I wrote up a sprite engine and had to write a rotation algorithm for it. I may still have a tutorial at my website.

Found it, Rotation Tutorial. It''s crude, but works and might give you an idea on how to approach this problem.

A correction in the algo concerning 2 pixel edge buffer, that value would change according to sprite size. I never did go to the bother of mate,aticaly calculating that value. Also, this is for an non-animated graphic. To rotate an animated sprite, the animations have to be stored on separate surfaces, and each surface rotated in turn.


Guy

Share this post


Link to post
Share on other sites