Thread: making sprites

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    Question making sprites

    I am making sprites for my Dragonball Z clone of Liero, and have encountered some problems.

    I do not want to use a 3d modeler...because I dont need that....this is a 2d game....a 3d modeler is way too much to use for this....

    I have tried hand drawing my sprites in paintbrush....but that makes them look childish and not very well done.

    Are there any good sprite making programs out there? I need a program that would aid me in making my sprites. Especially when my sprites for characters have to be as small as 13x13 pixels....
    My Website

    "Circular logic is good because it is."

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    One technique I've seen is to hand-draw your sprites with pencil
    and paper then scan them. Clean up the scan, then paint in your
    colors/shadows/etc.. If I'm not mistaken that's what Capcom did for the Street Fighter 2 game series.

  3. #3
    Registered User compjinx's Avatar
    Join Date
    Aug 2001
    Posts
    214
    "The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
    Eric Porterfield.

  4. #4
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    One technique I've seen is to hand-draw your sprites with pencil and paper then scan them. Clean up the scan, then paint in your colors/shadows/etc..
    Yeah, I've heard that too, and the people I heard that from had some killer 3D figures. I was going to buy a scanner a few weeks ago, so I could do this. However, I realized that it would be of no purpose to me right now, because I wouldn't be able to implement the figures into my games (bad consoles!). Over the course of this school year I have become much better at drawing from doing all of my sketches during my insanely simplistic math class.

  5. #5
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    Paint Shop Pro 6 (NOT 7, 7 is slower for some reason)
    of Photoshop 6 or 7.

    those are the tools of choice
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  6. #6
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Here's a sprite using what I...

    Well, I just made a sprite, just seeing how good I could do. I think it's pretty good, seeing as it's my first try at a character. Anyhow, I will attach the .bmp. I used techniques I learned from the posted link http://www.gaminggroundzero.com/file...ritemaking.doc
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: [email protected]

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  7. #7
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Pretty cool little guy. Looks like a sprite you'd see in a 2d rpg.

  8. #8
    Registered User heat511's Avatar
    Join Date
    Dec 2001
    Posts
    169

    i like it too (nt)

    (nt)

  9. #9
    Registered User
    Join Date
    Nov 2009
    Posts
    7
    The link does not work but you coded that in C?

  10. #10
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    No, I would gather from the discussion that this just refers to the image, which is a bitmap. The bitmap will be read in by the program at runtime.

    So rather than coding the sprite directly, you draw the sprite in some kind of photoshop style program and then save it as "raw" bitmap data. As long as you know the dimensions and exact format of the data, this is the easiest kind of image to process, because it does not have a header and is uncompressed.

    Here's an example of what I mean by "format": a normal (non-transparent) bitmap contains 3 bytes per pixel. These occur in the file in order, row by row, from the top left corner. The data is said to be interleaved because it alternates Red value, Green value, Blue value (as opposed to organizing the file with 3 sections).

    Some image software such as gimp will do an image dump into C code. For example, here is the first little bit of my current avatar. This was created by loading the jpg into gimp and resaving it with the extension .c instead of .jpg. I don't know what other image editors will do this -- it's actually of debatable value, since if you compile a few of these in it will increase the size of your executable substantially. It would be more normal, as I said, to save the image as .raw, in a separate file, and then read it in at runtime:
    Code:
    /* GIMP RGB C-Source image dump (CIAvatar.c) */
    
    static const struct {
      unsigned int   width;
      unsigned int   height;
      unsigned int   bytes_per_pixel; /* 3:RGB, 4:RGBA */ 
      unsigned char  pixel_data[55 * 55 * 3 + 1];
    } gimp_image = {
      55, 55, 3,
      "\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\4\0\0\7\0\0\16\0\0\14\1\0\0\11\6"
      "\0\11\5\0\6\0\0\10\0\5\10\0\14\10\2\16\3\0\4\6\0\0\11\1\0\12\1\0\15\4\0\32"
      "\16\0!\25\0&\34\0-#\0'\36\0""8.\0-\"\0*\36\0""1!\0%\25\0#\17\0\22\0\0\25"
      "\6\0\10\0\0\3\0\0\0\2\1\1\2\4\0\1\2\0\0\2\11\11\13\1\0\4\0\0\2\4\4\6\2\7"
      "\3\0\4\0\0\7\0\0\2\0\1\1\0\1\0\11\1\0\16\0\0\13\0\0\2\0\2\0\0\1\0\0\1\0\0"
      "\1\0\0\1\0\0\1\0\0\1\0\0\0\5\0\0\11\2\2\16\0\0\11\1\0\0\3\0\0\11\4\0\12\3"
      "\0\7\0\0\13\1\0\12\2\0\7\0\0\12\1\0<4!c[F\207\201i\234\226\200\212\205o\211"
      "\211q\227\231\201\215\217w\216\216t\177~_\230\224q\230\223m\222\212f\241"
      "\230y\204zac[H%\36\14\30\25\4\5\3\0\3\1\0\6\5\0\21\17\22\1\0\4\0\0\4\22\22"
      "\24\0\1\0\0\2\0\0\5\1\0\2\0\0\2\0\1\0\0\1\0\5\1\0\13\0\0\7\0\0\2\0\1\0\0"
      "\2\0\0\2\0\0\1\0\0\1\0\0\1\0\0\1\0\0\0\11\0\0\13\0\0\5\16\14\17\2\0\1\7\3"
      "\4\3\0\0\4\0\0\17\14\0\7\3\0\15\4\0UK\15\301\265\213\253\243\214vppGFV\40"
      "%B-:\\\32,P\36""4Y\17'K\37""6X\34""0U\35,S\37+U,5`\36&MCIcqrv\263\262\240"
      "\261\255\207MF\30\25\13\0\10\0\0\6\0\0\2\0\12\4\5\12\0\1\2\0\3\0\0\3\0\0"
    This goes on for another 300 lines. As you can see, directly coding an image would be very tedious.

    .xpm images are C code, if you look at them in a text viewer instead of an image viewer, eg:
    Code:
    /* XPM */
    static char *Toaster[] = {
    /* columns rows colors chars-per-pixel */
    "48 48 90 1",
    "  c #020202",
    ". c #0C0C0C",
    "X c #141414",
    Again, the only problem with this is you must compile it in to take advantage of the format.
    Last edited by MK27; 02-20-2010 at 07:06 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Making great graphics
    By MadCow257 in forum Game Programming
    Replies: 1
    Last Post: 02-20-2006, 11:59 PM
  2. Making control...
    By Finchie_88 in forum C++ Programming
    Replies: 2
    Last Post: 09-07-2004, 01:42 PM
  3. Animating Multiple Sprites
    By Tommaso in forum Game Programming
    Replies: 2
    Last Post: 10-11-2002, 12:06 AM
  4. Sprites In Console
    By c++_n00b in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-13-2002, 07:02 AM
  5. About Unix Programming - Making a career desision
    By null in forum C Programming
    Replies: 0
    Last Post: 10-14-2001, 07:37 AM