the Phrozen Forums
  Graphics and Animation
  Help with cof files

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Help with cof files
Alkalund
Honorary Warlord

Posts: 964
From: Florianópolis, Santa Catarina, Brazil
Registered: Apr 2001

posted 21 January 2002 20:46     Click Here to See the Profile for Alkalund   Click Here to Email Alkalund        Reply w/Quote   
I am converting the leopard from Bg2, and have already done the dcc files. Now I'm reading Nefarius tutorial and have a question:
I'll replace the quill rat with the leopard. So, checking the frames for each animation I have

Quill rat
A1 - 128
A2 - 104
DD - 8
DT - 112
GH - 48
NU - 64
WL - 72

Leopard
A1 - 112
A2 - 112
DD - 8
DT - 160
GH - 48
NU - 160
WL - 96

So, I have to find cof files for A2, DT, NU and WL right? What I need to know then is if I can use just 1 cof file with different names, so that I don't have to spend half an hour looking for cof files (eg. take dia2hth.cof, that's the cof file related to diablo's second attack, it has 160 frames, so I believe it would solve my problems if I could use just this cof file with different names).

Hope I made myself clear

------------------
Alkalund

IP Logged

Apocalypse Demon
Moderator

Posts: 4023
From: Mississauga, Ontario
Registered: Oct 2001

posted 21 January 2002 20:55     Click Here to See the Profile for Apocalypse Demon   Click Here to Email Apocalypse Demon        Reply w/Quote   
It's easier to just edit animdata.d2 instead of the .cofs...

------------------
God gave me a brain to use but I miserably failed to use it to my advantage

IP Logged

Alkalund
Honorary Warlord

Posts: 964
From: Florianópolis, Santa Catarina, Brazil
Registered: Apr 2001

posted 21 January 2002 20:57     Click Here to See the Profile for Alkalund   Click Here to Email Alkalund        Reply w/Quote   
Really? I don't have to touch any cof files then?

------------------
Alkalund

IP Logged

Apocalypse Demon
Moderator

Posts: 4023
From: Mississauga, Ontario
Registered: Oct 2001

posted 21 January 2002 21:05     Click Here to See the Profile for Apocalypse Demon   Click Here to Email Apocalypse Demon        Reply w/Quote   
Not really, just look for the file string names in animdata.d2 and adjust the frames there...

------------------
God gave me a brain to use but I miserably failed to use it to my advantage

IP Logged

Alkalund
Honorary Warlord

Posts: 964
From: Florianópolis, Santa Catarina, Brazil
Registered: Apr 2001

posted 21 January 2002 21:14     Click Here to See the Profile for Alkalund   Click Here to Email Alkalund        Reply w/Quote   
Thx man, that's great news

------------------
Alkalund

IP Logged

Alkalund
Honorary Warlord

Posts: 964
From: Florianópolis, Santa Catarina, Brazil
Registered: Apr 2001

posted 21 January 2002 21:33     Click Here to See the Profile for Alkalund   Click Here to Email Alkalund        Reply w/Quote   
WOW what's that?? Is that a leopard I'm seeing? Well YES!!! It WORKS!! Huh... wait a sec... what's that... and assertion failure?? Oh man...

The game was working fine, I killed some leopards, and then I got this assertion failure:

Assertion Failure
Location: C:\Projects\Diablo2\Source\D2Client\Engine\GfxUtil.cpp, line #1352
Expression: eComponent < NUM_COMPONENTS

Is that related to the number of body parts? If so then it's weird, because the quill rat only has torso, and I replaced the torso animations.
Any clues?

------------------
Alkalund

IP Logged

Myhrginoc
Honorary Warlord

Posts: 1326
From: Percussion U
Registered: Dec 2001

posted 21 January 2002 22:21     Click Here to See the Profile for Myhrginoc   Click Here to Email Myhrginoc        Reply w/Quote   
I was digging into COF files today, and I think I have a handle on some of their structure. Worth checking, at any rate. All byte counts are decimal but values in hex:

Byte 01: Number of DCC files referenced (not my discovery TeLaMoN has some notes on the CV site).
Byte 02: Number of frames per direction (yes, that would be redundant, it's in the DCC).
Bytes 03-08: So far, I have only seen 08-14-00-9C-00-00 on monster COFs.
Bytes 09-12: Looks like a DWORD negative number, I haven't figured out the pattern yet.
Bytes 13-16: Another DWORD? Always(?) positive.
Bytes 17-20: Another negative DWORD?
Bytes 21-26: Always appears to be 00-00-00-01-00-00.
Bytes 27-36: This seem to be a pointer for an individual DCC, if the null-terminated "hth" at the end is any indication. If there are more DCCs, the structure is repeated for each one. The first one always seems to be 01-01-01-00-05-68-74-68-00, maybe that is the TR (torso) file.
Following the last structure is a series of bytes equal in length to the value of the second byte: if there are ten frames per direction, there are ten bytes here. Occasionally you see a non-zero value---perhaps this is synchronization (e.g. attack on the sixth frame).
The remainder of the file is a layer-assignment table (again, not my discovery), equal to the number of total frames times the number of files per frame. So if you have one DCC (usually a TR file), then if there are 64 frames the table will be 64 successive bytes of 01. The diagram TeLaMoN posted shows Layer 0 to be weapons, 1 right arm, 2 torso, 3 left arm, etc. But I think it varies according to which layer you want forward, and the torso-only COFs have the table assignments on layer 1.

This might be useful when using COFs without enough frames...you should be able to pack the remaining frames and avoid a crash. But watch out---the layer order CAN switch! But is that just at changes in direction, or is it possible in the middle of a sequence?

I just ran across this, I'll post more as I get further.

IP Logged

Alkalund
Honorary Warlord

Posts: 964
From: Florianópolis, Santa Catarina, Brazil
Registered: Apr 2001

posted 22 January 2002 09:20     Click Here to See the Profile for Alkalund   Click Here to Email Alkalund        Reply w/Quote   
quote:
Originally posted by Myhrginoc:

Bytes 03-08: So far, I have only seen 08-14-00-9C-00-00 on monster COFs.

There are more, I've seen 08-14-00-FC-12-00 and others. Will have to do some research on these ones.

quote:
Originally posted by Myhrginoc:

Bytes 21-26: Always appears to be 00-00-00-01-00-00.

Actually I believe that's on bytes 21-27, with an extra 00 at the beginning (ie 00-00-00-00-01-00-00).

quote:
Originally posted by Myhrginoc:

Bytes 27-36: This seem to be a pointer for an individual DCC, if the null-terminated "hth" at the end is any indication. If there are more DCCs, the structure is repeated for each one. The first one always seems to be 01-01-01-00-05-68-74-68-00, maybe that is the TR (torso) file.

That's on bytes 28-36, all the cof files I've seen have 01-01-01-00-00-68-74-68-00 here, maybe there is more than one possibility as well.

quote:
Originally posted by Myhrginoc:

This might be useful when using COFs without enough frames...you should be able to pack the remaining frames and avoid a crash. But watch out---the layer order CAN switch! But is that just at changes in direction, or is it possible in the middle of a sequence?


The layer order can switch? What does that mean?


Thanks Myhrginoc, that was very informative.

I tried to modify the cof files for the quill rat to adjust them to my leopard animation (ie modified the second byte appropriately and added/removed entries at the end of the file with 01 or 0F01 depending on the case). Went to the game, and the same assertion failure appeared after a while. Very weird.

I'll just start from scratch and see if I can put these things to work.

------------------
Alkalund

[This message has been edited by Alkalund (edited 22 January 2002).]

[This message has been edited by Alkalund (edited 22 January 2002).]

IP Logged

Myhrginoc
Honorary Warlord

Posts: 1326
From: Percussion U
Registered: Dec 2001

posted 22 January 2002 17:10     Click Here to See the Profile for Myhrginoc   Click Here to Email Myhrginoc        Reply w/Quote   
I must have missed one of those pesky 00s and got my count off, thanks for picking up on that. After looking at a few more COFs, I too have seen some variation in those unknown sequences, meaning I hadn't looked at enough samples yet. Time to extract the front end for ALL the COFs, like I did with the DCCs the other day.

quote:

The layer order can switch? What does that mean?

Not sure yet, but I did look at a couple of complex COFs. Partway through the frame table the pattern changed, if it was 02-03-06-04-05 then it might be 02-03-04-06-05 later on...meaning that for either one direction layer order was one way and another direction it was different, or that layers were switched around in mid-animation so the layer displaying a more "important" sprite was not masked by one less "important". (I do not know if the latter hypothesis is possible.)

IP Logged

All times are Central Standard Time

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | The PhrozenKeep

© PhrozenKeep.com . all buttons made by the Evilenglishman . swords and shields by DigiBO.


Ultimate Bulletin Board 5.47c