e I think pure black is being created in tga import function of spriteedit.

Ok I replaced all the pure black and it still crashes. I added back thedeleted frame and nothing. I then went backtothe original sprite fiile and only replaced the idle, death, and the east direction move. I did not delete or add any frames. it still crashed.
I then went into the game and shut animations off. I found that it would still show the first frame of the east move when I moved. I have also placed my other sprite file (with all directions and added and deleted frames) and it works with animations OFF (still showing one frame of differet directions)
so I'm thinking it might be a problem with the sequencing of multidimensional animations. but I thik it doesn't have to do with pure black, maybe the way its saving the sprite file?

e I think pure black is being created in tga import function of spriteedit.
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website

I suspect that Mc i sright with regard to the error having to do with the black pixels, so I'm working on a patch that will eliminate black pixels, by simply converting them to RGB 1,1,1 (or 8,8,8 in 24/32 bit)
E, I found an error in the animation-sequence in your sprite, the sprite-frame-numbers used were from 1-10 while the available sprite-frame-numbers in the file is 0-9. (correcting this allowed me to move the sprite E and SE in game)
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

Updated SpriteEdit:
Changes from Build 11 to 12
- Modified the tga-import to eliminate "pure-black". Now if the tga contains pure black pixels those pixels will be converted to the darkest gray.
- Added 4 short-cut keys:
In the Main window:In the Edit sprite-frame window:
- <CTRL> + <SHIFT> + E = Edit currently selected sprite-frame
- <CTRL> + <SHIFT> + I = Insert a sprite-frame befor the currently selected sprite-frame
- <CTRL> + <SHIFT> + A = Add a sprite-frame to the current animation.
- <ALT> + L = Open the load tga dialog.
Please tell me witch short-cuts you miss the most, and if you have any suggestions as to whitch keys to use that would be welcome as well.
E, I tried reimporting the south-facing move sprite-frames, to your version of GU002.spr this solved the problem, so now I had no crashes (played 5-6 turns, just moving my settler arround)
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

Already download tell you how it goes tomorrow.
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website

Martin did you update the link in your signature? It sill has a december 30th sprite-edit...

Oops
I did update the file in my sig, but forgot to update the file in the zip(Guess I should have satayed in bed.)
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

Martin, I'm still having a problem with my settler graphics. But since you said you re-imported them, then maybe there is something I did wrong with the TGAs. I'll test it out and get back on that.
Another thing though. I tried to edit the battleship graphics by adding the civ3 battleship graphics. the civ3 frame size is bgger and when I hit edit, instead of sprite-edit placing the whole frame it just pasted over part of the original frame. This by design? Inserting a frame does the same thing? Is there a way to get a larger frame size? I thought I was able to do it in build 10 or 11. just checking...

OK, I saved the images of the north move and re-entered them. (The export function I couldnt get to work). I then loaded the game and tried to move north and it crashed
I then thought the "render" blocks not being checked were a problem (even though they were not for the idle graphics) I checked them and reloaded for the north again. And it still crashed.
(still have solved the problem wuth the larger frames with the battleship either)
Not sure what I'm doing wrong, but perhaps when BigMC checks in he can give some insight.
here's my tgas in case I saved them in a bad format (but the load fine and are 24bit TGAs)

With regard to changing the image-size it will be implemented, but rigth now you'll have to find a sprite with the right image-size and work from there. The problem is that each sprite can have only one image-size, so this will be implemented along with the ability to create sprites from scratch.
As to your sprite. I copied it to my ctp-sprite folder and started the game, no problem, moved it around 10-15 turns and settled still no probelm. I havn't tried the death anim though.
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

Martin, are you running CTP2 on XP? the sprite works when animations are set to off, but when they are on, the game crashes.
Can anyone else test out my sprite? Its in the zip above Martin's post.

Yes I am running CTP2 on XP.
I just tested the death anim, and it crashes, no matter what I do, so I'll have to take a closer look at it.
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

my death did not crash, it just shows nothing. still its the move that crashes it. weird.

I think I know why your death anim is crashing. For somereason it was able to load a different size frame forthe death anim. the other ones are 96x72. Death is 104x77.
this might be why my move is a problem too, but I'm not sure.

Martin,
I think ithas to do with spriteframes as well. Can you give a run down as to what these fields should be? It appears that even when you open an existing sprite it still has to be fixed.
one issue is that move, idle, victory on my sprite are in that order but it says sprite first frame is 20 for idle and 30 for death. Should it be 0?
I did adjust it for move and my move finally started working, except it would crash every now and again, maybe it reset, not sure.

resetting stuff to 0 seemed to work. I tried a few turns and it worked and made another, boat, sprite. but then I loaded a new sprite, it ran etc and I did it just like the other ones, then at the end of the turn the game crashed. Then reloading the game I didnt add any of the other ones and now the settler sprite crashes again. not sure whats going on.

As far as I hav been able to figure it out the fields are as follows:
Sprite Num Frames = the number of actual images available for the selected animation.
Sprite First Frame = this is the number of the first image imported when using makespr.exe (the Apolyton sprite generator) What it does in the game, or the sprite-file I don't know. Just keep it at 0 or 1 to be safe
Anim Type = the way the animation is played in ctp. sequential plays through from the first frame to the last defined frame, looped starts over at the first frame when it's gone through all of the frames, back-n-forth reverses direction of playback when it reaches the last frame, and playes back to the first before reversing direction again.
Anim Num Frames = the number of frames in the animation, these frames are realy just a list of numbers, refering to Sprite Frames.
Anim Playback Time = the time to play the animation sequence, not used in Civ:CTP, not sure about CTP2
Anim Delay = Amount of time to display the last frame before repeating, don't know how it is messured.
If you have not done this yet, it is a good idea to read the first part of documentation that came with makespr.exe (I have attached it to this post)
I have not had the time to look into why SpriteEdit allows import of wrong-sized images. I won't be home much over the next week or so, so I can't promise anything.
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

Martin spritedit does not save the image size. on build 12. this means that the sprite may be displayed distorted or as e said not appear.
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website

I just checked, the size is saved to the sprite-file, but somehow I have managed to eliminate the check for image-size on import. (Probably happend when I rewrote the import routeens) I'll add a check in the next build, but when that will be I don't know.
E, if you have the time, I would apreciate it if you could try using the same size for all images, and see if this solves the problem. This will help eleminate other causes for the problem.
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

I will say something I think e image is innocent of the bug I replaced the north walk with a image I knew could not case a problem (a giant blue box) this also caused the game to crash . but I can’t shake the thought I had a similar problem with the active$ion sprite maker.
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website

Yeah,
I eventually went in and redid the sprites to keep them all the same size. I thought it worked, one game I did a few turns and everything was going great (for 3 sprites I made using sprite edit no less) then a crash happened and since then I'm back to square one, where a settler moving crashes it again. I'm loss at to what else to do now. I too shall take a break and maybe think of something I did wrong.
thanks guys.

Martin,
I glanced through the source code would any of this help:
I can dig more if there smething specific you need....Code:#include "c3.h" #include "pixelutils.h" #include "spriteutils.h" extern sint32 g_is565Format; void spriteutils_EncodeShadowRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; uint8 alpha; sint32 runLen = 0; Pixel16 footer=0; Pixel16 shadowPixel; if (g_is565Format) shadowPixel = k_SHADOW_PIXEL_565; else shadowPixel = k_SHADOW_PIXEL_555; RGB32Info(**inBuf, &pix16, &alpha); while (pix16 == shadowPixel && (*pos < width)) { (*inBuf)++; (*pos)++; runLen++; RGB32Info(**inBuf, &pix16, &alpha); } footer = (Pixel16)(k_SHADOW_RUN_ID << 8 | runLen); if (*pos >= width) footer |= k_EOLN_ID << 8; **outBufPtr = footer; (*outBufPtr)++; } void spriteutils_EncodeCopyRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; uint8 alpha; sint32 runLen = 0; Pixel16 footer=0; Pixel16 *headerPtr; Pixel16 shadowPixel; if (g_is565Format) { shadowPixel = k_SHADOW_PIXEL_565; } else { shadowPixel = k_SHADOW_PIXEL_555; } headerPtr = *outBufPtr; (*outBufPtr)++; RGB32Info(**inBuf, &pix16, &alpha); while (pix16 != shadowPixel && alpha == k_ALL_ALPHA && (*pos < width)) { if (pix16 == 0x0000) pix16 = 0x0001; **outBufPtr = pix16; (*outBufPtr)++; (*inBuf)++; (*pos)++; runLen++; RGB32Info(**inBuf, &pix16, &alpha); } footer = (Pixel16) (k_COPY_RUN_ID << 8 | runLen); if (*pos >= width) footer |= k_EOLN_ID << 8; *headerPtr = footer; } char spriteutils_EncodeChromakeyRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; uint8 alpha; sint32 runLen = 0; Pixel16 footer=0; RGB32Info(**inBuf, &pix16, &alpha); while (pix16 == k_CHROMAKEY_PIXEL && alpha == k_NO_ALPHA && (*pos < width)) { (*inBuf)++; (*pos)++; runLen++; RGB32Info(**inBuf, &pix16, &alpha); } if (runLen < width) { footer = (Pixel16)(k_CHROMAKEY_RUN_ID << 8 | runLen); if (*pos >= width) footer |= k_EOLN_ID << 8; **outBufPtr = footer; (*outBufPtr)++; } else { return TRUE; } return FALSE; } char spriteutils_EncodeChromakeyWshadowRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; uint8 alpha; sint32 runLen = 0; Pixel16 footer=0; RGB32Info(**inBuf, &pix16, &alpha); while ( ((pix16 == k_CHROMAKEY_PIXEL && alpha == k_NO_ALPHA) || (pix16 == k_SHADOWBACKGD_PIXEL)) && (*pos < width) ) { (*inBuf)++; (*pos)++; runLen++; RGB32Info(**inBuf, &pix16, &alpha); } if (runLen < width) { footer = (Pixel16)(k_CHROMAKEY_RUN_ID << 8 | runLen); if (*pos >= width) footer |= k_EOLN_ID << 8; **outBufPtr = footer; (*outBufPtr)++; } else { return TRUE; } return FALSE; } void spriteutils_EncodeFeatheredRun(Pixel32 **inBuf, sint32 *pos, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; Pixel16 footer=0; uint8 alpha; RGB32Info(**inBuf, &pix16, &alpha); if (pix16 == 0x0000) pix16 = 0x0001; (*inBuf)++; (*pos)++; footer = (k_FEATHERED_RUN_ID << 8) | alpha; if (*pos >= width) footer |= k_EOLN_ID << 8; **outBufPtr = footer; (*outBufPtr)++; **outBufPtr = pix16; (*outBufPtr)++; } char spriteutils_EncodeScanline(Pixel32 *scanline, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; Pixel32 pix32; Pixel32 *scanPtr = scanline; uint8 alpha; sint32 pos; Pixel16 *startPtr; BOOL empty; Pixel16 shadowPixel; if (g_is565Format) { shadowPixel = k_SHADOW_PIXEL_565; } else { shadowPixel = k_SHADOW_PIXEL_555; } pos = 0; startPtr = *outBufPtr; while (scanPtr < (scanline + width)) { pix32 = *scanPtr; empty = FALSE; RGB32Info(pix32, &pix16, &alpha); if ((pix16 == k_CHROMAKEY_PIXEL)&&(alpha == k_NO_ALPHA)) { empty = spriteutils_EncodeChromakeyRun(&scanPtr, &pos, width, outBufPtr); } else if (pix16 == shadowPixel) { spriteutils_EncodeShadowRun(&scanPtr, &pos, width, outBufPtr); } else if ((alpha!=k_NO_ALPHA) && (alpha!=k_ALL_ALPHA)) { spriteutils_EncodeFeatheredRun(&scanPtr, &pos, width, outBufPtr); } else { if (alpha == k_ALL_ALPHA) spriteutils_EncodeCopyRun(&scanPtr, &pos, width, outBufPtr); else { printf("\nError in bitmap data. Pixel with no associated alpha.\n"); exit(-1); } } } return empty; } char spriteutils_EncodeScanlineWshadow(Pixel32 *scanline, sint32 width, Pixel16 **outBufPtr) { Pixel16 pix16; Pixel32 pix32; Pixel32 *scanPtr = scanline; uint8 alpha; sint32 pos; Pixel16 *startPtr; BOOL empty; Pixel16 shadowPixel; if (g_is565Format) { shadowPixel = k_SHADOW_PIXEL_565; } else { shadowPixel = k_SHADOW_PIXEL_555; } pos = 0; startPtr = *outBufPtr; while (scanPtr < (scanline + width)) { pix32 = *scanPtr; empty = FALSE; RGB32Info(pix32, &pix16, &alpha); if ( (pix16 == k_CHROMAKEY_PIXEL && alpha == k_NO_ALPHA) || (pix16 == k_SHADOWBACKGD_PIXEL) ) { empty = spriteutils_EncodeChromakeyWshadowRun(&scanPtr, &pos, width, outBufPtr); } else if (pix16 == shadowPixel) { spriteutils_EncodeShadowRun(&scanPtr, &pos, width, outBufPtr); } else if (alpha != k_NO_ALPHA && alpha != k_ALL_ALPHA) { spriteutils_EncodeFeatheredRun(&scanPtr, &pos, width, outBufPtr); } else { if (alpha == k_ALL_ALPHA) spriteutils_EncodeCopyRun(&scanPtr, &pos, width, outBufPtr); else { printf("\nError in bitmap data. Pixel with no associated alpha.\n"); exit(-1); } } } return empty; } void spriteutils_MergeShadowMap(Pixel32 *buf, Pixel32 *shadowBuf, uint16 width, uint16 height) { Pixel32 *pixPtr, pix; Pixel32 *shadowPixPtr, shadowPix; BOOL whiteBackground = FALSE; if ((*shadowBuf & 0x00FFFFFF) == 0x00FFFFFF) { whiteBackground = TRUE; } else { if ((*shadowBuf & 0x00FFFFFF) != 0x00000000) { printf("\nShadow file is in invalid format.\n"); exit(-1); } } for (sint32 j=0; j> 8) { case k_CHROMAKEY_RUN_ID : destPixel += (tag & 0x00FF); break; case k_COPY_RUN_ID : { short len = (tag & 0x00FF); for (short i=0; i >4); destPixel++; rowData--; } else { *destPixel++ = *rowData--; } tag = *rowData--; break; default: Assert(FALSE); } tag = *rowData--; } } } } Pixel32 spriteutils_AveragePixel32(Pixel32 pixel1, Pixel32 pixel2, Pixel32 pixel3, Pixel32 pixel4) { Pixel16 r1, r2, r3, r4; Pixel16 g1, g2, g3, g4; Pixel16 b1, b2, b3, b4; Pixel16 a1, a2, a3, a4; Pixel32 r, g, b, a; Pixel32 result; RGB32Components(pixel1, &r1, &g1, &b1, &a1); RGB32Components(pixel2, &r2, &g2, &b2, &a2); RGB32Components(pixel3, &r3, &g3, &b3, &a3); RGB32Components(pixel4, &r4, &g4, &b4, &a4); r = (Pixel32)ceil((r1 + r2 + r3 + r4) / 4.0); g = (Pixel32)ceil((g1 + g2 + g3 + g4) / 4.0); b = (Pixel32)ceil((b1 + b2 + b3 + b4) / 4.0); a = (Pixel32)ceil((a1 + a2 + a3 + a4) / 4.0); result = ( r | (g << 8) | (b << 16) | (a << 24)); return result; } void spriteutils_CreateQuarterSize(Pixel32 *srcBuf, sint32 srcWidth, sint32 srcHeight, Pixel32 **destBuf, BOOL aa) { sint32 destWidth = srcWidth / 2; sint32 destHeight = srcHeight / 2; sint32 i,j; Pixel32 pixel, pixel1, pixel2, pixel3, pixel4; Pixel32 *outBuf; outBuf = (Pixel32 *)malloc(destWidth * destHeight * sizeof(Pixel32) ); for (i=0; i > 8) { case k_CHROMAKEY_RUN_ID : break; case k_COPY_RUN_ID : { short len = (tag & 0x00FF); for (short i=0; i > 8) { case k_CHROMAKEY_RUN_ID : break; case k_COPY_RUN_ID : { short len = (tag & 0x00FF); for (short i=0; i 0) return 5; else return 6; } else { if (x > 0) { if (y < 0) return 1; else if (y > 0) return 3; else return 2; } else { if (y < 0) return 0; else if (y > 0) return 4; else return 4; } } }

And this in Sprite.cpp
Code:void Sprite::ImportTGA(uint16 index, char **imageFiles,Pixel32 **imageData) { int bpp; int w,h; if (!Get_TGA_Dimension(imageFiles[index], w, h, bpp)) { printf("Bad TGA Sprite File(%s)\n",imageFiles[index]); *imageData = NULL; fcloseall(); exit(0); return; } if (bpp!=4) { printf("TGA Sprite File not 32-bits\n",imageFiles[index]); *imageData=NULL; fcloseall(); exit(0); return; } *imageData = new Pixel32[w*h]; Load_TGA_File_Simple(imageFiles[index],(unsigned char *)*imageData,w*sizeof(Pixel32),w,h); m_width = (uint16)w; m_height = (uint16)h; TGA2RGB32((Pixel32 *)*imageData,w*h); } void Sprite::Import(uint16 nframes, char **imageFiles, char **shadowFiles) { m_numFrames = nframes; if (m_frames != NULL) { free(m_frames); m_frames = NULL; } m_frames = new Pixel16*[m_numFrames]; if (m_frames == NULL) return; if (m_miniframes != NULL) { free(m_miniframes); m_miniframes = NULL; } m_miniframes = new Pixel16*[m_numFrames]; if (m_miniframes == NULL) return; Pixel32 *image,*miniimage; Pixel32 *shadow,*minishadow; for (uint16 i=0; i> 1, m_height >> 1); } if (image) delete []image; if (shadow) delete []shadow; if (miniimage) delete []miniimage; if (minishadow) delete []minishadow; printf("."); } }

Where can I find a good sprite packer/extractor that works with any sprites? All of them I have found only work for a certain game/program. I am trying to make graphics for my buddy's game, and I cant find anything that will work.

That’s probably because there are different types of sprite file for example
In ctp the sprite files hold graphical data however in another activsion game called star trek armada sprites contain text which can be edited in note pad so to answer you question I don't think there is one or will be one.
however if you buddies game is ctp there is the sprite edit on martin the dane signature will work.
"Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
The BIG MC making ctp2 a much unsafer place.
Visit the big mc’s website

Martin, BigMC
I revisited my crashing setler sprite. here are somethings I notice.
At start up the fidget is great, then I move and it crashes BUT if I add an archer (another sprite I created) and move it, then I can move the settler BUT then it crashes I think its when the AI moves its settler.
If I make everything visible and do the same add an archer it seems to work fine for awhile
THE REAL WEIRD test was that I decided to swap my galley sprite I made in place of settler and it worked on start up. So I thought maybe it was an error with the settler sprite I copied over. So I copied settler graphics over the galley AND it still crashes!!!!!!!!!
I think the game recognizes something unique with a settler sprite which might be the problem or maybe it is my graphics.... any suggestions???????????

I THINK I Achieved SUCCESS
I finally went and redid my death.tgas which were at 104x77 instead of 96x72. Before my graphics were mixed and Martin when you wanted me to mae them one size I changed them all to 104x77 and it still crashed. I think your problem is in the handling of different sizes because all ofmy 96x72 sprites work perfect.

Martin,
Sprie editingis going well, but I noticed that if I add fraes to a sprite the animations won't show because it remembers the original sprite frame delay. Also changing the center points do nothing also.

Hi E,
I must admit I have not been working on SpriteEdit lately. I am aware of the problem with handling frame size, this is one of the reasons SpriteEdit canot create sprites from scratch. I'll have to look into the frames not beeing played.
Visit my CTP-page and get TileEdit and a few other CTP related programs.
Download and test SpriteEdit development build.

Martin,
Thanks. I'd say if anything adding the playing of all frames would be ore important than the resizing (mainly since a lot of sprites can be used as templates and I can post any bigger ones if people need them).
Bookmarks