 |
|  |
 |
|
Angelo Scotto
|
|
Milan, Italy
Oct 1999 time: 05:22
|
|
It's a pity that Tot spr format is unknown, i usually play Civ without animations (since i removed spr files a lot of time ago to play scenarios), some days ago i reinstalled Tot and started a game: i was delighted looking at animations of tanks or bombers.
Unfortunately it seems that Draco eventually lost interest in Tot (but i still hope to see him surface here again) so it seems we have to do the whole work alone.
A couple of days ago i started peeking the SPR files and attached you'll find a translated (and polished) version of my notes, they're far from complete but i think they're a starting point.
Greetings,
Angelo
Attachment: sprformat.txt
This has been downloaded 25 time(s).
|
|
|  |
 |
|
Mercator
|
 |
Sorekara no Nanimo
Jan 1970 time: 06:22
|
|
Great work... I think I've found a little more thanks to your info . I'm not too familiar with all the correct terms or common "techniques" in file formats, so I just rant a little and guess away:
STATIC.SPR
The header consists of a whole set of DWORDs (or long integers, a sequence of 4 bytes in any case), most of them are offset pointers or so. I'll list them
1. 0 (for whatever reason )
2. 12, pointer to the next "block" at offset 12
3. 1636, a pointer to the end of the "header"
4. 0, offset of the first image (starting after the header, add value (3) to get the "real" offset)
5. - 408. remaining image offsets 405 in total
409. + (3) = end of file
And you didn't miscount the number of occurrences of "4000 0000 4000 0000" it is indeed 406, but near offset 139111 (0x21F67) there are two closely following eachother, one of them is either superfluous (an empty image not entirely removed correctly?) or perhaps just a coincidental occurrence of the sequence as part of the image encoding. In any case, the second of these two (at offset 139127 or 0x21F77) is NOT represented in the offset listing in the header.
UNIT01.SPR
Again lots of DWORDs, but not all offsets this time:
1. 12, pointer to byte 12 or DWORD (4)
2. 1324, pointer to the start of the image offset list in the header
3. 1928, pointer to the end of the header
328 DWORDs I haven't investigated yet
151 DWORDs, being the offsets of the images (works the same as with Static.spr: the first offset is 0 and is relative to the end of the header, so add (3) to get the "real" offset)
Edit: the last offset in the list always points to the end of the file, so for the UNIT01.SPR that would mean there are 150 images.
Last edited by Mercator on 14-09-2002 at 17:56
|
|
|  |
 |
|
Angelo Scotto
|
|
Milan, Italy
Oct 1999 time: 05:22
|
|
Mercator, this is a great news!
Yes, offsets! i tried to use them directly as pointers but i fell in useless places of the file, sure, i had to sum header offset, it's clear now.
Unfortunately, the format in which is coded the image is still unknown, i wasn't able to find a single match with any standard image format.
I peeked in the Tot exe file and found that the real name of sprite file format is SPRT... but this is not very useful after all
Always in the exe there were references to several graphic formats: PCX, IFF ILBM (Used mainly on Amiga!!!), GIF and obviously BMP... this tells us that probably Microprose used a pre-made graphic library but i don't think this is useful too... 
Greetings,
Angelo
|
|
|  |
 |
|
Zarion
|
|
This is Draco Omega here (under a different name due to login problems).
I figure everyone must either hate me now or think that I made the whole thing up and never figured it out. The truth is that I started writing the program several times with the best of intentions, but it was taking a while and it ended up getting abandoned. I guess I'll never end up finishing it myself so I'll just give the format out and let you guys handle that end of things. Again I apologize....
I had almost all of the format figured out within the first 3 days of looking at it, but my notes were sketchy to begin with and they probably got thrown out when I moved to university last month. (Also my old computer got beat up my the postal service and is currently inaccesable to me, but if I can manage to get a look at my old source code, some more things will become clear)This will be pretty much off the top of my head and incomplete, although it should probably help a little. And I'll post any more details as I remember them.
Firstly, there is no sort of compression used on the images, nor are they a standard format that I am aware of. They are 16-bit images, with each pixel taking to bytes (obviously) but not quite in the standard fashion. The bits are in standard 5-5-5 R-G-B format, but the unused bit is used here to represent whether that pixel should be painted with the team color (adjusted naturally to the shade of the pixel)
The image is divided into a number of rows of pixels, of which each row has a 2 byte header. I'm not 100% sure if this order is correct, but I think the first byte is double how many pixels this row is offset from the far left of the image. The second is the length in bytes of the row.
They could be in the other order, though.
Each row does not be the same length, but starts at the first non-transparent pixel of that visiable row and ends with the last one. This basically saves the space that would be wasted with the large ammount of transparent space on the left and right of the sprite.
There is also a header to each image that is either 45 or 46 bytes in length (I can't remember which) Unfortunatly, I can't remember the order of the entried at all, but I can at least tell you what some of them are, so other may be able to find them.
There is a value stating the true top, bottom, left, and right bounds of the image (with a maximum of 64x64 as in units.bmp) Also, is the size of the main image data. Some other, less used values relating to the position of the health bar are there as well.
Darn... As I'm writing this, I realize how little use it is and how little I remember. Well, I'll trie to get the source code off my old computer as soon as possible and post a more detailed, accurate, and complete version of the format, but I'm afraid that this will have to do until then, such as it is...... Oh, and if you have any questions about my poorly written description, feel free to ask.
|
|
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|
Mercator
|
 |
Sorekara no Nanimo
Jan 1970 time: 06:22
|
|
Nope 
They're in some custom "compressed" 15/16-bit bitmap format. I don't think it's a pre-existing format, because the "compression" is done to reduce all the superfluous transparent "pink" surrounding the images. I don't think many would really need such compression (except game designers).
I have figured out the exact details of the single images in the sprite, I'm not too sure about all the file header details, though...
In any case, I'm working on a sprite editor, which will be able to export sprites to a pair of bitmaps, and import them again. A pair of bitmaps, since one bitmap holds the "normal" image, the other holds the civilization-color mask.
I now have procedures ready that can convert between bitmaps/sprites, but no procedures yet to retrieve the images from the sprite file (I started over since last time, to be able to support the unitXX.spr and resource.spr)...
It all depends on how busy I'm gonna be with other things how long it will take me from here.
|
|
|  |
 |
|
Mercator
|
 |
Sorekara no Nanimo
Jan 1970 time: 06:22
|
|
It's probably going to take a while yet... I have to do some serious thinking on what the interface is gonna look like.
Some better news: I found out a bunch more about the animation information in the resource/units sprite files:
- You can specify whether you want to loop an animation or not (or even, say, only loop the latter half of an animation, after an initial first half).
- You can make animations semi-transparent, like the die animation fade-out. Since you can specify the transparency level for each frame, you can do quite some more complicated things with it (say, have an entirely semi-transparent "Ghost" unit).
- Frames can be mirrored, saving you from making unnecessary additional frames.
There are quite a few more technical intricacies, which are especially challenging to program correctly: animations aren't saved in full, one after the other. Instead, the header specifies which animation to use, and for each animation which of the images in the file to use. That means you could reuse both animations and frames indefinitely while only one instance is actually saved in file.
For the static unit images, only 5 directions are stored: North, Northeast, East, Southeast and South. The remaining 3 are created by mirroring on of the above.
For the animated unit images, all 8 directions are stored, but, as stated earlier, you can reuse and mirror individual frames.
I'll post the new file format description soon...
(and the eager creators will have to wait a little longer )
|
|
|  |
All times are GMT. The time now is 05:22. Apolyton Time is 00:22. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|