.kfm and broken pedias

WarKirby

Arty person
Joined
Jul 13, 2006
Messages
5,317
Location
Glasgow, Scotland
I'm presently trying to make a unit work with a kfm I assembled from Sumerian vulture and Azec Jaguar animations. The unit works and animates perfectly, but it's civilopedia entry is broken. showing no text or model.

The interface model in the lower left of the screen, is also broken.

I've run into this problem before. It's due to having a custom .kfm. it requires a nif of the same name, to copy bone information from or somesuch thing.

The setup I currently have, is my unit in one folder, AustrinChampion.nif, and then the artdefine pointing to the .kfm in a different directory. That directory contains the AustrinChampion.kfm, as well as all the .kfs it uses. I changed the names of those too, putting in "AustrinChampion" instead of "aztec_jaguar". In that directory, I also included a copy of the AustrinChampion.nif, with all trishapes stripped out so it's just the armature.

As far as I know from previous occurrences of this issue, the above setup should work.

But it doesn't. I can't figure out why. The pedia entry and interface model still refuse to display.

Can anyone suggest what might be wrong?
 
The setup I currently have, is my unit in one folder, AustrinChampion.nif, and then the artdefine pointing to the .kfm in a different directory. That directory contains the AustrinChampion.kfm, as well as all the .kfs it uses. I changed the names of those too, putting in "AustrinChampion" instead of "aztec_jaguar". In that directory, I also included a copy of the AustrinChampion.nif, with all trishapes stripped out so it's just the armature.
I can't help you much. All I can suggest is putting all files belonging to that unit in one directory. Don't know if it is okay to rename the kfs. Guess they have to fit to the name of the kfm. So far I had serious problems when renaming the kfm, instead try renaming the nif to make it fit to the kfm (it could be that the aztec jaguars kfms name is required in your case). I have to say that I never changed a kfm so far. My hints are based on units that have been made via bonetransplantations for example, so actually no new animation.
 
All I can suggest is putting all files belonging to that unit in one directory.

This is how I had it to begin with. I seperated it after that didn't work.

Don't know if it is okay to rename the kfs. Guess they have to fit to the name of the kfm. So far I had serious problems when renaming the kfm, instead try renaming the nif to make it fit to the kfm (it could be that the aztec jaguars kfms name is required in your case).

I could give this a try, but I can't see any logical reason why it would work. I've seen custom .kfm with unique names. Perhaps there's some information in the .kfs which requires a specific .kfm name. But then, if that's true it's a no win situation because I have animations from two different units in this .kfm, and it cannot have two names at the same time.

I didn't just rename the .kfs. i changed their names within the kfm too, and encoded that so it references them all properly
 
Well, I didn't change anything within the kfm when getting trouble after renaming it, so for you it may work the way you did it.

But then, if that's true it's a no win situation because I have animations from two different units in this .kfm, and it cannot have two names at the same time.
Yes, I thought about that, too. As I said I never edited units the way you did it, so I don't know if your technique works at all (or maybe only under special circumstances). I guess you followed some tutorial. If so, there must be a way to fix your problem. I could imagine that it would work if you...
a) rename the kfm so that it fits to the nif (as already mentioned) and
b) within the kfm encode the kfs names so that their name convention fits to the kfm and the nif.
When I had problems with renamed kfms, I never touched the kfs and all kfs were from a single unit. Therefore their names must have been encoded correctly in the kfm (as they were encoded correctly before as well), thus the problem seems to be that the name of the kfm and the nif have to fit to each other, without having the kfm renamed. In other words the kfs names don't play a role if they are only encoded correctly within the kfm. Well, that's just theory. In your interest I hope that someone else, that already moded units the way you do it, will join this in order to help you. I am too less experienced with kfm and kf stuff, sorry. Just thought that the kfm renaming issue could be related to your problem.
 
Hooray, I think I've solved it. Still need to do a little testing, but so far pedia works, and animations work.

To fix it, I had to include the .nifs of ALL units involved in the animations, within the animation folder. So it now contains

AustrinChampion.nif
aztec_jaguar.nif
unique_sumerian_vulture.nif

I had to change the names of the .kfs back, too. renaming them was a mistake, and it wouldn't work until I reverted them to the original names. It would seem that each kf is tied uniquely to a particular nif, not just a skeleton. And so all the nifs need to be included even when they have the same bone structure. I left the kfm name as AustrinChampion.kfm though, that works.

Also worth noting, my animations are still in a seperate folder from the unit itself. I don't think this makes too much difference, but it's good to know that it can work this way. I like to keep animations seperate to use as an easily referenced resource for multiple units. If they were in the unit's own folder, the AustrinChampion.nif wouldn't be needed.


Rules of Thumb for Custom KFMs.

1. All animations referenced must be included in the same folder as the .kfm
2. All involved .nifs must be in the same folder.
3. The folder must contain a .nif with the same name as the .kfm
4. The .kfm can have any name, as long as there's a nif with the same name.
5. The .kfs CANNOT be renamed. They must be left with original names
6. The animation set does NOT have to be in the same folder as the unit that uses it. I find it better to store animations in some central, easily referenceable folder
 
My problem when renaming the kfm was, that if there were several units in a city (probably also on any other field), the unit that used the renamed kfm couldn't be selected although it occured in the list of available units in this field. So for testing, try to put around 5 (different) units, at least one with and one without renamed kfm and try selecting them. Good luck, hope it'll work!
 
I know, I had that issue too. It is all the same problem. The symptoms:

1. Pedia is broken
2. unit cannotbe properly selected
3. unit's button doesn't show
4. unit's interface model doesn't show.

they all have the same cause. Following the rules of thumb above should fix it. Why not give yours another try?
 
Well, I could do that, but for me it was a lot easier to fix this. I just renamed the nif instead of the kfm (the initial problem was what you already described: the unit didn't show up in the lower left corner - this can be solved if the nif and the kfm have the same name, if I remember correctly). Sure, the nif have a name that doesn't fit to the unit this ways, but I would have to re-encode a lot of kfms otherwise (I would have to apply this procedure to a lot of units)...

My only problem is the freeze-mode bug. If I leave the (unmodded) freeze nifs in the units' directory and deactivate animations inside the game, the unit turns back into the original unit. Because of performance reasons I'd prefer freeze-mode safe units. As far as I know there is no easy way to fix this. If you ever find such a way, let me know :)
 
normally there must be a nif with the same name like the animation (unless somebody makes a bad joke when creating a custom animation). The kfm requires a master nif, where the game (i think) looks after the general structure and the name of the bones, for vanilla units both, the kfm and the master nif, have the same name beside the ending.

It must no necessary be the original nif, but it must a nif with the same internal structure (but tbh i never tested what happens if not), so no problem if your rename the paladin.nif to modernarmor.nif

A good test ist to open the kfm with nifskope, if you see an unit, the needed nif is there, if you don´t see an unit, the nif is missing

broken pedia and no interface model is in 99% of all cases i saw caused by the missing master nif of the kfm. Also in the kfm the animations are refered by name, so without altering this file changing the name of the nif and / or the kf will break something (while the name of the kfm is more or less custom [you can rename the warrior.kfm to test.kfm and it will work as long there is the warrior.nif and the not renamed warrior kfs in the same folder])
 
(while the name of the kfm is more or less custom [you can rename the warrior.kfm to test.kfm and it will work as long there is the warrior.nif and the not renamed warrior kfs in the same folder])
I am quite sure that you, The _Coyote, are one of the most experienced unit makers, but this one I won't buy. I saw with my own eyes that renaming the kfm causes the error I mentioned, I am 99% sure of that (and you should know that I never say that I am 100% sure, no matter about what topic it is :) ). Maybe the problems I got, happen only under specific circumstances (certain system configurations or whatever), but they can happen if the kfm has been renamed.
 
made exactly the test like described above and it worked fine, made a copy of the warrior.kfm called test.kfm and linked the warrior to 'new' kfm. All others files were untouched (kfs, nifs) and all worked fine

i´m still curious what happend in your case, so if you can remember such a situation it would a great example to learn a bit more about how civ4 works
 
Well, I believe you that it can work if you rename the kfm. But only because it works for you, that specific unit and your specific machine, it does not mean that it works ever. I could think of something similar like the problem with the freeze nifs. When I recognized that for the first time and confrontated others with that, they wondered. Same xml and units worked for them perfectly, but not for me - only because of some setting in the menu. Even the maker of the unit didn't even recognize that there exists such a problem before I told him. Now, although the reasons for the two problems might be, and most probably are, different, there could be a similar effect. I can assure you that I had this problem after renaming a kfm and it disappeared after I renamed it again (to the initial name).

I think, but I am not sure (we are speaking about a 60% chance this time ;)), that the buggy unit was an archer I used for the magyar mod (it is not Bakuels new version, but the one I used before). I am sure it occured with the magyar mod, there is almost no other mod I am working with. And I am also quite sure, that the buggy unit was an ancient or a medieval unit (in the case it wasn't the archer). It may be that I later tried to force that problem with other units, just for fun. If so, the problem occured for them as well (otherwise I wouldn't have considered the renaming of the kfm to be the cause of the problem). Unfortunately it is some time ago that I had this problem. I've changed a lot in the mod since (and never had that kind of problem again after keeping the kfms names). You may try to download my magyar mod (you'll find it in the new civilizations section on civfanatics) and have some fun with the archer (the latest published version still doesn't contain Bakuels new archer - that one will be released with the next version; therefore trying things out should be easy). I could do that by my own, but my time is quite limited currently.
It may also be of interest that my computers are rather old. Can't remember if I tried that on both computers, but they are similarly slow (we are talking about a laptop and a desktop machine, both with single core processors, bouth 512MB RAM and 64MB graphics) and I use (almost?) the same (graphics) settings in civ4 on both - which are the lowest. You might consider playing around with the animation settings, so run it with deactivated animations. I would really wonder if it would be related with the resolution, just don't see how this could affect the kfm...

EDIT: There is also something I am not sure if it plays a role. The archer I mentioned was made out of the default turkish archer civ4 plus a different head. Your warrioir you have played around with, might have been an original warrior. As we've seen in the inital post of WarKirby, such combined units may be tricky.
 
my last post was a bit misleading, i only posted that it worked in this case because it was only an assumption before and after you said that there can be problems i thought a test of my assumption would be nice (knowing that one test is not really a prove that it works - also not saying that it must work) ;)

more interesting was the second part (thank your for your explaination), where you had the problem, dl the magyar civ and tested a bit. Unfortunally i was unable to reproduce the problem (set my setting to frozen animation, all three archers [incl. crossbow] got the kfm changed to test.kfm). At least this test showed the the frozen animation are linked to the name of the kfm, with test.kfm even the vanilla warrior had no longer frozen animation, renamed again to warrior.kfm and all was again fine, so the frozen animation must have corresponding names to the unit kfm (and not the nif what i thought until now).

Because of the huge number of possible reasons (game setting, graphic card, modluar loading, etc) for the error i fear a trial and error test from my side wouldn´t really help to find the true reason for the problem :(
 
Hmmm... I thought this would happen. Even I would have problems reproducing the bug. I guess I'll try it with my machines, but that can take me a while. As mentioned I have not much time right now, even enough to post some short texts. And unfortunately this will last till the last week in july. Hope I won't forget this till then. At least I'll have some time to think about this. I'm still sure that I haven't mixed up anything and that renaming the kfm can cause trouble, but maybe I remember something that could be part of the trouble. Something that built up some kind of unholy alliance with the renamed kfm... I'll send you a pm if I find out something.

At least this test showed the the frozen animation are linked to the name of the kfm, with test.kfm even the vanilla warrior had no longer frozen animation, renamed again to warrior.kfm and all was again fine, so the frozen animation must have corresponding names to the unit kfm (and not the nif what i thought until now).
Well, at least the time was not wasted then :goodjob: The freeze-mode issue still bothers me. Although it is acceptable the way it is now (with no freeze-nifs at all), I would be happy if someone could find a humane way to create such freezes, even if it is with Blender & Co.
 
not really a human way if you would ask me, but the only way(s) i can imagine so far:

(should be the better way - less number of bones etc)

1) import the nif and the animation of which you want the frozen animation (the numbers after the name are the keys - check the animation flowcharts to see the corresponding sequence)
2) make a copy of the model and unrig this copy (remove all bone information of the model)
3) go to the still rigged unit in pose mode and check the start position (how the unit looks at frame one)
4) try with rotation of vertices (eg entire arm - all arm vertices) to mimic this by the unrigged model (no longer a bone to this this)
5) export the unrigged model (remove all other parts before this) and copy this exported model in a frozen nif [just in case there are important information] - if needed rename the NiTriShape and adjust textures

second option (much more work and will cost more performance - still all armature bones left):

1) import the model with the corresponding animation
2) without doing anything in Blender export the animation (to get rid of the Splines ...)
3) open a frozen nif and the unit nif in nifskope
4) copy first the entire armature of the model in the frozen nif and afterwards the unit, afterwards save the nif (backup, just in case something goes wrong)
5) open also the exported animation
6) go to every armature node and change the rotation / position to the values of the corresponding controller of this node at time 0

but like said, imo both ways aren´t really human ways to do this.

If there a way in Blender to actual copy a position from pose mode to the armature position/rotation [would lead to a blender method for option 2] and also make the model holding the deformation after removing the rigging i would call it a human 'way' [option 1, or perhaps you ask for such a feature (export the model in the pose of frame one of the animation, but with no armature rigging) in the niftools forum, perhaps amorillo can make a new export without much work]
 
Back
Top Bottom