罗马全面战争骨骼破解,加入自己动作的方法
本帖最后由 unicornvalley 于 2011-6-6 21:42 编辑RTW skeletons CRACKED!!
原帖地址:http://forums.totalwar.org/vb/sh ... skeletons-CRACKED!! by wlesmana
翻译从8楼开始!
For a good part of the year or so, I have been working closely with Knight Errant, a programmer who wrote tools for M2TW modding, on cracking the ever elusive skeleton file of RTW.
First of all, let's review a bit about RTW's skeleton and animation system.
In data/animations folder, you get these files:
pack.dat
skeleton.dat
pack.idx
skeleton.idx
In these files, if you extract from them, you get the skeleton files such as fs_dagger, fs_archer, etc, and the animations (inside the data/animations folder in this folder) such as LIS 01 Stand Idle.cas. A brief explanation of what these are:
- Skeletons contains the location of bones, how many there are and entries on which animation to trigger during specific events such as attacking, dying, running, etc.
- Animation files, while also in the CAS format, is different than the CAS file for models. In this, the file only contains ROTATIONS of the bones. There is no data on the location of the bone or the animation of movement (except Scene Root).
To edit animations and skeletons, we must first extract them using Vercingetorix's XIDX tool. You will get all the skeletons (fs_swordsman, fs_archer, etc) and the animations (in the data folder). anim_list.txt is the list of animation CAS files to re-pack and list.txt is the list of skeletons to re-pack. Any changes made must be re-packed, otherwise they won't register since the game only reads the .dat and .idx files.
We can create a "new" skeleton by copying an existing skeleton (i.e. copy fs_swordsman into fs_backward_spear) then using Vercingetorix's XIDX tool, we can hack into it and replace certain lines. For instance, when hacking fs_swordsman, we can replace the line:
data/animations/LIS 18_03 Stabbing downwards
with
data/animations/LIJ 07 Javlin throw_FASTER.cas
This would replace the animation of stabbing with the animation of throwing the javelin. HOWEVER, the sound triggers will not change because we cannot alter that with Verc's XIDX. Replacing entries is about the limit of XIDX.
With that in mind, here are the basic problems with RTW animation and skeleton system:
1. You cannot add new bones, as in you cannot make a new skeleton type. Sure, you can export new bones on your model, or even export new animations with that new skeleton. But the game cannot recognize it because the skeleton file, the fs_whatever, will not accept the new bones. Case in point, fs_slinger_new, which has one extra bone. You cannot use the slinger's model on any other skeleton without first exporting it WITHOUT the extra bone, nor can you use the fs_slinger_new skeleton on any other model without first exporting the model WITH the extra bone. If you want to see this problem, try changing the skeleton type in DMB for slingers then see how they look in-game.
2. You cannot re-arrange bones. You're stuck with whatever skeletons already existed because in order to create "new" skeletons, you must copy from an existing fs_whatever. The animations also does not contain any positions of the bones, only their rotations (except for Scene Root). So far, with Vercingetorix's tool, you can only hack into the skeleton file and change animation entries.
3. You cannot add or remove sound triggers. Originally this is done via EVT files. But the skeleton does not care for this EVT files which contains the sound file's name and the time it is to be triggered. This is dilemmatic for my mod, where the wargs sound like horses because they use the same skeleton thus having the same sound triggers. You either use the horse sounds or none at all. The problem lies, again, in fs_whatever skeleton file.
4. You cannot mount riders on any other skeleton that does not already be designated as mounts. These are elephants, horses and camels (cavalry). You cannot put riders on dogs, pigs and humans even if you identify them as cavalry. For instance, my wargs use the skeleton of a horse but with new animations. My trolls are using human skeleton but listed as elephant, therefore the "crew" on this elephant is "missing", as in the game engine will not render them. This is because non-cavalry skeletons do not have a "mount bone", as I call it, a bone designated to be the mounting point. If you want to see this, just use the wardog entry in DMB and use it as a mount. The rider will be missing until the mount is killed, then the rider will pop into existence and start the death animation.
5. Incompletions of some skeletons. For instance, fs_archer cannot engage in melee (thus an archer DMB entry has 2 skeletons: fs_archer, fs_dagger) while fs_slinger_new could (the entry is fs_slinger_new, fs_slinger_new). But fs_slinger_new has no "battle reaction" animations. It's missing dodging, feigning and blocking. They just don't trigger and the soldier just stands there. You can't do anything since you can't add triggers, or even remove them.
Now, all of the problems stated above has been resolved, with a new tool written by Knight Errant. The tool is still in experimental stage and it requires a great deal of knowledge of the animations system and manual work to use it though. So I will try to share whatever knowledge and information I managed to extort from it.
NOTE: Keep in mind that this thread will focus on the skeleton editing and NOT on animations, packing or other parts of modding. Please do not clutter the thread with general questions about animating in MAX, modeling and those other stuff. There are already tutorial threads on those aspects of modding.
This the tool: RTWskeletonconverter
It requires you to have Python installed.
Put it in data/animation where you have all of the skeletons for easier use. This tool can do 2 things:
1. It will read, for instance, fs_dagger and create fs_dagger.txt. In other words, it converts the skeleton file into a text file which you can read and alter.
2. It can convert the text file back into skeleton file. For instance, you modified fs_dagger.txt and renamed it fs_twoknives.txt. The toll will convert it into fs_twoknives_modified. The "_modified" addition is done to keep it from overiding an existing skeleton by mistake.
Ok, now let's crack open fs_dagger and get fs_dagger.txt. If you open it up, you will see this:
Code:
+1.0000000
19
0 0 063 0 0 0 0 +0.0000000 +0.0000000 +0.0000000 -1
114 0 10997 0 0 0 0 +0.0952390 +0.0007523 +0.0000001 0
0 0 0 0 0 0 0 0 +0.0234129 -0.4646038 -0.0049952 1
114 0 10997 0 0 0 0 +0.0231562 -0.4006252 -0.0124050 2
32 03232 0 0 0 0 -0.0000000 +0.2124624 -0.0000000 0
71 1 0 0 0 0 0 0 -0.0002945 +0.2115581 +0.0000000 4
59 15959 0 0 0 0 -0.0000617 +0.2349734 +0.0000000 5
59 05959 0 0 0 0 +0.0040140 -0.0843266 -0.2039877 5
59 05959 0 0 0 0 +0.0000000 -0.2602941 -0.0697457 7
59 03265 0 0 0 0 +0.0000000 -0.2600267 -0.0696740 8
10 05913 0 0 0 0 +0.1786139 +0.0782279 -0.0239007 5
59 05959 0 0 0 0 +0.3022083 +0.0110892 -0.0137860 10
59 05959 5 0 0 0 +0.2838367 -0.0030067 +0.0263546 11
59 05959 0 0 0 0 -0.1780248 +0.0782278 -0.0239007 5
78 09566 0 0 0 0 -0.3022082 +0.0110892 -0.0137860 13
0 06578 4 0 0 0 -0.2838367 -0.0030065 +0.0263547 14
66 06978 0 0 0 0 -0.0952390 +0.0007524 +0.0000000 0
77 01310 0 0 0 0 -0.0234127 -0.4646038 -0.0049953 16
116 0 10997 0 0 0 0 -0.0231561 -0.4006253 -0.0124050 17
0 0 063
150
Somewhat daunting, I know. And there's no manual for it too, unlike many text files you can modify in RTW. There are only numbers, which we must try to interpret and explore what they do.
This is what I have found out about what they mean or might mean:
A. This is the size of the model. Verc's XIDX can resize a model by multiplying this number and E with the new size. You can use that for easiest resizing, or you can edit this number and the coordinates to get a resize.
B. This is the number of bones in the model, excluding Scene Root, which technically isn't a bone.
C. Now this, is still elusize. I have no idea what these numbers do. If they're for some reason does SOMETHING, most of them are unused in fs_slinger_new, which uses 0 instead of a number. So I have no idea what they do. Making them all 0 (which I did try) doesn't appear to change anything on the soldier's behavior, except during the firing of a missile. It's still too hard to notice anything right now.
D. This is pretty useful. 5 0 0 0 means it's the "right hand" so far only used as an attach point for pikes. Naturally it's on the right hand bone. If you change it to head bone, then pikes for pikemen units will be attached to the soldier's head. Making it all 0 will make pikes attached to Scene Root, aka. the pelvis (yes, it's juvile joy of watching your soldiers "raise" and "lower" his pike). 4 0 0 0 is used on the left hand bone. As of now, I have no idea what this is used for. 1 0 0 0 is the bone designated for the mounting of horse or camel. Basically it means 1 rider per mount and it follows the triggers of a horse type. 2 0 0 0 is used for elephant skeleton, so this is a mounting bone for a skeleton used as elephant. If you used this attribute on another bone, the engine will attach the crew/rider of the mount on that bone. So adding 1 0 0 0 on a bone will enable that skeleton to attach a horse rider on it. I have no idea if 3 0 0 0 is used at all since I couldn't find a skeleton that uses it.
E. Now this is the main attraction. This is the list of the bone's coordinates in respect to its parent. Changing the values of these will alter the appearance of a skeleton. You can extend arms, or the neck or create an entirely new skeleton.
F. This is the hierarchy of the bones, which bone is which bone's children, etc. I will explain how to make the list easily later in this post.
G. Unknown. Doesn't seem to do anything, really. fs_slinger_new and fs_archer even list them as all 0s.
H. The number of animation entries.
I. The entry for the animation to use. The list of animation triggers appear to be a set list. You cannot move stand_idle to the bottom and expects the engine to activate that for standing idle. It will always read the first entry as stand_idle. There appears to be a pre-determined set of trigger to be read when the engine reads a skeleton file.
J. Most of these is unknown. There's little difference between this entry's numbers and the others. There are some exceptions, most notable is the IMPACT FRAME number, where it indicated the frame an impact is supposed to occur when an attack animation is played so the opponent may react accordingly. This one is interesting because during my testing, if you put the impact frame to be 0, then the attack will not commence. If you put impact frame on all attacks to be 0, you will get a unit/soldier that CANNOT attack! Further research required.
K. This is the number of entries of sound triggers. If there is no sound to be activated, this number is set at 0.
L. I'm semi-certain the number here corresponds to the type of sound data banks. Further research required.
M. I'm semi-certain the first number is the frame the sound should start to trigger and the third number is the last frame the sound could trigger. Having the same numbers mean the sound is always triggered at that exact frame, having a range means they could be triggered at any time within the range. Note that this is still my speculation.
N. The name of the sound file/bank to derive the sound files from. This is what you change if you want this particular skeleton to produce a different sound than the one you copied it from.
O. This is still unknown. It appears to be relevant but I still don't know what they're for.
Then, we see this part:
The "0 0 0" is from fs_dagger, which you cannot use for a missile unit. That "0 0 0" is actually 3 animation triggers that are deactivated, they are missile_aim, missile_hold and missile_fire, which can be seen at the figure below it from fs_archer. I have tested and copied the 3 entries from fs_archer and paste it on fs_dagger to make a new skeleton and it works. I can just use "fs_archerdagger, fs_archerdagger" for entry in DMB instead of "fs_archer, fs_dagger". I am unsure why CA would deactivate some animation triggers. Perhaps there's a limit on the number of triggers? Or perhaps they do it simply to make skeleton files less cluttered, as in less triggers better performance.
If we compare all of these entries then we find that each skeleton is read in a series of triggers. If the entry is simply "0" then the game would say "There's no entry for it, can't play, let's crash instead!" like if you used "fs_dagger, fs_dagger" for a unit with a missile attack since missile animations are missing from fs_dagger.
Ok, so let's get to the meat of the possibilities. What are really possible with this tool? Here's an example:
This is a screenshot of my testing of a completely different skeleton but a very simple one: a snake, which is just a straight line.
This is the model I quickly made up for this testing.
I made 1 animation to test and the result can be seen here:
http://www.youtube.com/watch?v=CiRFnRK3yTU
But what can a new kind of skeleton do for existing models/units? Well, we can now do what M2TW modders already did with adding new bones, like this:
http://www.youtube.com/watch?v=DNNNEie1nn4
Note that there is a drawback to this method, meaning the bow cannot be "hidden" by the engine when switching weapons. This is because it is animated, thus will not be read as "primary weapon" stand-alone object. We are also bound by the hardcode: there's a maximum of 24 bones per skeleton. I tried adding more and the game just CTD without error message.
Even though it only appears I added very few new animations on the archer, in fact ALL of the animations are new. Basically, I had to export every single animation to be used by the new skeleton (with 24 bones instead of the regular 19 bones) because the way the engine reads animations.
The RTW engine (which I think was rectified in M2TW) reads every bone in the skeleton by a set list. For the regular skeleton RTW use, this is the list:
bone_pelvis
bone_abs
bone_torso
bone_cloak_top
bone_cloak_mid
bone_cloak_bottom
bone_head
bone_Lupperarm
bone_Lelbow
bone_Lhand
bone_Rupperarm
bone_Relbow
bone_Rhand
bone_LThigh
bone_Llowerleg
bone_Lfoot
bone_RThigh
bone_Rlowerleg
bone_Rfoot
The list's coordinates can be seen in part E above. If you convert fs_archer and fs_slinger_new you will see the difference. The slinger has an extra bone after bone_Rhand called bone_Weapon. Note that the names of bones are irrelevant. The engine ignores the names and only reads from the list. Meaning if you used a regular skeleton's animation (19 bones) on a slinger (20 bones), the rotation value of bone_Rthigh will be applied to the slinger's bone_Weapon and so on, until the slinger's last bone, bone_Rfoot, receives no rotation. Importing a slinger's animation on a skeleton with less than 20 bones will cause an error on the MAX script. You can easily test this in MAX: open the slinger's model, then import a regular animation, it will show up weird. Now try it again but delete bone_Weapon before importing the same animation. The slinger model should animate normally.
So making a new skeleton for RTW has its drawback: you have to make every single animation it's going to use. Sure, it's not really that hard since in my case, I just imported existing animations, add in the new bones then export them. Only 3 animations are using the new bones: readying the bow, holding the bow and firing the arrow. It's a time-consuming labor mostly.
So, in summary, to create a new skeleton, this is what you must do:
1. Make the model with the new skeleton.
2. Export it as a CAS model, then press F11.
3. Copy the data shown by the scipt, this is important.
4. Make all the new animations you want to use on your new skeleton, export them with all the bones.
5. Extract all the skeletons and animations.
6. Pick the closest skeleton you want to use, copy it and rename.
7. Convert the new skeleton into text file, open it.
8. At the bone coordinate part and hierarchy, use the data from part 3. However, be sure to convert the coordinates rom (x, y, z) in MAX to (-x, z, -y) for the skeleton.
9. Change all the animations into the new animations. Change any sound trigger if you want.
10. Convert the edited skeleton text file into skeleton file. Delete the old one, rename the new one.
11. Add the new skeleton name in list.txt.
12. Add all the new animations in anim_list.txt
13. Repack skeletons and animations.
14. Use the new skeleton in DMB.
Now let's get crackin' and figure out what else can we uncover from this!
Many thanks to Knight Errant for writing this wonderful tool and putting up with my endless nagging for revisions and info.
PS. Also from Knigh Errant, a fix for Vencingetorix's CAS Export/Import tool here: CAS_IE_b79_modbyKE_ver3.ms
This updated tool does nothing for the average modder who only deals with models. The fixes are for animations. It fixes the animation glitch where soldiers will not reach their actual destination if the walking animation is edited. They will now reach their intended spots. Also fixed is the glitch where the soldier have to do a 90 degrees turn and the engine cannot turn them partially. They can now do so without glitching. One more glitch still exists though, which is the not-reaching-destination glitch for mounted units.
MS还是有些用的,那就开始干活吧,由于本人纯手工翻译(就当练字了……),而且也没做过MOD,所以许多专业术语的翻译必然有所偏差,请各位专业人士帮助指正。
第一部分:
For a good part of the year or so, I have been working closely with Knight Errant, a programmer who wrote tools for M2TW modding, on cracking the ever elusive skeleton file of RTW.
最近一年的大部分时间里,我都在与Knight Errant合作,破解RTW的骨骼文件。
First of all, let's review a bit about RTW's skeleton and animation system.
In data/animations folder, you get these files:
pack.dat
skeleton.dat
pack.idx
skeleton.idx
首先,让我们来回顾一下RTW的骨骼和动作文件系统。
在data/animations文件夹中,你可以看到如下文件:
pack.dat
skeleton.dat
pack.idx
skeleton.idx
In these files, if you extract from them, you get the skeleton files such as fs_dagger, fs_archer, etc, and the animations (inside the data/animations folder in this folder) such as LIS 01 Stand Idle.cas. A brief explanation of what these are:
在这些文件中,如果你将其解压,你可以得到诸如fs_dagger, fs_archer等骨骼文件,和如LIS 01 Stand Idle.cas.等动作文件,下面我们对这些文件做个简要介绍:
- Skeletons contains the location of bones, how many there are and entries on which animation to trigger during specific events such as attacking, dying, running, etc.
骨骼文件包含其组成各部分(即骨头)的位置,它们的数量以及模型攻击、死亡、奔跑等情况出现时需要触发哪个动作。
- Animation files, while also in the CAS format, is different than the CAS file for models. In this, the file only contains ROTATIONS of the bones. There is no data on the location of the bone or the animation of movement (except Scene Root).
动作文件,同样是CAS格式的,却不同于CAS后缀的模型文件,在这里,文件中只包含骨骼各组成部分的旋转方向,而没有其位置及实际动作的数据。
To edit animations and skeletons, we must first extract them using Vercingetorix's XIDX tool. You will get all the skeletons (fs_swordsman, fs_archer, etc) and the animations (in the data folder). anim_list.txt is the list of animation CAS files to re-pack and list.txt is the list of skeletons to re-pack. Any changes made must be re-packed, otherwise they won't register since the game only reads the .dat and .idx files.
要编辑动作及骨骼文件,我们必须首先用Vercingetorix's XIDX tool将其解压。你会得到所有的骨骼(如fs_swordsman, fs_archer等)和动作(在data文件夹里)。anim_list.txt记录了所有需打包的动作文件,而list.txt记录了所有骨骼文件。所有修改后必须重新打包,否则它们无法注册因为游戏只能读取.dat和.idx文件。
We can create a "new" skeleton by copying an existing skeleton (i.e. copy fs_swordsman into fs_backward_spear) then using Vercingetorix's XIDX tool, we can hack into it and replace certain lines. For instance, when hacking fs_swordsman, we can replace the line:
data/animations/LIS 18_03 Stabbing downwards
with
data/animations/LIJ 07 Javlin throw_FASTER.cas
我们可以通过复制一个已有的骨骼来创造一个新的骨骼(比如将fs_swordsman复制到fs_backward_spear),通过Vercingetorix's XIDX tool,我们能够替换掉某些数据。比如,我们可以进入fs_swordsman,将data/animations/LIS 18_03 Stabbing downwards替换为data/animations/LIJ 07 Javlin throw_FASTER.cas
This would replace the animation of stabbing with the animation of throwing the javelin. HOWEVER, the sound triggers will not change because we cannot alter that with Verc's XIDX. Replacing entries is about the limit of XIDX
这样就将刺这个动作替换为投掷标枪。但是,声音的触发不会改变,因为我们无法靠Verc's XIDX改变声音。XIDX能做的只限于此。
今天回来晚了,明天继续……
好久不来发现论坛终于清静了,不过太清静也不好,正好来添点儿人气~
本人不是MODDER,也不晓得目前MOD制作的现状,所以随便找了一篇,根据时间来说比较久远了,不知道是不是已经尽人皆知,如果是就删了吧,我就不译了,毕竟字还不少,呵呵,如果有需要的话从明天开始翻译。 期待 {:5_131:} 翻译完的期限是一周 不着急 慢慢来
null
这篇关系到真实弓的做法,很有用,有难度,涉及3d 期待{:5_131:} 骨骼的貌似在三国贴吧看过。。。 期限是一周 不着急哦{:5_140:} 本帖最后由 unicornvalley 于 2011-7-30 10:53 编辑第二部分:
With that inmind, here are the basic problems with RTW animation and skeleton system:
下面是RTW动作和骨骼系统的一些限制和问题。
1. You cannot add new bones, as in you cannot makea new skeleton type. Sure, you can export new bones on your model, or evenexport new animations with that new skeleton. But the game cannot recognize itbecause the skeleton file, the fs_whatever, will not accept the new bones. Casein point, fs_slinger_new, which has one extra bone. Youcannot use the slinger's model on any other skeletonwithout first exporting it WITHOUT the extra bone, nor can you use the fs_slinger_new skeleton on any other model without firstexporting the model WITH the extra bone. If you want to see this problem, trychanging the skeleton type in DMB for slingers then see how they look in-game.
1.无法添加新的骨骼组成部分(骨头),即无法制作新的骨骼。当然,你可以将新的骨头输出当你的模型,甚至输出新的动作到这个骨骼上,但因为骨骼文件,即那个fsXXX,无法接受新的骨头,所以游戏无法识别。比如fs_slinger_new有一块多余的骨头,因此你无法将slinger这个模型用在其他骨骼上,除非在输出时去掉这块多余的骨头,你也不能将fs_slinger_new的骨骼用在其他模型上除非输出模型带上这块多余的骨头。如果你行在游戏中看到这个问题,在DMB中改变投石兵的骨骼然后看看他们在游戏中的表现就行了。
2. You cannot re-arrangebones. You're stuck with whatever skeletons already existed because in order tocreate "new" skeletons, you must copy from an existing fs_whatever.The animations also does not contain any positions of the bones, only theirrotations (except for Scene Root). So far, with Vercingetorix'stool, you can only hack into the skeleton file and change animation entries. 2.无法重新排列骨头,因为创建新的骨骼,你必须从已有的fs_XXX中复制,所以你只能将就使用已有的骨骼。动作文件也不含有骨骼的位置数据,只有他们的旋转方向。所以,用Vercingetorix's tool,你只能进入骨骼文件或改变动作的搭配。
3. You cannot add or remove sound triggers.Originally this is done via EVT files. But the skeletondoes not care for this EVT files which contains thesound file's name and the time it is to be triggered. This is dilemmatic for mymod, where the wargssound like horses because they use the same skeleton thus having the same soundtriggers. You either use the horse sounds or none at all. The problem lies,again, in fs_whatever skeleton file.
3.无法增加或去掉声音的触发。本来这需要通过EVT文件实现。但骨骼并不在乎这个包含了声音文件名和触发事件的EVT文件。这让我的MOD很难堪,因为战狼的声音会和马匹一样,因为他们使用了同样的骨骼,因此声音的触发也相同。你要么使用马匹的声音,或者什么都不用。问题还是处在fs_XXX这个骨骼文件上。
4. You cannot mount riders on any other skeletonthat does not already be designated as mounts. These are elephants, horses andcamels (cavalry). You cannot put riders on dogs, pigs and humans even if youidentify them as cavalry. For instance, my wargs use the skeleton of a horsebut with new animations. My trolls are using human skeleton but listed aselephant, therefore the "crew" on this elephant is"missing", as in the game engine will not render them. This isbecause non-cavalry skeletons do not have a "mount bone", as I callit, a bone designated to be the mounting point. If you want to see this, justuse the wardog entry in DMB and use it as a mount. The rider will be missinguntil the mount is killed, then the rider will pop into existence and start thedeath animation. 4.无法让骑手骑在设计时不是坐骑的骨骼上,他们包括战象、马匹、骆驼。你不能让骑手骑在、猪、狗、或者人身上(汗一个-_-!),即便你将他们设定为坐骑。比如,我的战狼使用了马匹的骨骼和新动作。我的巨魔使用了人类的骨骼但设定为战象,虽然战象的骑手不在。这是因为非坐骑的骨骼缺少一个“骑乘骨头”,我是这么叫它的,这个骨头被设计是用来为骑手坐的。如果你想看到这个问题的表现,只要在DMB中将战犬设置为坐骑,你会发现骑手消失了,直到坐骑被杀掉,骑手会突然出现并作出死亡动作。
5. Incompletions of some skeletons. For instance, fs_archer cannot engage in melee (thus an archer DMBentry has 2 skeletons: fs_archer, fs_dagger) while fs_slinger_new could (the entry is fs_slinger_new,fs_slinger_new). But fs_slinger_new has no"battle reaction" animations. It's missing dodging, feigningand blocking. They just don't trigger and the soldier just stands there. Youcan't do anything since you can't add triggers, or even remove them. 5.某些骨骼不完整。比如,fs_archer骨骼不能肉搏(因此弓箭手DMB有两套骨骼:fs_archer,fs_dagger)。而fs_slinger_new能够肉搏(使用骨骼为fs_slinger_new,fs_slinger_new)。但fs_slinger_new没有战斗反应动作,不能躲闪、被击倒(假死)和格挡,他们无法触发所以模型只是站在那。因为不能添加或移除触发器,所以你也无能为力。
Now, all of the problems stated above has beenresolved, with a new tool written by Knight Errant.The tool is still in experimental stage and it requires a great deal ofknowledge of the animations system and manual work to use it though. So I willtry to share whatever knowledge and information I managed to extort from it.
现在,通过KnightErrant的一个新工具,上面的问题已经得到了解决,这个工具还在测试阶段,所以使用起来需要大量有关动作系统的知识和手工操作。而我将努力与大家分享我所理解的所有知识。
NOTE: Keep in mind that this thread will focus onthe skeleton editing and NOT on animations, packing or other parts of modding.Please do not clutter the thread with general questions about animating in MAX,modeling and those other stuff. There are already tutorial threads on thoseaspects of modding. 注意这里我们主要讨论骨骼的编辑,而不是动作、打包等其他修改技巧。
This the tool: RTWskeletonconverter
It requires you to have Pythoninstalled.
Put it in data/animationwhere you have all of the skeletons for easier use. This tool can do 2 things:
1. It will read, for instance, fs_daggerand create fs_dagger.txt. In other words, it convertsthe skeleton file into a text file which you can read and alter.
2. It can convert the text file back into skeletonfile. For instance, you modified fs_dagger.txt andrenamed it fs_twoknives.txt. The toll will convert itinto fs_twoknives_modified. The "_modified" addition is done to keep it fromoveriding an existing skeleton by mistake. 这个工具:RTWskeletonconverter需要你先安装Python。将其放入data/animation文件夹,在那里有你之前使用的全部骨骼。这个工具可以做2件事:1.
它可以读取,比如fs_dagger文件,并创建fs_dagger.txt文件。也就是说,它将骨骼文件转换为一个你可以阅读并修改的txt文件。2.
它也可以将txt文件转换回骨骼文件。比如你将fs_dagger.txt修改后改名为fs_twoknives.txt。本工具可将其转换成fs_twoknives_modified。增加的“_modified”是为了避免将原骨骼文件覆盖。
本帖最后由 unicornvalley 于 2011-5-22 02:10 编辑
第三部分Ok, nowlet's crack open fs_dagger and get fs_dagger.txt.If you open it up, you will see this:
现在让我们破解fs_dagger得到fs_dagger.txt。将其打开,你将看到下面的编码(此处不全,请参照原帖)
Code:
+1.0000000
19
0 0063 0 0 00 +0.0000000 +0.0000000+0.0000000 -1
114 0 109970 0 0 0 +0.0952390+0.0007523 +0.0000001 0
0 0 00 0 0 0 0+0.0234129 -0.4646038 -0.0049952 1
114 0 109970 0 0 0 +0.0231562-0.4006252 -0.0124050 2
32 032320 0 0 0 -0.0000000+0.2124624 -0.0000000 0
71 1 0 00 0 0 0 -0.0002945+0.2115581 +0.0000000 4
59 159590 0 0 0 -0.0000617+0.2349734 +0.0000000 5
59 059590 0 0 0 +0.0040140-0.0843266 -0.2039877 5
59 059590 0 0 0 +0.0000000-0.2602941 -0.0697457 7
59 032650 0 0 0 +0.0000000-0.2600267 -0.0696740 8
10 059130 0 0 0 +0.1786139+0.0782279 -0.0239007 5
59 059590 0 0 0 +0.3022083+0.0110892 -0.0137860 10
59 059595 0 0 0 +0.2838367-0.0030067 +0.0263546 11
59 059590 0 0 0 -0.1780248+0.0782278 -0.0239007 5
78 095660 0 0 0 -0.3022082+0.0110892 -0.0137860 13
006578 4 00 0 -0.2838367 -0.0030065+0.0263547 14
66 069780 0 0 0 -0.0952390+0.0007524 +0.0000000 0
77 013100 0 0 0 -0.0234127-0.4646038 -0.0049953 16
116 0 109970 0 0 0 -0.0231561-0.4006253 -0.0124050 17
0 0063
150
Somewhat daunting, I know. And there's no manualfor it too, unlike many text files you can modify in RTW. There are onlynumbers, which we must try to interpret and explore what they do.
有点儿吓人,我知道。而且也没有说明书。不同于RTW中许多可以修改的txt文件。这里只有数字,所以我们必须探索并翻译出它们的含义。
This is what I have found out about what they meanor might mean:
以下是我对这些数字猜想的含义:(注:此处图挂了,原图中有A,B,C,D的标注,对理解至关重要,请参看原帖)
A. This is the size of the model. Verc's XIDX can resize a model by multiplying this numberand E with the new size. You can use that for easiest resizing, or you can editthis number and the coordinates to get a resize.
A.这里是模型的大小。Verc's XIDX能够通过增加这个数字重新定义模型大小。你可以简单的重新定义,或者编辑这个数字和坐标来重新定义。
B. This is the number of bones in the model,excluding Scene Root, which technically isn't a bone.
B.这里代表模型中骨头的数量。
C. Now this, is still elusize. I have no idea whatthese numbers do. If they're for some reason does SOMETHING, most of them areunused in fs_slinger_new, which uses 0 instead of anumber. So I have no idea what they do. Making them all 0 (which I did try)doesn't appear to change anything on the soldier's behavior, except during thefiring of a missile. It's still too hard to notice anything right now.
C.这个,我也不知道是干什么用的。在fs_slinger_new这里的数字都是0。将他们都改成0也没有明显改变模型的动作。除了在射箭时,但现在还说不清。
D. This is pretty useful. 5 0 0 0 means it's the"right hand" so far only used as an attach point for pikes. Naturallyit's on the right hand bone. If you change it to head bone, then pikes forpikemen units will be attached to the soldier's head. Making it all 0 will makepikes attached to Scene Root, aka. the pelvis (yes, it's juvile joy of watchingyour soldiers "raise" and "lower" his pike). 4 0 0 0 is usedon the left hand bone. As of now, I have no idea what this is used for. 1 0 0 0is the bone designated for the mounting of horse or camel. Basically it means 1rider per mount and it follows the triggers of a horse type. 2 0 0 0 is usedfor elephant skeleton, so this is a mounting bone for a skeleton used aselephant. If you used this attribute on another bone, the engine will attachthe crew/rider of the mount on that bone. So adding 1 0 0 0 on a bone willenable that skeleton to attach a horse rider on it. I have no idea if 3 0 0 0is used at all since I couldn't find a skeleton that uses it.
D.这个很有用。50 0 0 代表右手。目前只用作长枪的附着点。自然是在右手骨上。如果你将其改成头骨,那么长枪将附着在长枪兵的头上。将其都改成0则会让长枪附着在骨盆上(啊,是的,看着你的士兵举起和放下长枪你将异常兴奋)。40 0 0 代表左手骨。目前我还不知道有什么用。10 0 0代表骑乘马或骆驼用的骨头,基本意味着只能有1个骑手,并使用马匹的触发器。20 0 0 用在战象骨骼上,所以这是骑乘战象用的骨头(前面提到过)。如果你将这一特性用在其他骨头上,游戏引擎会将骑手放在那块骨头上。所以将添加10 0 0 在一个骨头上会使这个骨骼能够连接一个骑手。我不知道30 0 0 是什么意思,因为我没见过用它的骨骼。
E. Now this is the main attraction. This is thelist of the bone's coordinates in respect to itsparent. Changing the values of these will alter the appearance of a skeleton.You can extend arms, or the neck or create an entirely new skeleton.
3.这里是最吸引人的地方。这里是一份骨头坐标的清单,改变这里的数值将会改变骨骼的外观。你可以延长手臂,脖子,或创造一个全新的骨骼。
F. This is the hierarchy of the bones, which boneis which bone's children, etc. I will explain how to make the list easily laterin this post.
F.这里是骨头的等级,哪块骨头是哪块的孩子(下属?)。在后面我将解释如何简单的制作这个清单。
G. Unknown. Doesn't seem to do anything, really. fs_slinger_new and fs_archer even list them as all 0s. G. 不清楚。fs_slinger_new和fs_archer中这里都是0
H. The number of animation entries.
H.动作文件的入口数字
I. The entry for the animation to use. The list ofanimation triggers appear to be a set list. You cannot move stand_idleto the bottom and expects the engine to activate that for standing idle. Itwill always read the first entry as stand_idle. Thereappears to be a pre-determined set of trigger to be read when the engine readsa skeleton file.
I.使用的动作文件入口。动作触发清单貌似是固定的。你无法将stand_idle移到末尾还期望游戏引擎能够启动这个命令,它总是将stand_idle作为第一条读取。貌似在引擎读取骨骼文件时有预定的套路。
J. Most of these is unknown. There's littledifference between this entry's numbers and the others. There are someexceptions, most notable is the IMPACT FRAME number,where it indicated the frame an impact is supposed to occur when an attackanimation is played so the opponent may react accordingly. This one isinteresting because during my testing, if you put the impactframe to be 0, then the attack will not commence. If you put impact frame on all attacks to be 0, you will get aunit/soldier that CANNOT attack! Further research required.
J.尚不清楚。特别需要提到的是IMPACT FRAME数据,代表了攻击动作发生或对手所作出反应的界限。如果将impact frame改成0.攻击就不会发生。如果将所要的impact frame改成0.则会得到一个不能攻击的单位。尚需深入研究
K. This is the number of entries of soundtriggers. If there is no sound to be activated, this number is set at 0.
K.这里是声音触发器的入口。如果没有声音可供启动,这里的数字则设置为0
L. I'm semi-certain the number here corresponds tothe type of sound data banks. Further research required.
L.这里的数字可能对应声音数据库的类型。
M. I'm semi-certain the first number is the framethe sound should start to trigger and the third number is the last frame thesound could trigger. Having the same numbers mean the sound is always triggeredat that exact frame, having a range means they could be triggered at any timewithin the range. Note that this is still my speculation.
M.这里的第一个数字可能是声音可以开始触发的界限,而第三个数字是声音触发最后的界限,如果是同一个数字表示声音只在某一点触发,而如果是一个区间则表示声音在这个区间之内触发。注意这只是我的猜想
N. The name of the sound file/bank to derive thesound files from. This is what you change if you want this particular skeletonto produce a different sound than the one you copied it from.
N.声音文件的名称。这里就是如果你想要这幅骨骼发出不同的声音所要修改的地方。
O. This is still unknown. It appears to berelevant but I still don't know what they're for. O.应该有用,但还不清楚。
Then, we seethis part:
来看这一部分:
The "0 0 0" isfrom fs_dagger, which you cannot use for a missileunit. That "0 0 0" is actually 3 animationtriggers that are deactivated, they are missile_aim,missile_hold and missile_fire, which can be seen at the figure below it from fs_archer. I have tested and copied the 3 entries from fs_archer and paste it on fs_daggerto make a new skeleton and it works. I can just use "fs_archerdagger,fs_archerdagger" for entry in DMB instead of "fs_archer, fs_dagger". I am unsure why CAwould deactivate some animation triggers. Perhaps there's a limit on the numberof triggers? Or perhaps they do it simply to make skeleton files lesscluttered, as in less triggers better performance.
0 0 0 来自文件fs_dagger,你不能将其用在远处部队上。"00 0"实际是3个停用的动作触发器,分别是射击_瞄准,射击_暂停和射击_发射,这可以从fs_archer文件中看出来。我将fs_archer中的这3个动作复制粘贴到fs_dagger并制作了一个新骨骼,并且测试成功。我现在可以在DMB中使用"fs_archerdagger,fs_archerdagger"代替"fs_archer, fs_dagger"。我不知道为什么CA会停用这些动作触发器,也许是为了限制触发器数量,或者改善动作表现。
If we compare all of these entries then we findthat each skeleton is read in a series of triggers. If the entry is simply"0" then the game would say "There's no entry for it, can'tplay, let's crash instead!" like if you used "fs_dagger,fs_dagger" for a unit with a missile attack since missileanimations are missing from fs_dagger.
如果我们做个比较就会发现每个骨骼都是通过一系列触发器读取的。如果入口是0则游戏引擎就会说“这里没有入口,没法玩了,我们还是当机吧”,比如
将"fs_dagger, fs_dagger"用在远程兵种上,因为fs_dagger中没有远程动作
Ok, so let's get to the meat of the possibilities.What are really possible with this tool? Here's an example:
下面再举一个例子(图挂了,请参照原帖):
This is a screenshot of my testing of a completelydifferent skeleton but a very simple one: a snake, which is just a straightline.
这幅图是我所测试的一个完全不同但又非常简单的骨骼:一条蛇,也就是一条直线。
This is the model I quickly made up for thistesting.
I made 1 animation to test and the result can beseen here:这是一个我用来测试的模型,我制作了一个动作用来测试,结果可以在这里看到
http://www.youtube.com/watch?v=CiRFnRK3yTU
But what can a new kind of skeleton do forexisting models/units? Well, we can now do what M2TWmodders already did with adding new bones, like this:那么新的骨骼能对已有的模型有什么用呢?我们现在可以做到M2TW修改所做到的——增加骨头,像这样:
http://www.youtube.com/watch?v=DNNNEie1nn4
Note that there is a drawback to this method,meaning the bow cannot be "hidden" by the engine when switchingweapons. This is because it is animated, thus will not be read as "primaryweapon" stand-alone object. We are also bound by the hardcode:there's a maximum of 24 bones per skeleton. I tried adding more and the game justCTD without error message.
主要这个方法有个缺点,即在切换武器时弓无法被隐藏了,因为增加了它的动作。同时受hardcode限制,每个骨骼最多24跟骨头。
Even though it only appears I added very few newanimations on the archer, in fact ALL of the animations are new. Basically, Ihad to export every single animation to be used by the new skeleton (with 24bones instead of the regular 19 bones) because the way the engine readsanimations.
在我为弓箭手添加新动作时,因为所有动作都是新的,因为引擎读取动作的方式,我必须将用于新骨骼的每个动作输出(用24块骨头代替一般的19块)
The RTW engine (which I think was rectified inM2TW) reads every bone in the skeleton by a set list. For the regular skeletonRTW use, this is the list:RTW引擎是按固定清单读取骨骼中的每块骨头(这在M2TW中得到了修成),对与一般使用的RTW骨骼,清单如下:
bone_pelvis
bone_abs
bone_torso
bone_cloak_top
bone_cloak_mid
bone_cloak_bottom
bone_head
bone_Lupperarm
bone_Lelbow
bone_Lhand
bone_Rupperarm
bone_Relbow
bone_Rhand
bone_LThigh
bone_Llowerleg
bone_Lfoot
bone_RThigh
bone_Rlowerleg
bone_Rfoot
The list's coordinates can be seen in part Eabove. If you convert fs_archer and fs_slinger_new you will see the difference. The slingerhas an extra bone after bone_Rhand called bone_Weapon.Note that the names of bones are irrelevant. The engine ignores the names andonly reads from the list. Meaning if you used a regular skeleton's animation(19 bones) on a slinger (20 bones), the rotation value of bone_Rthigh will beapplied to the slinger's bone_Weapon and so on, untilthe slinger's last bone, bone_Rfoot, receives no rotation. Importing aslinger's animation on a skeleton with less than 20 bones will cause an error onthe MAX script. You can easily test this in MAX: open the slinger's model, thenimport a regular animation, it will show up weird. Now try it again but deletebone_Weapon before importing the same animation. The slinger modelshould animate normally.
这份清单的坐标在E中我们提到过。你可以在fs_archer和fs_slinger_new中看到区别。投石兵的右手骨头后面多出了一块骨头,叫bone_Weapon。注意这些骨头的名字无关紧要,因为引擎只按上面清单的顺序读取。也就是如果你将一个一般的骨骼动作(19块骨头)用在投石兵(20块骨头)上,那么右大腿骨的旋转动作就会用在投石兵多余的那块骨头bone_Weapon上,依次类推,而最后一块骨头,右脚骨,则不会旋转。将投石兵的动作输入到不足20块骨头的骨骼上会引起MAX脚本错误。而在输入动作之前删除bone_Weapon这块骨头,则投石兵模型应该动作正常。
So making a new skeleton for RTW has its drawback:you have to make every single animation it's going to use. Sure, it's notreally that hard since in my case, I just imported existing animations, add inthe new bones then export them. Only 3 animations are using the new bones:readying the bow, holding the bow and firing the arrow. It's a time-consuminglabor mostly.
所以在RTW中制作新骨骼是有缺点的:你必须制作要用到的每个动作,当然你可以输入已有的动作,或者添加新的骨头然后再将其输出。只有3个动作使用的了新的骨头,准备射击,拉弓,和射箭。这很费时费力。
So, in summary, to create a new skeleton, this iswhat you must do:
总的来说,创建新的骨骼,你要做下面几步:
1. Make the model with the new skeleton.
2. Export it as a CAS model, then press F11.
3. Copy the data shown by the scipt,this is important.
4. Make all the new animations you want to use onyour new skeleton, export them with all the bones.
5. Extract all the skeletons and animations.
6. Pick the closest skeleton you want to use, copyit and rename.
7. Convert the new skeleton into text file, openit.
8. At the bone coordinate part and hierarchy, usethe data from part 3. However, be sure to convert the coordinates rom (x, y, z) in MAX to (-x, z, -y) for the skeleton.
9. Change all the animations into the newanimations. Change any sound trigger if you want.
10. Convert the edited skeleton text file intoskeleton file. Delete the old one, rename the new one.
11. Add the new skeleton name in list.txt.
12. Add all the new animations in anim_list.txt
13. Repack skeletons and animations.
14. Use the new skeleton in DMB.
1.
用新的骨骼制作模型。2.
将其输出为CAS模型,然后按F11。3.
复制scipt(笔误吗?这词我不认得)中的数据。4.
制作新骨骼所要用到的所有动作,并将它们输出5.
提取所以的骨骼和动作。6.
选择一个你想用的最接近的骨骼,复制并重命名。7.
将新骨骼转换为txt文件,打开。8.
在骨头坐标和等级这里使用第3部分的数据。但是一定要将MAX中的坐标rom(x, y, z)转换成骨骼中的坐标(-x, z, -y)。9.
将所以的动作改成新动作,并修改声音触发。10.
将修改过的骨骼txt文件转换为骨骼文件,删除之前的,重命名新文件。11.
将新骨骼的名称添加到list.txt.12.
将所有新动作添加到anim_list.txt。13.
重新打包骨骼和动作文件。14.
在DMB中使用新骨骼。
Now let's get crackin' and figure out what elsecan we uncover from this!
Many thanks to Knight Errant for writingthis wonderful tool and putting up with my endless nagging for revisions andinfo.
PS. Also from Knigh Errant, a fix for Vencingetorix's CAS Export/Import tool here:CAS_IE_b79_modbyKE_ver3.ms
This updated tool does nothing for the averagemodder who only deals with models. The fixes are for animations. It fixes theanimation glitch where soldiers will not reach their actual destination if thewalking animation is edited. They will now reach their intended spots. Alsofixed is the glitch where the soldier have to do a 90 degrees turn and theengine cannot turn them partially. They can now do so without glitching. Onemore glitch still exists though, which is the not-reaching-destination glitchfor mounted units. 感谢中央气象台的Knight Errant。PS. KnightErrant的Vencingetorix's CAS Export/Import tool工具的一个补丁(请在原帖下载)这个补丁主要是针对动作所作的修正,修正了步行动作修改过后士兵无法到达指定目的地的错误;修正了一个士兵90度转身时发生的错误。现在仍存在一个错误,即骑兵单位无法到达指定目的地的错误。
本帖最后由 unicornvalley 于 2011-5-22 02:17 编辑
趁周末翻译完了,由于不懂修改,花了不少时间,也不懂编程,所以很多术语的翻译估计很不准确,请高手帮助纠正。 大半夜的,自己顶一个吧:L 辛苦了啊 :D 楼主加油!!!!!!! 这么辛苦 顶一个 很不错的教程,必须支持 大家结合这个教程吧:http://bbs.mountblade.com.cn/viewthread.php?tid=3530
虽然是骑砍的,不过一理通百理明 这篇翻译很有用
页:
[1]