Jump to content

avatars.2da documentation


khelban12

Recommended Posts

Greetings and welcome back everyone.

 

At some old post of mine, i asked about infinity animations and got the answer that the animations are unhardcoded to avatars.2da which is great. I kept postponing messing with it because it seemed tedious to try all the values for each animation trying to find the correct "type".

 

However, i am so accustomed to the new/more beautiful animations to the point that i can't play without it anymore. All my other essential mods like Item Revisions and stuff work great in germb with only IA and 1PP not working. Of course the vanilla engine runs perfectly through wine on linux but i got spoiled from gemrb's modability and speed and i don't like running the vanilla engine.

 

So to make a long story short, i finally tried to mess with avatars.2da and transplant the new animations from IA's anisnd file. I have made almost every animation work but of course i have some questions.

 

1) Does the engine mandate 4letter prefixes for some type of animations or is it coincidental that most of them use 4 letters ?

 

I tried all "type" values for certain animations (like nabassu for example) and i could never make them work correctly. The gemrb log always showed the wrong file being tried. I ran gemrb through strace and again it didn't try to open the correct file (when for example the mtan prefix for tanarri was opened correctly). After some testing, i found what was the cause.

 

void CharAnimations::AddFFSuffix(char* ResRef, unsigned char StanceID,
{
....
	ResRef[6]=(char) (Part+'1');
	ResRef[7]=0;
}
I traced the problem to the above code. The problem arose from the fact that some of the prefixes are 3 letters (for example the nabassu use zaa animation files) while the code "expects" 4letter prefix. When instead of [6]+[7], i used strlen to modify the correct characters, the animations appeared perfectly.

 

2) How does the palette column work ? I tried searching the git-log but couldn't find how the 2 character palette works. I also searched the forum and found this thread where Avenger documents the format but he only mentions that 2 characters mean external BMP palette.

 

@@ -142,6 +296,9 @@
 0x7310     MFIE       MFIE       MFIE       MFIE       4          2          1          *
 0x7311     MFIS       MFIS       MFIS       MFIS       4          2          1          *
+0x7312     MFIE       MFIE       MFIE       MFIE       4          2          MO         *
+0x7313     MFIS       MFIS       MFIS       MFIS       4          2          MO         *
I ask because IA adds a second pair of "Fire Elemental" entries which in the vanilla engine appears purple (if i remember correctly they are used for magic golems in Watcher's Keep). I tried all the combinations i found in the original gemrb file (like GR, AQ, MO, etc) but i could never make them appear correctly.

 

Thank you for your time.

Link to post

1) Good catch, it should be dynamic for the shorter cases. Too bad they didn't come up with the pst approach from the start, it's practically fully externalised.

2) They appear clown-coloured or what? If they're the same as the magic golems, why is there a need for change? Don't quite understand what the desired behaviour is.

Link to post

1) Good catch, it should be dynamic for the shorter cases. Too bad they didn't come up with the pst approach from the start, it's practically fully externalised.

2) They appear clown-coloured or what? If they're the same as the magic golems, why is there a need for change? Don't quite understand what the desired behaviour is.

1) Maybe gemrb's approach is the correct as Avenger hints at and animations should have 4letter prefixes. Is it too much to expect that IA authors (or BWP Fixpack if IA authors have stopped modding) can change the prefixes to use 4letter ones (and hopefully make them use english letters) ?

 

In my case i have already changed them to use only english letters because i couldn't make the vanilla engine see the original filenames on linux. However, i only substituted the "foreign" characters for english ones so i still have them as 3 letter prefixes.

 

2)post-6821-0-92459200-1467914961_thumb.png

These are how the creatures appear in GemRB. The two left are the original Fire Elementals (0x7310,11) and the two right are the new ones (0x7312,13) that IA "adds" that use the same animation files.

 

post-6821-0-97462900-1467914968_thumb.png

 

This is how they should appear. I have tried different combinations in the "palette" field but i didn't understand from the code how it works so i don't know how to make them appear purple.

 

Thank you again.

Link to post

1) Sure, the mod should be fixed, especially if it is still maintained. It clearly worked with 3 letters in the original though, besides being a silly restriction, so we don't need to enforce a minimum of 4. Just the total can't be longer than 8, since it's stored as a resref.

 

2) I've checked and we do display those in wk as normal fire elementals. They're using: 0x7312 ResRef:mfis. So it's not even an IA addition, but a gemrb lack. I'll play around.

Link to post

2) I've checked and we do display those in wk as normal fire elementals. They're using: 0x7312 ResRef:mfis. So it's not even an IA addition, but a gemrb lack. I'll play around.

Thank you for taking time to look at it. I checked a vanilla soa+tob installation and you are right. They indeed use 0x7312 so IA had nothing to do with it.

 

I got the impression that IA changed them to purple partly because the vanilla animate/anisnd.ids files do not have any entry for 0x7312/13 while the IA files do contain the entries and partly because there is the following change in the IA logs.

 

% grep golmag01 *
t-arecre.log:ar3017	golmag01	Magic Golem	Magic Golem	2	29457	ELEMENTAL_FIRE_SMALL	29457	ELEMENTAL_FIRE_SMALL	29458	ELEMENTAL_FIRE_PURPLE	29458
t-arecre.log:ar3017	golmag01	Magic Golem	Magic Golem	2	29457	ELEMENTAL_FIRE_SMALL	29457	ELEMENTAL_FIRE_SMALL	29458	ELEMENTAL_FIRE_PURPLE	29458
IA indeed changes the animation entries for Magic Golems but it changes the area file ones. The area file used Fire Elemental Small and IA changed it to Purple but the area actor animations are not used by the vanilla engine. It only uses the one mentioned in the CRE file.
Link to post

Ok, some preliminary findings:

- these palettes are indeed separate bmp files, but the only existing ones are not using the same pattern as usual: mfieg1b, -g2b, -g31, -g3b (usually one is enough, but could be stance related as their animation type fits [NAME]g[1,11-15,2,21-26] (but not 3 grr))

- none for mfis

- we're doing a horrible coercion, storing these chars inside an int (so 3 is too much already)

 

changing this in-memory, did turn them purple.

Link to post

ok the names are useless. The first two are for the purple ones, the other two for normal fiery ones. Only minor differences between the pairs. Using either still results in pixelation sometimes, so they perhaps both need to be used (eg. dragons use 5) somehow. Or that could be something completely unrelated.

Link to post

ok the names are useless. The first two are for the purple ones, the other two for normal fiery ones. Only minor differences between the pairs. Using either still results in pixelation sometimes, so they perhaps both need to be used (eg. dragons use 5) somehow. Or that could be something completely unrelated.

Although i didn't understand what you are saying :), thank you for taking time to resolve it.

 

Almost all animations work ok. The only problems i have are this one with the purple palette and three sets more.

 

1)

post-6821-0-33915500-1468585051_thumb.png

 

Some "people" animations, but not all of them, appear with a pink ellipsis discoloration of something no matter what type and palette and stuff i tried.

 

2)

post-6821-0-33303600-1468585747_thumb.jpg

 

A few animations have wrong colors or appear completely blurred but only when static. As soon as you move them somewhere, they appear correctly while walking and then again blurred when they reach their destination.

 

3)

post-6821-0-19982800-1468585837_thumb.png

The two planetar (or solar) animations appear way too dark.

 

Have you ever met with these kind of problems before ? If not, then please disregard my post. On one hand it is minor palette problems that do not make the game unplayable, on the other hand Infinity animations is an external mod so i wouldn't like to occupy your time with this. You have done more than enough already.

Link to post

The elemental stuff isn't committed yet, ETA this weekend.

1) Looks related to our missing shadow support. For pc actors, that's an extra bam, though why would it be hardcoded here and pink then? Something for later, will add it to the todo.

 

2) The last one is similar to the elemental problem I mentioned. They're all missing from our table, so some defaults are used. Is there a list of all the files IA/1pp installs somewhere? I'm curious if any extra (bmp) palettes are added.

 

3) Solars appear to use some kind of blur and lightening effect — wasn't this the same in the original? Perhaps it could be achieved by hacking on a permanent fx_glow_rgb or similar? VVCs also support glow, but we don't render that yet, judging from a comment.

Link to post

2) Is there a list of all the files IA/1pp installs somewhere? I'm curious if any extra (bmp) palettes are added.

The content/ subdirectory of my infinityanimations directory contains 7300 files but all of them are bam/wav/plt/2da. The only bmp file i can find is mbas_gr.bmp.

 

The above three animations have the following files.

 

Wyvern (4099 - 0x1003 - ZAC prefix)

zacg33.bam zacg34.bam zac.2da zacg11.bam zacg12.bam zacg13.bam zacg14.bam
zacg21.bam zacg22.bam zacg23.bam zacg24.bam zacg31.bam zacg32.bam
Frost Giant (20523 - 0x502B - MBR prefix)

mbrde.bam mbrdee.bam mbrgh.bam mbrghe.bam mbrgu.bam mbrgue.bam mbrh.2da
mbrha1.bam mbrha1e.bam mbrha2.bam mbrha2e.bam mbrhde.bam mbrhdee.bam mbrhgh.bam
mbrhghe.bam mbrhgu.bam mbrhgue.bam mbrhsc.bam mbrhsce.bam mbrhsd.bam mbrhsde.bam
mbrhsl.bam mbrhsle.bam mbrhtw.bam mbrhtwe.bam mbrhwk.bam mbrhwke.bam mbrsc.bam
mbrsce.bam mbrsd.bam mbrsde.bam mbrsl.bam mbrsle.bam mbrtw.bam mbrtwe.bam
mbrwk.bam mbrwke.bam mbr.2da mbra1.bam mbra1e.bam mbra2.bam mbra2e.bam
Scorpion-like creature (21105 - 0x5271 - MCA prefix)

mcasde.bam mcasl.bam mcasle.bam mcasp.bam mcaspe.bam mcatw.bam mcatwe.bam
mcawk.bam mcawke.bam mcaa1.bam mcaa1e.bam mcaa2.bam mcaa2e.bam mcaa3.bam
mcaa3e.bam mcaca.bam mcacae.bam mcade.bam mcadee.bam mcagh.bam mcaghe.bam
mcagu.bam mcague.bam mcasc.bam mcasce.bam mcasd.bam mca.2da

3) Solars appear to use some kind of blur and lightening effect wasn't this the same in the original? Perhaps it could be achieved by hacking on a permanent fx_glow_rgb or similar? VVCs also support glow, but we don't render that yet, judging from a comment.

Yes they use the same animation prefix as the original. IA doesn't copy any msol/masl files. The above capture was with the vanilla animations without other modifications.

 

1PP also changes solars. With the 1PP files copied to override, i get the following result.

post-6821-0-97099700-1468610183_thumb.jpg

These files result in the same appearance in both gemrb and vanilla engine, that is the lighter colors with a black outline. (Edit: I forgot to mention that 1pp also has some binary-patching weidu code that patches the exe so that the black outline is removed but without this patch, i got the outline even in the vanilla engine so gemrb shows these files correctly. the vanilla ones appear darker though as shown in the previous post)

Link to post

About the pink ellipsis at the feet - is it the shadow palette entry messed up by bamworkshop ?

I fired NearInfinity to check if i can find the shadow palette and the animation is played with the shadow as in the following picture.

post-6821-0-93623900-1468660541.png

 

So, gemrb is once again showing the file as it should, right ? Maybe the exe patching code is at work again and the vanilla engine shows it differently.

 

I feel ashamed now that it didn't occur to me to check the files in NearInfinity/DLTCEP and i wasted your time for nothing. I am sorry for that.

Link to post

The scorpion thing is an osyluth from nwn. Did you use animation type 9 for its entry?

 

The giant clearly has more animations than we handle, that's why they needed to use a 3-letter prefix. A new animation type is needed (base is 9/IE_ANI_TWO_FILES_3 in iwd2). Maybe that would fix the coloring issues.

 

The ice wyvern leaves me puzzled.

 

That's a pst civilian iirc.

Link to post

The scorpion thing is an osyluth from nwn. Did you use animation type 9 for its entry?

 

The giant clearly has more animations than we handle, that's why they needed to use a 3-letter prefix. A new animation type is needed (base is 9/IE_ANI_TWO_FILES_3 in iwd2). Maybe that would fix the coloring issues.

 

The ice wyvern leaves me puzzled.

 

That's a pst civilian iirc.

Yes, i used type==9 for both the giant and the osyluth. For the wyvern i use type==11.

Link to post

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...