Art File Format - Complete specification [Updated]

Research related to Arcanum and it's game engine.
Post Reply
User avatar
Crypton
Arronax's Best Friend
Arronax's Best Friend
Posts: 420
Joined: Wed Jul 08, 2009 5:04 am
Location: Abyss
Contact:

Art File Format - Complete specification [Updated]

Post by Crypton » Fri Nov 13, 2009 2:53 pm

I did some research on Art format some time ago, few days ago I found meaning of remaining unknown bytes, so now we have complete Art header definition.

This is also prove that there is mistake in ArtView, because there is no "pictures", as ArtView says, there is only 8 cardinal directions, where flags says if Art is rotatable or static. Where if Art is static, frames are saved in south direction.

This means that any Art can be rotatable, not only critters, monsters and npc... you can also have rotatable scenery, items, etc.


Data types:

Code: Select all

struct ArtHeader // file header
{
	unsigned int flags;
	unsigned int frameRate;
	unsigned int rotationCount;
	unsigned int paletteList[4]; 
	unsigned int actionFrame;
	unsigned int frameCount;
	unsigned int infoList[8];
	unsigned int sizeList[8];
	unsigned int dataList[8];
};

struct ArtFrameInfo // frame file header
{
	unsigned int frameWidth;
	unsigned int frameHeight;
	unsigned int frameSize;
	signed int offsetX;
	signed int offsetY;
	signed int deltaX; // or hotspot?
	signed int deltaY; // or hotspot?
};

typedef unsigned int ArtPalette[256]; // 32 bit RGBX color array

How to get number of palettes saved in file:
for (i = 0, i < 4, i++)
{
	if (header.paletteList[i] != NULL)
		paletteCount++;
}
How is Art saved in file:

Code: Select all

-ArtHeader
-ArtPalette * paletteCount
-ArtFrameInfo * rotationCount * frameCount
-Frame data for frame 1 - Array of unsigned char, which is indices to palette
...
-Frame data for frame n
Description:

flags - Bit flags, tell you some info about saved Art file.

Code: Select all

0x00000001 = Static - no rotation, contains frames only for south direction.
0x00000002 = Critter - uses delta attribute, while playing walking animation.
0x00000004 = Font - X offset is equal to number of pixels to advance horizontally for next character.
0x00000008 = Facade - requires fackwalk file.
0x00000010 = Unknown - used in eye candy, for example, DIVINATION.art.
frameRate - Frames per second, speed of animation.

rotationCount - Number of cardinal directions possible to save in Art, its always 8 (North, NorthEast, East, SouthEast, South, SouthWest, West, NorthWest). I guess that Arcanum supports also less or more directions, like 4 or 16.

paletteList - List of memory pointers to palettes, these pointers are invalid now, but it still says how many pelettes are saved in Art file.

actionFrame - Frame Index that executes assigned trigger in game, as example, when you have critter attack animation Art, the eventTrigger tells game when sword hits another object (npc).

frameCount - Number of frames in every stage.

infoList - List of pointers to array of ArtFrameInfo, for every stage is one pointer, but these pointers are invalid now, and they can be zero when making new Art.

sizeList - List of integers, every integer means total size of stage data. They can be zero when making new Art.

dataList - List of pointers to memory where are saved color indices into palette, for every stage is one pointer, this can be zero as well.


Thats all, I hope you understand to description I wrote :)

EDIT: 21.09.2010 - Updated

PS: I'm not 100% sure about that "hotspot" name, because troika used abbreviations: "off" and "hot". First one is easy to deduce, its offset, but the second one, it could be abbreviation of one, two or three words... who knows, maybe that name previous name: "delta" describes its meaning more clearly....

PS 2: Actually, I think that offset and hotspot should be swapped, then it will make sense, because "delta" (as you know it from ArtView) is offset that is used to modify rendering position when critters are moving in some direction. However, "offset" (as you know it from ArtView), is also offset, but this time its used to modify rendering position relative to its original rendering position, where no bounding rectangle clipping is applied, thus it makes sense to call it "hotspot".

Also "offset" can be used to calculate original Art frame resolution before clipping procedure...

But who know, I could be mistaken...

User avatar
radzh
Ailing Wolf
Ailing Wolf
Posts: 29
Joined: Thu Jul 09, 2009 1:15 pm
Contact:

Re: Art Format - Complete structure

Post by radzh » Sat Nov 14, 2009 1:29 am

That eventTrigger thingy is a thrill, think it's time to update qtScribe :)

User avatar
Crypton
Arronax's Best Friend
Arronax's Best Friend
Posts: 420
Joined: Wed Jul 08, 2009 5:04 am
Location: Abyss
Contact:

Re: Art Format - Complete structure

Post by Crypton » Sat Nov 14, 2009 2:40 am

Nice! :) After years, we have complete structure of Art Format, now only to find what means remaining flags, I've seen 4 flags in Art, afaik, so I will check them later, and update it.

Oh, did I told you that I've found also structure of facwalk.xx files? so I can convert facades into single image, or find out which tiles are blocked, etc, so we can use original facades in our WorldEddie :lol:

User avatar
radzh
Ailing Wolf
Ailing Wolf
Posts: 29
Joined: Thu Jul 09, 2009 1:15 pm
Contact:

Re: Art Format - Complete structure

Post by radzh » Sat Nov 14, 2009 3:06 am

I still think we should convert facades as well as .arts.

User avatar
Crypton
Arronax's Best Friend
Arronax's Best Friend
Posts: 420
Joined: Wed Jul 08, 2009 5:04 am
Location: Abyss
Contact:

Re: Art Format - Complete structure

Post by Crypton » Sat Nov 14, 2009 3:15 am

radzh wrote:I still think we should convert facades as well as .arts.
Ehm, not understood, how you mean that "convert facades as well as .arts"? I'm slow :)

User avatar
radzh
Ailing Wolf
Ailing Wolf
Posts: 29
Joined: Thu Jul 09, 2009 1:15 pm
Contact:

Re: Art Format - Complete structure

Post by radzh » Sat Nov 14, 2009 7:53 am

I mean to convert all the original graphics into new engine formats. I don't like facades from the point of editing; or maybe it's just WorldEd interface made me think facades are evil :)

User avatar
Crypton
Arronax's Best Friend
Arronax's Best Friend
Posts: 420
Joined: Wed Jul 08, 2009 5:04 am
Location: Abyss
Contact:

Re: Art Format - Complete structure

Post by Crypton » Sat Nov 14, 2009 1:49 pm

radzh wrote:I mean to convert all the original graphics into new engine formats. I don't like facades from the point of editing; or maybe it's just WorldEd interface made me think facades are evil :)
Well, facades are great I think, if we dont have, you will need to build house from tiles for example :D and also they are like tile sets, many tiles in one art, so we should convert tiles into facades-like format, one tile set per type, like grass, snow, etc.... to speedup loading, and reduce number of sprites.

:dance:

PS: qtScribe is online....

User avatar
radzh
Ailing Wolf
Ailing Wolf
Posts: 29
Joined: Thu Jul 09, 2009 1:15 pm
Contact:

Re: Art Format - Complete structure

Post by radzh » Sat Nov 14, 2009 1:56 pm

Yes, but working on them individually in the WorldEd is pure hell.
Crypton wrote:PS: qtScribe is online....
Thanks! :)

User avatar
Crypton
Arronax's Best Friend
Arronax's Best Friend
Posts: 420
Joined: Wed Jul 08, 2009 5:04 am
Location: Abyss
Contact:

Re: Art Format - Complete structure - Updated

Post by Crypton » Tue Sep 21, 2010 9:24 pm

Updated - According to my latest research. Now variable names describes exact meaning of their purpose. (These names are taken directly from Arcanum.)

Post Reply